30 assert(position_mesh->is_from_same_multi_mesh_structure(*periodic_mesh));
35 auto surface_accessor = position_mesh->create_accessor<int64_t>(surface_handle);
38 surface_accessor.scalar_attribute(f) =
45 std::shared_ptr<Mesh> surface_mesh = position_mesh->get_child_meshes().back();
49 assert(position_mesh->get_child_meshes().size() == 1);
50 assert(periodic_mesh->get_child_meshes().size() == 1);
53 auto position_handle =
56 auto surface_position_handle =
59 auto propagate_to_child_position =
60 [](
const Eigen::MatrixX<double>& P) -> Eigen::VectorX<double> {
return P; };
62 auto update_child_positon =
63 std::make_shared<wmtk::operations::SingleAttributeTransferStrategy<double, double>>(
64 surface_position_handle,
66 propagate_to_child_position);
68 update_child_positon->run_on_all();
70 wmtk::logger().info(
"registered surface mesh to position mesh");
72 std::vector<attribute::MeshAttributeHandle> pass_through_attributes;
73 pass_through_attributes.push_back(surface_handle);
86 pass_through_attributes,
void periodic_optimization(Mesh &periodic_mesh, Mesh &position_mesh, Mesh &surface_mesh, const double target_edge_length, const double max_amips_energy, const int64_t passes, const double envelope_size, const bool intermediate_output, std::vector< attribute::MeshAttributeHandle > &pass_through_attributes, std::string output_dir, std::string output)