diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index af2342ce6c4b6c9d95eb0d2ee5865f223c4ec59f..71928b1dbf3769c571d64ffc66b567410c51d43f 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -2732,10 +2732,10 @@ void GModel::classifyFaces(std::set<GFace*> &_faces) #endif } -void GModel::createPartitionBoundaries(int createGhostCells) +void GModel::createPartitionBoundaries(int createGhostCells, int createAllDims) { #if (defined(HAVE_CHACO) || defined(HAVE_METIS)) && defined(HAVE_MESH) - CreatePartitionBoundaries(this, createGhostCells); + CreatePartitionBoundaries(this, createGhostCells, createAllDims); #endif } diff --git a/Geo/GModel.h b/Geo/GModel.h index 820a5b9e90c8c0318d0eb84c5a7f29744b6ac8c2..4ae2f0cb5871a459951170672c128938c96a5008 100644 --- a/Geo/GModel.h +++ b/Geo/GModel.h @@ -403,7 +403,7 @@ class GModel int refineMesh(int linear); // create partition boundaries - void createPartitionBoundaries(int createGhostCells); + void createPartitionBoundaries(int createGhostCells, int createAllDims = 0); // fill the vertex arrays, given the current option and data void fillVertexArrays(); diff --git a/Mesh/meshPartition.cpp b/Mesh/meshPartition.cpp index b25e30477ca9e18c935477602f2fd787aea0de1f..199468841cc1164be94047aa599c6f4dfb7d0270 100644 --- a/Mesh/meshPartition.cpp +++ b/Mesh/meshPartition.cpp @@ -1188,7 +1188,7 @@ static void addGhostCells(GEntity *ge, } } -int CreatePartitionBoundaries(GModel *model, bool createGhostCells) +int CreatePartitionBoundaries(GModel *model, bool createGhostCells, bool createAllDims) { unsigned numElem[5]; const int meshDim = model->getNumMeshElements(numElem); @@ -1225,14 +1225,14 @@ int CreatePartitionBoundaries(GModel *model, bool createGhostCells) // create partition edges if (meshDim > 1){ - if (meshDim == 2){ + if (meshDim == 2 || createAllDims){ for(GModel::fiter it = model->firstFace(); it != model->lastFace(); ++it){ fillit_(edgeToElement, (*it)->triangles.begin(), (*it)->triangles.end()); fillit_(edgeToElement, (*it)->quadrangles.begin(), (*it)->quadrangles.end()); fillit_(edgeToElement, (*it)->polygons.begin(), (*it)->polygons.end()); } } - else if (meshDim == 3){ + if (meshDim == 3){ for(GModel::riter it = model->firstRegion(); it != model->lastRegion(); ++it){ fillit_(edgeToElement, (*it)->tetrahedra.begin(), (*it)->tetrahedra.end()); fillit_(edgeToElement, (*it)->hexahedra.begin(), (*it)->hexahedra.end()); @@ -1258,14 +1258,14 @@ int CreatePartitionBoundaries(GModel *model, bool createGhostCells) // create partition vertices if (meshDim > 1){ - if (meshDim == 2){ + if (meshDim == 2 || createAllDims){ for(GModel::fiter it = model->firstFace(); it != model->lastFace(); ++it){ fillit_(vertexToElement, (*it)->triangles.begin(), (*it)->triangles.end()); fillit_(vertexToElement, (*it)->quadrangles.begin(), (*it)->quadrangles.end()); fillit_(vertexToElement, (*it)->polygons.begin(), (*it)->polygons.end()); } } - else if (meshDim == 3){ + if (meshDim == 3){ for(GModel::riter it = model->firstRegion(); it != model->lastRegion(); ++it){ fillit_(vertexToElement, (*it)->tetrahedra.begin(), (*it)->tetrahedra.end()); fillit_(vertexToElement, (*it)->hexahedra.begin(), (*it)->hexahedra.end()); @@ -1292,11 +1292,11 @@ int CreatePartitionBoundaries(GModel *model, bool createGhostCells) if(createGhostCells){ std::multimap<MElement*, short> &ghosts(model->getGhostCells()); ghosts.clear(); - if(meshDim == 2) + if(meshDim == 2 || createAllDims) for(std::set<partitionEdge*, Less_partitionEdge>::iterator it = pedges.begin(); it != pedges.end(); it++) addGhostCells(*it, vertexToElement, ghosts); - else if(meshDim == 3) + if(meshDim == 3) for(std::set<partitionFace*, Less_partitionFace>::iterator it = pfaces.begin(); it != pfaces.end(); it++) addGhostCells(*it, vertexToElement, ghosts); diff --git a/Mesh/meshPartition.h b/Mesh/meshPartition.h index 85ceb85d9d96b26ddc0f4ac6926f5f383f24bdc6..56954fa5f6edad3d0128e33c6f693f2538fb8c96 100644 --- a/Mesh/meshPartition.h +++ b/Mesh/meshPartition.h @@ -29,7 +29,7 @@ int RenumberMesh(GModel *const model, meshPartitionOptions &options); int PartitionMeshFace(std::list<GFace*> &cFaces, meshPartitionOptions &options); int PartitionMeshElements(std::vector<MElement*> &elements, meshPartitionOptions &options); -int CreatePartitionBoundaries(GModel *model, bool createGhostCells); +int CreatePartitionBoundaries(GModel *model, bool createGhostCells, bool createAllDims = false); void splitBoundaryEdges(GModel *model, std::set<partitionEdge*, Less_partitionEdge> &newEdges);