@@ -82,20 +82,20 @@ PYBIND11_MODULE(polyfempy, m) {
82
82
" sets polyfem log level, valid value between 0 (all logs) and 6 (no logs)" ,
83
83
py::arg (" log_level" ))
84
84
85
- .def (" load_mesh " , [](polyfem::State &s) {
85
+ .def (" load_mesh_from_settings " , [](polyfem::State &s) {
86
86
init_globals ();
87
87
s.load_mesh ();
88
88
},
89
89
" Loads a mesh from the 'mesh' field of the json and 'bc_tag' if any bc tags" )
90
90
91
- .def (" load_mesh " , [](polyfem::State &s, const std::string &path) {
91
+ .def (" load_mesh_from_path " , [](polyfem::State &s, const std::string &path) {
92
92
init_globals ();
93
93
s.args [" mesh" ] = path;
94
94
s.load_mesh ();
95
95
},
96
96
" Loads a mesh from the path and 'bc_tag' from the json if any bc tags" ,
97
97
py::arg (" path" ))
98
- .def (" load_mesh " , [](polyfem::State &s, const std::string &path, const std::string &bc_tag) {
98
+ .def (" load_mesh_from_path_and_tags " , [](polyfem::State &s, const std::string &path, const std::string &bc_tag) {
99
99
init_globals ();
100
100
s.args [" mesh" ] = path;
101
101
s.args [" bc_tag" ] = bc_tag;
@@ -106,17 +106,13 @@ PYBIND11_MODULE(polyfempy, m) {
106
106
.def (" set_mesh" , [](polyfem::State &s, const Eigen::MatrixXd &V, const Eigen::MatrixXi &F) {
107
107
init_globals ();
108
108
109
- GEO::Mesh M;
110
109
if (V.cols () == 2 )
111
- polyfem::to_geogram_mesh (V, F, M );
110
+ s. mesh = std::make_unique< polyfem::Mesh2D>( );
112
111
else
113
- polyfem::to_geogram_mesh_3d (V, F, M );
114
- s.load_mesh (M, []( const polyfem::RowVectorNd&){ return - 1 ; }, true );
112
+ s. mesh = std::make_unique< polyfem::Mesh3D>( );
113
+ s.mesh -> build_from_matrices (V, F );
115
114
116
- double boundary_id_threshold = s.args [" boundary_id_threshold" ];
117
- if (boundary_id_threshold <= 0 )
118
- boundary_id_threshold = s.mesh ->is_volume () ? 1e-2 : 1e-7 ;
119
- s.mesh ->compute_boundary_ids (boundary_id_threshold);
115
+ s.load_mesh ();
120
116
},
121
117
" Loads a mesh from vertices and connectivity" ,
122
118
py::arg (" vertices" ), py::arg (" connectivity" ))
@@ -142,7 +138,7 @@ PYBIND11_MODULE(polyfempy, m) {
142
138
py::arg (" boundary_marker" ))
143
139
144
140
145
- .def (" set_rhs " , [](polyfem::State &s, std::string &path) {
141
+ .def (" set_rhs_from_path " , [](polyfem::State &s, std::string &path) {
146
142
init_globals ();
147
143
s.args [" rhs_path" ] = path;
148
144
},
0 commit comments