44 using ExprPtr = expression_parser::ExpressionPtr;
50 std::vector<Vector2d> m_V_envelope;
51 std::vector<Vector2i> m_E_envelope;
53 std::vector<std::tuple<ExprPtr, double>> m_sizing_field;
54 std::vector<std::tuple<ExprPtr, double>> m_quality_field;
56 bool m_collapse_check_link_condition =
false;
57 bool m_collapse_check_topology =
false;
58 bool m_collapse_check_manifold =
false;
71 m_envelope_eps = envelope_eps;
72 NUM_THREADS = _num_threads;
74 optimization::deactivate_opt_logger();
79 logger().info(
"w_envelope = {}", we);
97 const MatrixSi& T_tags,
98 const std::vector<std::string>& tag_names);
110 const MatrixSi& T_tags,
111 const std::vector<std::string>& tag_names);
113 void init_surfaces_and_boundaries();
115 void init_envelope(
const MatrixXd& V,
const MatrixXi& F);
117 CellTag string_set_to_cell_tag(
const std::set<std::string>& str_set);
119 void set_sizing_field(
const nlohmann::json& sizing_field_json);
121 void set_quality_field(
const nlohmann::json& quality_field_json);
123 double target_quality(
const size_t tid)
const;
124 double target_quality(
const Tuple& t)
const;
127 double quality_rel(
const size_t tid)
const override;
129 bool check_mesh_quality(
double& max_rel_quality,
const bool verbose =
false)
const;
130 std::vector<size_t> active_vertices()
const override;
146 void write_msh(std::string file,
const bool write_envelope =
true);
148 void write_vtu(
const std::string& path)
const;
149 void write_vtu_with_energies(
const std::string& path)
const;
158 std::shared_ptr<polysolve::nonlinear::Problem> get_envelope_energy(
const Tuple& t)
const;
160 std::vector<std::array<double, 6>> get_amips_assembles(
const Tuple& t)
const;
161 std::shared_ptr<polysolve::nonlinear::Problem> get_amips_energy(
const Tuple& t)
const;
169 double triangle_area(
const size_t fid)
const;
194 std::vector<ConnectedComponent>
find_holes(
const std::vector<CellTag>& tag_in)
const;
213 const std::vector<CellTag>& lcc_tags,
214 const size_t n_lcc = 1);
216 void fill_holes_topo(
217 const std::vector<CellTag>& fill_holes_tags,
218 double threshold = std::numeric_limits<double>::infinity());
220 void seal_connected_components(
221 const std::vector<CellTag>& tag_sets,
222 const std::vector<ConnectedComponent>& components);
224 void tight_seal_topo(
225 const std::vector<std::vector<CellTag>>& tight_seal_tag_sets,
226 double threshold = std::numeric_limits<double>::infinity());
228 void resolve_overlaps(
const std::vector<std::array<ExprPtr, 2>>& intersecting_tags);
230 void replace_tags(
const std::vector<CellTag>& tags_in,
const std::vector<CellTag>& tags_out);
232 void tag_priority(
const std::vector<int64_t>& tags_order);
238 std::function<double(
const Vector2d&)> m_voronoi_split_fn =
nullptr;
239 size_t m_last_split_vertex = 0;
243 double optimization_stop_metric()
const override {
return 1.; }
244 bool optimization_stop_at_float()
const override {
return m_sim_params.stop_at_float; }
246 void write_smoothing_debug_output(
const std::string& path)
const override { write_vtu(path); }
248 bool collapse_quality_allowed(
size_t v1,
size_t fid,
double q,
double ring_max)
const override;
249 void collapse_after_vertex(
size_t v1,
size_t v2)
override;
250 bool split_adjust_position(
size_t v_new,
const std::vector<Tuple>& children)
override;
251 void split_after_vertex(
size_t v_new)
override { m_last_split_vertex = v_new; }