38 #ifndef GETFEM_MESH_LEVEL_SET_H__ 39 #define GETFEM_MESH_LEVEL_SET_H__ 55 typedef std::string subzone;
56 typedef std::set<const subzone *> zone;
57 typedef std::set<const zone*> zoneset;
61 mutable std::set<subzone> allsubzones;
62 mutable std::set<zone> allzones;
66 mutable bool is_adapted_;
69 std::vector<plevel_set> level_sets;
71 typedef std::shared_ptr<mesh> pmesh;
77 convex_info() : pmsh(0) {}
80 std::map<size_type, convex_info> cut_cv;
82 mutable dal::bit_vector crack_tip_convexes_;
87 plevel_set get_level_set(
size_type i)
const {
return level_sets[i]; }
90 {
return (cut_cv.find(i) != cut_cv.end()); }
92 if (is_convex_cut(i))
return *((cut_cv.find(i))->second.pmsh);
93 GMM_ASSERT1(
false,
"This element is not cut !");
96 const dal::bit_vector &crack_tip_convexes()
const;
104 + level_sets.size() *
sizeof(plevel_set);
105 for (std::map<size_type, convex_info>::const_iterator it=cut_cv.begin();
106 it != cut_cv.end(); ++it) {
107 res +=
sizeof(convex_info)
108 + it->second.pmsh->memsize()
109 + it->second.zones.size()
110 * (level_sets.size() +
sizeof(std::string *) +
sizeof(std::string));
116 if (std::find(level_sets.begin(), level_sets.end(), &ls)
117 == level_sets.end()) {
118 level_sets.push_back(&ls); touch();
123 std::vector<plevel_set>::iterator
124 it = std::find(level_sets.begin(), level_sets.end(), &ls);
125 if (it != level_sets.end()) {
126 level_sets.erase(it);
136 void merge_zoneset(zoneset &zones1,
const zoneset &zones2)
const;
137 void merge_zoneset(zoneset &zones1,
const std::string &subz)
const;
138 const std::string &primary_zone_of_convex(
size_type cv)
const 139 {
return *(zones_of_convexes[cv]); }
140 const zoneset &zoneset_of_convex(
size_type cv)
const {
141 std::map<size_type, convex_info>::const_iterator it = cut_cv.find(cv);
142 if (it != cut_cv.end())
return (*it).second.zones;
143 GMM_ASSERT1(
false,
"You cannot call this function for uncut convexes");
147 void find_level_set_potential_intersections
148 (std::vector<size_type> &icv, std::vector<dal::bit_vector> &ils);
150 void init_with_mesh(
mesh &me);
155 GMM_ASSERT1(linked_mesh_ == 0 && mls.linked_mesh_ == 0,
156 "Copy constructor is not allowed for mesh_level_set");
159 GMM_ASSERT1(linked_mesh_ == 0 && mls.linked_mesh_ == 0,
160 "Copy operator is not allowed for mesh_level_set");
166 void cut_element(
size_type cv,
const dal::bit_vector &primary,
167 const dal::bit_vector &secondary, scalar_type radius);
168 int is_not_crossed_by(
size_type c, plevel_set ls,
unsigned lsnum,
170 int sub_simplex_is_not_crossed_by(
size_type cv, plevel_set ls,
172 void find_zones_of_element(
size_type cv, std::string &prezone,
179 void find_crossing_level_set(
size_type cv,
180 dal::bit_vector &prim,
181 dal::bit_vector &sec, std::string &zone,
183 void run_delaunay(std::vector<base_node> &fixed_points,
184 gmm::dense_matrix<size_type> &simplexes,
185 std::vector<dal::bit_vector> &fixed_points_constraints);
187 void update_crack_tip_convexes();
190 void getfem_mesh_level_set_noisy(
void);
192 std::ostream &operator<<(std::ostream &os,
const mesh_level_set::zone &z);
193 std::ostream &operator<<(std::ostream &os,
const mesh_level_set::zoneset &zs);
structure used to hold a set of convexes and/or convex faces.
void add_level_set(level_set &ls)
add a new level set.
base class for static stored objects
Describe a mesh (collection of convexes (elements) and points).
void adapt(void)
do all the work (cut the convexes wrt the levelsets)
Integration methods (exact and approximated) on convexes.
size_t size_type
used as the common size type in the library
void global_cut_mesh(mesh &m) const
fill m with the (non-conformal) "cut" mesh.
Deal with interdependencies of objects.
GEneric Tool for Finite Element Methods.
size_type nb_level_sets(void) const
Get number of level-sets referenced in this object.
void update_from_context(void) const
this function has to be defined and should update the object when the context is modified.
Definition of the finite element methods.
mesh & linked_mesh(void) const
Gives a reference to the linked mesh of type mesh.
Keep informations about a mesh crossed by level-sets.