Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core implementation of MultiPatch #161

Merged
merged 89 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
7f58576
shared_ptr as holder and splinelist based functions WIP
j042 Apr 26, 2023
21e001b
format
j042 Jun 12, 2023
a83b089
format
j042 Jun 12, 2023
0e98ae9
fix warning
j042 Jun 12, 2023
0a31c90
rough draft of even-ish load
j042 May 10, 2023
d9192e1
use min of (total, nthread)
j042 May 16, 2023
bc967cb
add fill query option
j042 May 16, 2023
206ff7d
add CheckParaDimAndDim
j042 May 16, 2023
658d35c
add EvaluateList and SampleList
j042 May 16, 2023
c93d932
replace new with D I vector
j042 May 17, 2023
16668ad
add boundary extract and prepend list_ for splinelist funcs
j042 May 17, 2023
4eeaa23
separate calc boundary center
j042 May 17, 2023
a3a05bb
edit boundary extract and add boundary center
j042 May 17, 2023
b51ea4d
fix function name and avoid update ListSample
j042 May 17, 2023
ec1bd8f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 17, 2023
b8b704a
fix comment
j042 May 17, 2023
5a2aad5
list functions are now member functions
j042 May 18, 2023
65288d2
add raise_dim_mismatch
j042 May 18, 2023
72828e6
use nthread step query instead of NThreadExecution helper
j042 May 22, 2023
ee0a165
edit comments
j042 May 22, 2023
f3f3e82
fix typo
j042 May 22, 2023
a351174
add all test spline creation and add to_derived
j042 May 22, 2023
5cbfcac
add spline list func tests
j042 May 22, 2023
c687407
add test_raise_dim_mismatch and error message
j042 May 22, 2023
4e385d6
rm <tuple>
j042 May 22, 2023
2a6dca7
edit cast and allow nthreadexe
j042 May 25, 2023
e527021
adapt to core splines
j042 May 25, 2023
b379fcd
abandon SplineList and use list() rough draft
j042 May 25, 2023
854b4e3
update test - test_extract_boundary is incomplete
j042 May 25, 2023
4a17d03
enforce single thread for core vector -> list
j042 May 26, 2023
24d36dd
add core submodule lists
j042 May 26, 2023
cb874c7
add list compose
j042 May 26, 2023
d5c02b5
add composition derivative
j042 May 22, 2023
3d0ffd7
fix #148
j042 May 22, 2023
928b06f
add binding
j042 May 22, 2023
4098f9c
compose WIP
j042 May 24, 2023
2a79703
update to py::list based funcs
j042 May 26, 2023
819c02d
change to n_total
j042 May 26, 2023
9ca67c7
add compose test
j042 May 26, 2023
227ccfa
fix indices and typo
j042 May 26, 2023
eda50fe
fix #148
j042 May 26, 2023
e75d93c
edit doc - no inplace support for lists
j042 May 26, 2023
029b106
add composition_der test
j042 May 26, 2023
33b0ba9
init/* only inits
j042 Apr 18, 2023
0f03159
relocate spline list to vec
j042 May 26, 2023
4061b3f
reorganize exporter and add multipatch
j042 Jun 6, 2023
dc0484c
add NullSpline
j042 Jun 6, 2023
acbc38e
move static lookup outside the class
j042 Jun 6, 2023
66b5b32
add null_spline()
j042 Jun 6, 2023
470fd2d
multi_patch WIP
j042 Jun 6, 2023
f97c274
fill current properties, iff not nullptr
j042 Jun 7, 2023
2f80404
add converters and mismatch check
j042 Jun 7, 2023
6f0f260
add None converter, evaluate, sample
j042 Jun 7, 2023
83e046e
add to_derived()
j042 Jun 7, 2023
1e81e04
extend mismatch check and add patch setters
j042 Jun 7, 2023
18299fe
edit naming, add sub_multipach, sub_patch_centers
j042 Jun 7, 2023
503af18
add SPLINEPY_COMPILE_PYTHON def
j042 Jun 12, 2023
64aaac8
load converter only if python core is compiled
j042 Jun 12, 2023
ea1af62
add inline, pbounds and extract boundary
j042 Jun 12, 2023
addec55
multipatch rough draft
j042 Jun 12, 2023
9456299
rm splinelist test
j042 Jun 12, 2023
f238676
bind PyMultiPatch
j042 Jun 12, 2023
794c2bc
inherit __init__
j042 Jun 12, 2023
11df9c9
get/set for default values, and field getter
j042 Jun 12, 2023
ec116a4
use core's interfaces, splines
j042 Jun 12, 2023
dd84b8b
only single thread core-to-pyspline
j042 Jun 12, 2023
f2e6a10
local import of to_derived
j042 Jun 12, 2023
b991ca9
update boundary_patches
j042 Jun 12, 2023
7a07231
update spline centers
j042 Jun 12, 2023
fc4c6d8
remove splinelist
j042 Jun 12, 2023
23a985d
Apply suggestions: clean up and fix
j042 Jun 13, 2023
8e46c06
add move ctor
j042 Jun 14, 2023
dc73b10
Add Fields to Multipatch
jzwar Mar 28, 2023
b258520
Move spline-export to seperate function
jzwar Mar 28, 2023
e12eacc
Enable Field export in gismo
jzwar Mar 28, 2023
9972a5f
Bugfix and indentation
jzwar Mar 28, 2023
0233b0e
Renaming solved the issue
jzwar Mar 28, 2023
5e91743
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 28, 2023
0c43ea9
Support only
jzwar Mar 30, 2023
b1022c2
Stable sort to ensure ordered numbers
jzwar Mar 31, 2023
e546e95
use core function
j042 Jun 12, 2023
bfa5b97
remove unused parts
j042 Jun 12, 2023
5304ad2
Update splinepy/multipatch.py
j042 Jun 16, 2023
0313c33
Revert "fix warning"
j042 Jun 19, 2023
5d76f35
*fields to fields
j042 Jun 19, 2023
ce05df2
clean up
j042 Jun 19, 2023
cf556ce
always return derived multipatch
j042 Jun 19, 2023
e90a9a9
propagate same_parametric_bounds for fields
j042 Jun 19, 2023
b873f2b
v[2]++
j042 Jun 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ if(SPLINEPY_MORE)
set(SPLINEPY_DEFS ${SPLINEPY_DEFS} SPLINEPY_MORE)
endif(SPLINEPY_MORE)

if(SPLINEPY_COMPILE_PYTHON)
j042 marked this conversation as resolved.
Show resolved Hide resolved
set(SPLINEPY_DEFS ${SPLINEPY_DEFS} SPLINEPY_COMPILE_PYTHON)
endif(SPLINEPY_COMPILE_PYTHON)

if(SPLINEPY_BUILD_EXPLICIT)
set(SPLINEPY_DEFS ${SPLINEPY_DEFS}
SPLINEPY_BUILD_EXPLICIT)
Expand Down
2 changes: 1 addition & 1 deletion cpp/splinepy/py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set(PYSPLINEPY_SRCS
init/coordinate_reference.cpp
init/core_spline.cpp
init/fitting.cpp
init/multi_patch.cpp
init/reader.cpp
init/spline_extensions.cpp
init/spline_list.cpp
init/uffpy.cpp
splinepy_core.cpp)

Expand Down
52 changes: 1 addition & 51 deletions cpp/splinepy/py/init/exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,6 @@

namespace splinepy::py::init {

void init_exporter(py::module_& m) {
// Void functions that define arguments
// returns [connectivity, vertex_ids, edge_information, boundaries]
m.def("retrieve_mfem_information",
&splinepy::py::RetrieveMfemInformation,
py::arg("corner_vertices"),
py::arg("tolerance"));
m.def("interfaces_from_boundary_centers",
&splinepy::py::InterfacesFromBoundaryCenters,
py::arg("face_center_vertices"),
py::arg("tolerance"),
py::arg("para_dim"));
m.def("extract_all_boundary_splines",
&splinepy::py::ExtractAllBoundarySplines,
py::arg("splines"),
py::arg("interfaces"),
py::arg("nthreads") = 1);
m.def("orientations",
&splinepy::py::GetBoundaryOrientations,
py::arg("splines"),
py::arg("base_ids"),
py::arg("base_face_ids"),
py::arg("neighbor_ids"),
py::arg("neighbor_face_ids"),
py::arg("tolerance"),
py::arg("nthreads") = 1);
m.def("boundaries_from_continuity",
&splinepy::py::AddBoundariesFromContinuity,
py::arg("boundary_splines"),
py::arg("boundary_interfaces"),
py::arg("global_interfaces"),
py::arg("tolerance"),
py::arg("nthreads") = 1);
m.def("export_iges",
&splinepy::py::ExportIges,
py::arg("fname"),
py::arg("splines"));
m.def("export_irit",
&splinepy::py::ExportIrit,
py::arg("fname"),
py::arg("splines"));
m.def("export_xml",
&splinepy::py::ExportXml,
py::arg("fname"),
py::arg("splines"));
m.def("export_vtk",
&splinepy::py::ExportVtk,
py::arg("fname"),
py::arg("splines"),
py::arg("resolutions_per_spline"));
}
void init_exporter(py::module_& m) { add_spline_exporter(m); }

} // namespace splinepy::py::init
35 changes: 1 addition & 34 deletions cpp/splinepy/py/init/fitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,6 @@

namespace splinepy::py::init {

void init_fitting(py::module_& m) {
// Functions that return fitted bspline as dict.
m.def("interpolate_curve",
&splinepy::py::InterpolateCurve,
py::arg("points"),
py::arg("degree"),
py::arg("centripetal"),
py::arg("knot_vector"));
m.def("approximate_curve",
&splinepy::py::ApproximateCurve,
py::arg("points"),
py::arg("degree"),
py::arg("n_control_points"),
py::arg("centripetal"),
py::arg("knot_vector"));
m.def("interpolate_surface",
&splinepy::py::InterpolateSurface,
py::arg("points"),
py::arg("size_u"),
py::arg("size_v"),
py::arg("degree_u"),
py::arg("degree_v"),
py::arg("centripetal"));
m.def("approximate_surface",
&splinepy::py::ApproximateSurface,
py::arg("points"),
py::arg("num_points_u"),
py::arg("num_points_v"),
py::arg("size_u"),
py::arg("size_v"),
py::arg("degree_u"),
py::arg("degree_v"),
py::arg("centripetal"));
}
void init_fitting(py::module_& m) { add_fitting(m); }

} // namespace splinepy::py::init
7 changes: 7 additions & 0 deletions cpp/splinepy/py/init/multi_patch.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <splinepy/py/py_multi_patch.hpp>

namespace splinepy::py::init {

void init_multi_patch(py::module_& m) { add_multi_patch(m); }

} // namespace splinepy::py::init
8 changes: 1 addition & 7 deletions cpp/splinepy/py/init/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

namespace splinepy::py::init {

void init_reader(py::module_& m) {
// Functions that return list of dict.
// Keys are ["knot_vectors", "control_points", "degrees"] (+ ["weights"])
m.def("read_iges", &read_iges, py::arg("fname"))
.def("read_xml", &read_xml, py::arg("fname"))
.def("read_irit", &read_irit, py::arg("fname"));
}
void init_reader(py::module_& m) { add_spline_reader(m); }

} // namespace splinepy::py::init
7 changes: 0 additions & 7 deletions cpp/splinepy/py/init/spline_list.cpp

This file was deleted.

35 changes: 35 additions & 0 deletions cpp/splinepy/py/py_fitting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,39 @@ py::dict ApproximateSurface(py::array_t<double> points,
return dict_spline;
}

inline void add_fitting(py::module& m) {
// Functions that return fitted bspline as dict.
m.def("interpolate_curve",
&splinepy::py::InterpolateCurve,
py::arg("points"),
py::arg("degree"),
py::arg("centripetal"),
py::arg("knot_vector"));
m.def("approximate_curve",
&splinepy::py::ApproximateCurve,
py::arg("points"),
py::arg("degree"),
py::arg("n_control_points"),
py::arg("centripetal"),
py::arg("knot_vector"));
m.def("interpolate_surface",
&splinepy::py::InterpolateSurface,
py::arg("points"),
py::arg("size_u"),
py::arg("size_v"),
py::arg("degree_u"),
py::arg("degree_v"),
py::arg("centripetal"));
m.def("approximate_surface",
&splinepy::py::ApproximateSurface,
py::arg("points"),
py::arg("num_points_u"),
py::arg("num_points_v"),
py::arg("size_u"),
py::arg("size_v"),
py::arg("degree_u"),
py::arg("degree_v"),
py::arg("centripetal"));
}

} // namespace splinepy::py
Loading