@@ -464,106 +464,6 @@ void define_solver(py::module_ &m)
464464 " exports the solution as vtu" , py::arg (" path" ), py::arg (" solution" ),
465465 py::arg (" pressure" ) = Eigen::MatrixXd (), py::arg (" time" ) = double (0 .),
466466 py::arg (" dt" ) = double (0 .))
467-
468- .def (
469- " get_boundary_sidesets" ,
470- [](State &s) {
471- // py::scoped_ostream_redirect output;
472- Eigen::MatrixXd points;
473- Eigen::MatrixXi faces;
474- Eigen::MatrixXd sidesets;
475-
476- io::Evaluator::get_sidesets (*s.mesh , points, faces, sidesets);
477-
478- return py::make_tuple (points, faces, sidesets);
479- },
480- " exports get the boundary sideset, edges in 2d or trangles in 3d" )
481-
482- .def (
483- " update_dirichlet_boundary" ,
484- [](State &self, const int id, const py::object &val, const bool isx,
485- const bool isy, const bool isz, const std::string &interp) {
486- using namespace polyfem ;
487- // py::scoped_ostream_redirect output;
488- const json json_val = val;
489- if (assembler::GenericTensorProblem *prob0 =
490- dynamic_cast <assembler::GenericTensorProblem *>(
491- self.problem .get ()))
492- {
493- prob0->update_dirichlet_boundary (id, json_val, isx, isy, isz,
494- interp);
495- }
496- else if (assembler::GenericScalarProblem *prob1 =
497- dynamic_cast <assembler::GenericScalarProblem *>(
498- self.problem .get ()))
499- {
500- prob1->update_dirichlet_boundary (id, json_val, interp);
501- }
502- else
503- {
504- throw " Updating BC works only for GenericProblems" ;
505- }
506- },
507- " updates dirichlet boundary" , py::arg (" id" ), py::arg (" val" ),
508- py::arg (" isx" ) = bool (true ), py::arg (" isy" ) = bool (true ),
509- py::arg (" isz" ) = bool (true ), py::arg (" interp" ) = std::string (" " ))
510- .def (
511- " update_neumann_boundary" ,
512- [](State &self, const int id, const py::object &val,
513- const std::string &interp) {
514- using namespace polyfem ;
515- // py::scoped_ostream_redirect output;
516- const json json_val = val;
517-
518- if (auto prob0 = dynamic_cast <assembler::GenericTensorProblem *>(
519- self.problem .get ()))
520- {
521- prob0->update_neumann_boundary (id, json_val, interp);
522- }
523- else if (auto prob1 =
524- dynamic_cast <assembler::GenericScalarProblem *>(
525- self.problem .get ()))
526- {
527- prob1->update_neumann_boundary (id, json_val, interp);
528- }
529- else
530- {
531- throw " Updating BC works only for GenericProblems" ;
532- }
533- },
534- " updates neumann boundary" , py::arg (" id" ), py::arg (" val" ),
535- py::arg (" interp" ) = std::string (" " ))
536- .def (
537- " update_pressure_boundary" ,
538- [](State &self, const int id, const py::object &val,
539- const std::string &interp) {
540- using namespace polyfem ;
541- // py::scoped_ostream_redirect output;
542- const json json_val = val;
543-
544- if (auto prob = dynamic_cast <assembler::GenericTensorProblem *>(
545- self.problem .get ()))
546- {
547- prob->update_pressure_boundary (id, json_val, interp);
548- }
549- else
550- {
551- throw " Updating BC works only for Tensor GenericProblems" ;
552- }
553- },
554- " updates pressure boundary" , py::arg (" id" ), py::arg (" val" ),
555- py::arg (" interp" ) = std::string (" " ))
556- .def (
557- " update_obstacle_displacement" ,
558- [](State &self, const int oid, const py::object &val,
559- const std::string &interp) {
560- using namespace polyfem ;
561- // py::scoped_ostream_redirect output;
562- const json json_val = val;
563- self.obstacle .change_displacement (oid, json_val, interp);
564- },
565- " updates obstacle displacement" , py::arg (" oid" ), py::arg (" val" ),
566- py::arg (" interp" ) = std::string (" " ))
567467 .def (
568468 " set_friction_coefficient" , [](State &self, const double mu) {
569469 self.args [" contact" ][" friction_coefficient" ] = mu;
0 commit comments