PolyFEM
Loading...
Searching...
No Matches
SizingFieldRemesher.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace polyfem::mesh
6{
7 template <class WMTKMesh>
8 class SizingFieldRemesher : public WildRemesher<WMTKMesh>
9 {
10 private:
13
14 protected:
15 using Super::args;
16 using Super::executor;
17 using Super::state;
18
19 public:
21 using Tuple = typename Super::Tuple;
22 using Operations = typename Super::Operations;
23 using VectorNd = typename Super::VectorNd;
24 using MatrixNd = Eigen::Matrix<double, Super::DIM, Super::DIM>;
25
27 const State &state,
28 const Eigen::MatrixXd &obstacle_displacements,
29 const Eigen::MatrixXd &obstacle_vals,
30 const double current_time,
31 const double starting_energy)
33 {
34 }
35
37
38 // Edge splitting
39 void split_edges() override;
40 bool split_edge_before(const Tuple &t) override;
41
42 // Edge collapse
43 void collapse_edges() override;
44 bool collapse_edge_after(const Tuple &t) override;
45
46 using SparseSizingField = std::unordered_map<size_t, MatrixNd>;
47
50 const SparseSizingField &sizing_field) const;
51
53
54 std::unordered_map<size_t, double> compute_edge_sizings() const;
55
57 const SparseSizingField &field1,
58 const SparseSizingField &field2);
59
60 private:
61 template <typename Candidates>
63 const Candidates &candidates,
64 const ipc::CollisionMesh &collision_mesh,
65 const Eigen::MatrixXd &V,
66 const double dhat) const;
67 };
68
71
72} // namespace polyfem::mesh
int V
main class that contains the polyfem solver and all its state
Definition State.hpp:79
const Eigen::MatrixXd & obstacle_displacements() const
Get a reference to the collision obstacles' displacements.
Definition Remesher.hpp:133
const double current_time
Current time.
Definition Remesher.hpp:219
const double starting_energy
Starting energy.
Definition Remesher.hpp:221
const State & state
Reference to the simulation state.
Definition Remesher.hpp:191
const json args
Copy of remesh args.
Definition Remesher.hpp:213
bool split_edge_before(const Tuple &t) override
std::unordered_map< size_t, double > compute_edge_sizings() const
SizingFieldRemesher< WMTKMesh > This
SizingFieldRemesher(const State &state, const Eigen::MatrixXd &obstacle_displacements, const Eigen::MatrixXd &obstacle_vals, const double current_time, const double starting_energy)
SparseSizingField compute_contact_sizing_field_from_candidates(const Candidates &candidates, const ipc::CollisionMesh &collision_mesh, const Eigen::MatrixXd &V, const double dhat) const
Eigen::Matrix< double, Super::DIM, Super::DIM > MatrixNd
SparseSizingField smooth_contact_sizing_field(const SparseSizingField &sizing_field) const
SparseSizingField compute_contact_sizing_field() const
typename Super::Operations Operations
bool collapse_edge_after(const Tuple &t) override
static SparseSizingField combine_sizing_fields(const SparseSizingField &field1, const SparseSizingField &field2)
std::unordered_map< size_t, MatrixNd > SparseSizingField
SparseSizingField compute_elasticity_sizing_field() const
std::vector< std::pair< std::string, Tuple > > Operations
wmtk::ExecutePass< WildRemesher, EXECUTION_POLICY > executor
typename WMTKMesh::Tuple Tuple
wmtk::AttributeCollection< VertexAttributes > vertex_attrs
Eigen::Matrix< double, DIM, 1 > VectorNd
WildTetRemesher::Tuple Tuple
SizingFieldRemesher< wmtk::TetMesh > SizingFieldTetRemesher
SizingFieldRemesher< wmtk::TriMesh > SizingFieldTriRemesher