diff --git a/cmake/recipes/polyfem.cmake b/cmake/recipes/polyfem.cmake index f0ca4f3..39020eb 100644 --- a/cmake/recipes/polyfem.cmake +++ b/cmake/recipes/polyfem.cmake @@ -11,7 +11,7 @@ include(FetchContent) FetchContent_Declare( polyfem GIT_REPOSITORY https://github.com/polyfem/polyfem.git - GIT_TAG 76afcb9bd6d2dcd24a344478f1d7025540b05395 + GIT_TAG fcab1f5339e1f25eb2f2d214d17b7ec68a1bc0a2 GIT_SHALLOW FALSE ) FetchContent_MakeAvailable(polyfem) diff --git a/src/binding.cpp b/src/binding.cpp index cdcdbeb..7050ded 100644 --- a/src/binding.cpp +++ b/src/binding.cpp @@ -353,7 +353,7 @@ PYBIND11_MODULE(polyfempy, m) // py::scoped_ostream_redirect output; if (V.cols() == 2) - s.mesh = std::make_unique(); + s.mesh = std::make_unique(); else s.mesh = std::make_unique(); s.mesh->build_from_matrices(V, F); @@ -372,7 +372,7 @@ PYBIND11_MODULE(polyfempy, m) // py::scoped_ostream_redirect output; if (V.cols() == 2) - s.mesh = std::make_unique(); + s.mesh = std::make_unique(); else s.mesh = std::make_unique(); s.mesh->build_from_matrices(V, F); @@ -790,6 +790,13 @@ PYBIND11_MODULE(polyfempy, m) throw "Updating BC works only for Tensor GenericProblems"; } }, "updates pressure boundary", py::arg("id"), py::arg("val"), py::arg("interp") = std::string("")) + .def( + "update_obstacle_displacement", [](polyfem::State &self, const int oid, const py::object &val, const std::string &interp) { + using namespace polyfem; + // py::scoped_ostream_redirect output; + const json json_val = val; + self.obstacle.change_displacement(oid, json_val, interp); }, + "updates obstacle displacement", py::arg("oid"), py::arg("val"), py::arg("interp") = std::string("")) .def( "render", [rendering_lambda](polyfem::State &self, int width, int height, const Eigen::MatrixXd &camera_positionm, const double camera_fov, const double camera_near, const double camera_far, const bool is_perspective, const Eigen::MatrixXd &lookatm, const Eigen::MatrixXd &upm, const Eigen::MatrixXd &ambient_lightm, const std::vector> &lights, const Eigen::MatrixXd &diffuse_colorm, const Eigen::MatrixXd &specular_colorm, const double specular_exponent) { using namespace Eigen; @@ -1073,7 +1080,7 @@ PYBIND11_MODULE(polyfempy, m) if (vertices.size() > 0 && cells.size() > 0) { if (is2d) - state.mesh = std::make_unique(); + state.mesh = std::make_unique(); else state.mesh = std::make_unique(); state.mesh->build_from_matrices(vertices, cells);