@@ -342,38 +342,30 @@ PYBIND11_MODULE(polyfempy, m)
342342 " load_mesh_from_settings" , [](polyfem::State &s, const bool normalize_mesh, const double vismesh_rel_area, const int n_refs, const double boundary_id_threshold) {
343343 init_globals (s);
344344 // py::scoped_ostream_redirect output;
345- throw std::runtime_error (" Need to convert JSON" );
346- s.args [" normalize_mesh" ] = normalize_mesh;
347- s.args [" n_refs" ] = n_refs;
348- s.args [" boundary_id_threshold" ] = boundary_id_threshold;
349- s.args [" vismesh_rel_area" ] = vismesh_rel_area;
345+ s.args [" geometry" ][" advanced" ][" normalize_mesh" ] = normalize_mesh;
346+ s.args [" output" ][" paraview" ][" vismesh_rel_area" ] = vismesh_rel_area;
350347 s.load_mesh (); },
351348 " Loads a mesh from the 'mesh' field of the json and 'bc_tag' if any bc tags" , py::arg (" normalize_mesh" ) = bool (false ), py::arg (" vismesh_rel_area" ) = double (0.00001 ), py::arg (" n_refs" ) = int (0 ), py::arg (" boundary_id_threshold" ) = double (-1 ))
352349
353350 .def (
354351 " load_mesh_from_path" , [](polyfem::State &s, const std::string &path, const bool normalize_mesh, const double vismesh_rel_area, const int n_refs, const double boundary_id_threshold) {
355352 init_globals (s);
356353 // py::scoped_ostream_redirect output;
357- throw std::runtime_error (" Need to convert JSON" );
358354 s.args [" mesh" ] = path;
359- s.args [" normalize_mesh" ] = normalize_mesh;
360- s.args [" n_refs" ] = n_refs;
361- s.args [" boundary_id_threshold" ] = boundary_id_threshold;
362- s.args [" vismesh_rel_area" ] = vismesh_rel_area;
355+ s.args [" geometry" ][" advanced" ][" normalize_mesh" ] = normalize_mesh;
356+ s.args [" output" ][" paraview" ][" vismesh_rel_area" ] = vismesh_rel_area;
363357 s.load_mesh (); },
364358 " Loads a mesh from the path and 'bc_tag' from the json if any bc tags" , py::arg (" path" ), py::arg (" normalize_mesh" ) = bool (false ), py::arg (" vismesh_rel_area" ) = double (0.00001 ), py::arg (" n_refs" ) = int (0 ), py::arg (" boundary_id_threshold" ) = double (-1 ))
365359
366360 .def (
367361 " load_mesh_from_path_and_tags" , [](polyfem::State &s, const std::string &path, const std::string &bc_tag, const bool normalize_mesh, const double vismesh_rel_area, const int n_refs, const double boundary_id_threshold) {
368362 init_globals (s);
369363 // py::scoped_ostream_redirect output;
370- throw std::runtime_error (" Need to convert JSON" );
371364 s.args [" mesh" ] = path;
372365 s.args [" bc_tag" ] = bc_tag;
373- s.args [" normalize_mesh" ] = normalize_mesh;
366+ s.args [" geometry " ][ " advanced " ][ " normalize_mesh" ] = normalize_mesh;
374367 s.args [" n_refs" ] = n_refs;
375- s.args [" boundary_id_threshold" ] = boundary_id_threshold;
376- s.args [" vismesh_rel_area" ] = vismesh_rel_area;
368+ s.args [" output" ][" paraview" ][" vismesh_rel_area" ] = vismesh_rel_area;
377369 s.load_mesh (); },
378370 " Loads a mesh and bc_tags from path" , py::arg (" path" ), py::arg (" bc_tag_path" ), py::arg (" normalize_mesh" ) = bool (false ), py::arg (" vismesh_rel_area" ) = double (0.00001 ), py::arg (" n_refs" ) = int (0 ), py::arg (" boundary_id_threshold" ) = double (-1 ))
379371
@@ -388,11 +380,10 @@ PYBIND11_MODULE(polyfempy, m)
388380 s.mesh = std::make_unique<polyfem::mesh::CMesh3D>();
389381 s.mesh ->build_from_matrices (V, F);
390382
391- throw std::runtime_error (" Need to convert JSON" );
392- s.args [" normalize_mesh" ] = normalize_mesh;
393- s.args [" n_refs" ] = n_refs;
383+ s.args [" geometry" ][" advanced" ][" normalize_mesh" ] = normalize_mesh;
384+ s.args [" geometry" ][" n_refs" ] = n_refs;
394385 s.args [" boundary_id_threshold" ] = boundary_id_threshold;
395- s.args [" vismesh_rel_area" ] = vismesh_rel_area;
386+ s.args [" output " ][ " paraview " ][ " vismesh_rel_area" ] = vismesh_rel_area;
396387
397388 s.load_mesh (); },
398389 " Loads a mesh from vertices and connectivity" , py::arg (" vertices" ), py::arg (" connectivity" ), py::arg (" normalize_mesh" ) = bool (false ), py::arg (" vismesh_rel_area" ) = double (0.00001 ), py::arg (" n_refs" ) = int (0 ), py::arg (" boundary_id_threshold" ) = double (-1 ))
@@ -408,12 +399,11 @@ PYBIND11_MODULE(polyfempy, m)
408399 s.mesh = std::make_unique<polyfem::mesh::CMesh3D>();
409400 s.mesh ->build_from_matrices (V, F);
410401 s.mesh ->attach_higher_order_nodes (nodes_pos, nodes_indices);
411- throw std::runtime_error (" Need to convert JSON" );
412402
413- s.args [" normalize_mesh" ] = normalize_mesh;
414- s.args [" n_refs" ] = n_refs;
403+ s.args [" geometry " ][ " advanced " ][ " normalize_mesh" ] = normalize_mesh;
404+ s.args [" geometry " ][ " n_refs" ] = n_refs;
415405 s.args [" boundary_id_threshold" ] = boundary_id_threshold;
416- s.args [" vismesh_rel_area" ] = vismesh_rel_area;
406+ s.args [" output " ][ " paraview " ][ " vismesh_rel_area" ] = vismesh_rel_area;
417407
418408 s.load_mesh (); },
419409 " Loads an high order mesh from vertices, connectivity, nodes, and node indices mapping element to nodes" , py::arg (" vertices" ), py::arg (" connectivity" ), py::arg (" nodes_pos" ), py::arg (" nodes_indices" ), py::arg (" normalize_mesh" ) = bool (false ), py::arg (" vismesh_rel_area" ) = double (0.00001 ), py::arg (" n_refs" ) = int (0 ), py::arg (" boundary_id_threshold" ) = double (-1 ))
@@ -441,8 +431,7 @@ PYBIND11_MODULE(polyfempy, m)
441431 " set_rhs_from_path" , [](polyfem::State &s, std::string &path) {
442432 init_globals (s);
443433 // py::scoped_ostream_redirect output;
444- throw std::runtime_error (" Need to convert JSON" );
445- s.args [" rhs_path" ] = path; },
434+ throw std::runtime_error (" No RHS path" ); },
446435 " Loads the rhs from a file" , py::arg (" path" ))
447436 .def (
448437 " set_rhs" , [](polyfem::State &s, const Eigen::MatrixXd &rhs) {
@@ -898,7 +887,7 @@ PYBIND11_MODULE(polyfempy, m)
898887 in_args[" n_refs" ] = n_refs;
899888 if (!problem_name.empty ())
900889 in_args[" problem" ] = problem_name;
901- in_args[" normalize_mesh" ] = !skip_normalization;
890+ in_args[" geometry " ][ " advanced " ][ " normalize_mesh" ] = !skip_normalization;
902891 in_args[" project_to_psd" ] = project_to_psd;
903892
904893 if (!scalar_formulation.empty ())
@@ -927,7 +916,7 @@ PYBIND11_MODULE(polyfempy, m)
927916 in_args[" solver_type" ] = solver;
928917
929918 if (vis_mesh_res > 0 )
930- in_args[" vismesh_rel_area" ] = vis_mesh_res;
919+ in_args[" output " ][ " paraview " ][ " vismesh_rel_area" ] = vis_mesh_res;
931920
932921 if (export_material_params)
933922 in_args[" export" ][" material_params" ] = true ;
@@ -982,7 +971,7 @@ PYBIND11_MODULE(polyfempy, m)
982971 in_args.contains (" discr_order" ) ? int (in_args[" discr_order" ]) : 1 ;
983972
984973 if (discr_order == 1 && !in_args.contains (" vismesh_rel_area" ))
985- in_args[" vismesh_rel_area" ] = 1e10 ;
974+ in_args[" output " ][ " paraview " ][ " vismesh_rel_area" ] = 1e10 ;
986975
987976 polyfem::State state;
988977 state.init_logger (" " , log_level, false );
0 commit comments