Skip to content
Snippets Groups Projects
Commit 0d050636 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

move physical group definitions to new discrete entity created by compound...

move physical group definitions to new discrete entity created by compound meshing constraint, except for surfaces when we do the "magic" reclassification on the original surfaces
parent 84ff4dce
No related branches found
No related tags found
No related merge requests found
4.5.2 (Work-in-progress): periodic meshes now obey reorientation constraints; 4.5.2 (Work-in-progress): periodic meshes now obey reorientation constraints;
small bug fixes. physical group definitions now follow compound meshing constraints; small bug
fixes.
4.5.1 (December 28, 2019): new Min and Max commands in .geo files; 4.5.1 (December 28, 2019): new Min and Max commands in .geo files;
Mesh.MinimumCirclePoints now behaves the same with all geometry kernels; fixed Mesh.MinimumCirclePoints now behaves the same with all geometry kernels; fixed
......
...@@ -1061,7 +1061,7 @@ StringXNumber MeshOptions_Number[] = { ...@@ -1061,7 +1061,7 @@ StringXNumber MeshOptions_Number[] = {
"entity, 3: by partition)" }, "entity, 3: by partition)" },
{ F|O, "CompoundClassify" , opt_mesh_compound_classify , 1. , { F|O, "CompoundClassify" , opt_mesh_compound_classify , 1. ,
"How are surface mesh elements classified on compounds? (0: on the new discrete " "How are surface mesh elements classified on compounds? (0: on the new discrete "
"entity, 1: on the original geometrical entity - incompatible with e.g. high-order " "surface, 1: on the original geometrical surfaces - incompatible with e.g. high-order "
"meshing)" }, "meshing)" },
{ F|O, "CompoundCharacteristicLengthFactor" , opt_mesh_compound_lc_factor , 0.5 , { F|O, "CompoundCharacteristicLengthFactor" , opt_mesh_compound_lc_factor , 0.5 ,
"Mesh size factor applied to compound parts" }, "Mesh size factor applied to compound parts" },
......
...@@ -738,6 +738,7 @@ static void meshCompound(GEdge *ge) ...@@ -738,6 +738,7 @@ static void meshCompound(GEdge *ge)
// no new mesh nodes are created here // no new mesh nodes are created here
discreteEdge *de = new discreteEdge(ge->model(), ge->tag() + 100000); discreteEdge *de = new discreteEdge(ge->model(), ge->tag() + 100000);
ge->model()->add(de); ge->model()->add(de);
std::vector<int> phys;
for(std::size_t i = 0; i < ge->compound.size(); i++) { for(std::size_t i = 0; i < ge->compound.size(); i++) {
GEdge *c = (GEdge *)ge->compound[i]; GEdge *c = (GEdge *)ge->compound[i];
// cannot use the same line elements, as they get deleted in createGeometry // cannot use the same line elements, as they get deleted in createGeometry
...@@ -746,6 +747,8 @@ static void meshCompound(GEdge *ge) ...@@ -746,6 +747,8 @@ static void meshCompound(GEdge *ge)
c->lines[j]->getVertex(1))); c->lines[j]->getVertex(1)));
} }
c->compoundCurve = de; c->compoundCurve = de;
phys.insert(phys.end(), c->physicals.begin(), c->physicals.end());
c->physicals.clear();
} }
// create the geometry of the compound // create the geometry of the compound
de->createGeometry(true); de->createGeometry(true);
...@@ -758,6 +761,7 @@ static void meshCompound(GEdge *ge) ...@@ -758,6 +761,7 @@ static void meshCompound(GEdge *ge)
de->deleteVertexArrays(); de->deleteVertexArrays();
// mesh the compound // mesh the compound
de->mesh(false); de->mesh(false);
de->physicals = phys;
} }
#endif #endif
......
...@@ -1486,6 +1486,7 @@ static void meshCompound(GFace *gf, bool verbose) ...@@ -1486,6 +1486,7 @@ static void meshCompound(GFace *gf, bool verbose)
std::set<GEdge*, GEntityPtrLessThan> bnd, emb1; std::set<GEdge*, GEntityPtrLessThan> bnd, emb1;
std::set<GVertex*, GEntityPtrLessThan> emb0; std::set<GVertex*, GEntityPtrLessThan> emb0;
std::vector<int> phys;
for(std::size_t i = 0; i < gf->compound.size(); i++) { for(std::size_t i = 0; i < gf->compound.size(); i++) {
GFace *c = (GFace *)gf->compound[i]; GFace *c = (GFace *)gf->compound[i];
df->triangles.insert(df->triangles.end(), c->triangles.begin(), df->triangles.insert(df->triangles.end(), c->triangles.begin(),
...@@ -1515,6 +1516,10 @@ static void meshCompound(GFace *gf, bool verbose) ...@@ -1515,6 +1516,10 @@ static void meshCompound(GFace *gf, bool verbose)
c->mesh_vertices.clear(); c->mesh_vertices.clear();
} }
c->compoundSurface = df; c->compoundSurface = df;
if(!magic) {
phys.insert(phys.end(), c->physicals.begin(), c->physicals.end());
c->physicals.clear();
}
} }
std::set<GEdge*, GEntityPtrLessThan> bndc; std::set<GEdge*, GEntityPtrLessThan> bndc;
...@@ -1550,6 +1555,7 @@ static void meshCompound(GFace *gf, bool verbose) ...@@ -1550,6 +1555,7 @@ static void meshCompound(GFace *gf, bool verbose)
df->mesh(verbose); df->mesh(verbose);
if(!magic){ if(!magic){
df->physicals = phys;
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment