PolyFEM
Loading...
Searching...
No Matches
MMGRemesh.hpp
Go to the documentation of this file.
1// Original source from cellogram (https://github.com/cellogram/cellogram/blob/master/src/cellogram/remesh_adaptive.h)
2// Authors: Tobias Lendenmann, Teseo Schneider, Jérémie Dumas, Marco Tarini
3// License: MIT (https://github.com/cellogram/cellogram/blob/master/LICENSE)
4
5#pragma once
6
7#ifdef POLYFEM_WITH_MMG
8
10#include <Eigen/Dense>
12
13namespace polyfem::mesh
14{
15
16 // See MmgTools documentation for interpreation
17 // https://www.mmgtools.org/mmg-remesher-try-mmg/mmg-remesher-options
18 //
19 struct MmgOptions
20 {
21 /* Remeshing */
22 bool angle_detection = true;
23 double angle_value = 45.;
24 double hausd = 0.01;
25 double hsiz = 0.0; /* using hmin and hmax if set to 0 */
26 double hmin = 0.01;
27 double hmax = 2.;
28 double hgrad = 1.105171;
29 bool enable_anisotropy = false;
30 bool optim = false;
31 bool optimLES = false;
32 bool opnbdy = false;
33 bool noinsert = false;
34 bool noswap = false;
35 bool nomove = false;
36 bool nosurf = false;
37 std::string metric_attribute = "no_metric";
38 /* Level set extraction */
39 bool level_set = false;
40 std::string ls_attribute = "no_ls";
41 double ls_value = 0.;
42 };
43
53 void remesh_adaptive_2d(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::VectorXd &S,
54 Eigen::MatrixXd &OV, Eigen::MatrixXi &OF, MmgOptions opt = MmgOptions());
55
66 void remesh_adaptive_3d(const Eigen::MatrixXd &V, const Eigen::MatrixXi &T, const Eigen::VectorXd &S,
67 Eigen::MatrixXd &OV, Eigen::MatrixXi &OF, Eigen::MatrixXi &OT, MmgOptions opt = MmgOptions());
68
69} // namespace polyfem::mesh
70
71#endif
int V