diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4b358d26cb2392fea4d4e6685adc90f6b34b3f0a..0e8f069825c9dbf320ceb1e53d30aad1a681ac43 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,6 @@ 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; Mesh.MinimumCirclePoints now behaves the same with all geometry kernels; fixed diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index ae55785bd7bd9245d10b5ed451ec156ca3265c2d..a531fa18006abd48ab9f153de1d7894c650adfb5 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -1061,7 +1061,7 @@ StringXNumber MeshOptions_Number[] = { "entity, 3: by partition)" }, { F|O, "CompoundClassify" , opt_mesh_compound_classify , 1. , "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)" }, { F|O, "CompoundCharacteristicLengthFactor" , opt_mesh_compound_lc_factor , 0.5 , "Mesh size factor applied to compound parts" }, diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp index 3e102edaea85d28498463ef696b957c98a61d0cc..9a2dc11a8beb533b2e39badc477d9df61bbb1af0 100644 --- a/Geo/GEdge.cpp +++ b/Geo/GEdge.cpp @@ -738,6 +738,7 @@ static void meshCompound(GEdge *ge) // no new mesh nodes are created here discreteEdge *de = new discreteEdge(ge->model(), ge->tag() + 100000); ge->model()->add(de); + std::vector<int> phys; for(std::size_t i = 0; i < ge->compound.size(); i++) { GEdge *c = (GEdge *)ge->compound[i]; // cannot use the same line elements, as they get deleted in createGeometry @@ -746,6 +747,8 @@ static void meshCompound(GEdge *ge) c->lines[j]->getVertex(1))); } c->compoundCurve = de; + phys.insert(phys.end(), c->physicals.begin(), c->physicals.end()); + c->physicals.clear(); } // create the geometry of the compound de->createGeometry(true); @@ -758,6 +761,7 @@ static void meshCompound(GEdge *ge) de->deleteVertexArrays(); // mesh the compound de->mesh(false); + de->physicals = phys; } #endif diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index 2f4622d920e245c66fb52b014caf8542c2a1e21f..cac83eb3d7f071d1f5e826e5bbe6240ea2de5d47 100644 --- a/Geo/GFace.cpp +++ b/Geo/GFace.cpp @@ -1486,6 +1486,7 @@ static void meshCompound(GFace *gf, bool verbose) std::set<GEdge*, GEntityPtrLessThan> bnd, emb1; std::set<GVertex*, GEntityPtrLessThan> emb0; + std::vector<int> phys; for(std::size_t i = 0; i < gf->compound.size(); i++) { GFace *c = (GFace *)gf->compound[i]; df->triangles.insert(df->triangles.end(), c->triangles.begin(), @@ -1515,6 +1516,10 @@ static void meshCompound(GFace *gf, bool verbose) c->mesh_vertices.clear(); } c->compoundSurface = df; + if(!magic) { + phys.insert(phys.end(), c->physicals.begin(), c->physicals.end()); + c->physicals.clear(); + } } std::set<GEdge*, GEntityPtrLessThan> bndc; @@ -1550,6 +1555,7 @@ static void meshCompound(GFace *gf, bool verbose) df->mesh(verbose); if(!magic){ + df->physicals = phys; return; }