diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index a5f6f79abd4d4d2cc63bc357fcab5c19d77e10f7..6c61b08ba72076c7d9ab3cf24a43f765206c7a85 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -248,10 +248,12 @@ void GFaceCompound::partitionFaceCM() //the same normal orientation bool GFaceCompound::checkOrientation(int iter) const { - + //Only check orientation for stl files (1 patch) // if(_compound.size() > 1.0) return true; + //return true; + std::list<GFace*>::const_iterator it = _compound.begin(); double a_old = 0, a_new; bool oriented = true; @@ -262,12 +264,12 @@ bool GFaceCompound::checkOrientation(int iter) const SPoint3 v1 = coordinates[t->getVertex(0)]; SPoint3 v2 = coordinates[t->getVertex(1)]; SPoint3 v3 = coordinates[t->getVertex(2)]; - double p1[2] = {v1[0],v1[1]}; - double p2[2] = {v2[0],v2[1]}; - double p3[2] = {v3[0],v3[1]}; - a_new = robustPredicates::orient2d(p1, p2, p3); - if(count == 0) a_old=a_new; - if(a_new*a_old < 0.){ + double p0[2] = {v1[0],v1[1]}; + double p1[2] = {v2[0],v2[1]}; + double p2[2] = {v3[0],v3[1]}; + a_new = robustPredicates::orient2d(p0, p1, p2); + if(count == 0) a_old=a_new; + if(a_new*a_old < 0. && fabs(a_new) > 1.e10){ oriented = false; break; } @@ -294,6 +296,7 @@ bool GFaceCompound::checkOrientation(int iter) const bool GFaceCompound::checkCavity(std::vector<MElement*> &vTri) const { + bool badCavity = false; unsigned int nbV = vTri.size(); @@ -530,6 +533,7 @@ void GFaceCompound::computeALoop(std::set<GEdge*> &_unique, std::list<GEdge*> &l while(!_unique.empty()) { std::set<GEdge*>::iterator it = _unique.begin(); + //printf("for face %d bound edge =%d\n", tag(), (*it)->tag()); GVertex *vB = (*it)->getBeginVertex(); GVertex *vE = (*it)->getEndVertex(); _loop.push_back(*it); @@ -581,6 +585,7 @@ void GFaceCompound::computeALoop(std::set<GEdge*> &_unique, std::list<GEdge*> &l loop = _loop; _interior_loops.push_back(loop); + return; } @@ -1425,7 +1430,7 @@ bool GFaceCompound::checkAspectRatio() const int H = norm(SVector3(bboxH.max(), bboxH.min())); int D = norm(SVector3(bboxD.max(), bboxD.min())); nbSplit = std::max((int)floor(.25*H/D),2); - Msg::Warning("Partition geometry in N=%d parts", nbSplit); + Msg::Info("Partition geometry in N=%d parts", nbSplit); paramOK = false; } else { diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index 171b284cc060a9efa58d8f48b2607743c66d21f9..1357131d7d3208b3825b49cc0a98c593d518a62d 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -1344,12 +1344,14 @@ void partitionAndRemesh(GFaceCompound *gf) meshPartitionOptions options; options = CTX::instance()->partitionOptions; options.num_partitions = NF; - options.partitioner = 2; //METIS - options.algorithm = 1 ; + options.partitioner = 1;//1 CHACO //2 METIS + if ( options.partitioner == 1){ + options.global_method = 2;// 1 Multilevel-KL 2 Spectral + options.mesh_dims[0] = NF; + } std::list<GFace*> cFaces = gf->getCompounds(); PartitionMeshFace(cFaces, options); - //PartitionMesh(gf->model(), options); int numv = gf->model()->maxVertexNum() + 1; int nume = gf->model()->maxEdgeNum() + 1; @@ -1359,10 +1361,8 @@ void partitionAndRemesh(GFaceCompound *gf) gf->model()->createTopologyFromFaces(pFaces); - // if(nume > 1){ -// CreateOutputFile("toto.msh", CTX::instance()->mesh.format); -// Msg::Exit(1); -// } + //CreateOutputFile("toto.msh", CTX::instance()->mesh.format); + //Msg::Exit(1); //Remesh new faces (Compound Lines and Compound Surfaces) //----------------------------------------------------- @@ -1456,10 +1456,6 @@ void partitionAndRemesh(GFaceCompound *gf) Msg::Info("*** Mesh of surface %d done by assembly remeshed faces", gf->tag()); gf->meshStatistics.status = GFace::DONE; - // for(std::list<GFace*>::iterator it = cFaces.begin(); it != cFaces.end(); it++) - // tmp_model->remove(*it); - // delete tmp_model; - //CreateOutputFile("toto.msh", CTX::instance()->mesh.format); //Msg::Exit(1); diff --git a/Mesh/meshPartition.cpp b/Mesh/meshPartition.cpp index a3206acb1318a305e25b573347d190eb1f071c63..d751e32e11d89029be73ee69145ba19d23a08b8d 100644 --- a/Mesh/meshPartition.cpp +++ b/Mesh/meshPartition.cpp @@ -179,7 +179,7 @@ int PartitionGraph(Graph &graph, meshPartitionOptions &options) int ier = 0; switch(options.partitioner){ - case 1: // Chacho + case 1: // Chaco #ifdef HAVE_CHACO { Msg::Info("Launching Chaco graph partitioner"); @@ -191,6 +191,7 @@ int PartitionGraph(Graph &graph, meshPartitionOptions &options) } } // Ensure num_partitions reflects values used by Chaco + printf("global =%d archi=%d ndims_tot=%d mesh dim=%d\n", options.global_method, options.architecture, options.ndims_tot, options.mesh_dims[0]); switch(options.architecture) { case 0: options.num_partitions = 1 << options.ndims_tot; @@ -206,6 +207,7 @@ int PartitionGraph(Graph &graph, meshPartitionOptions &options) options.mesh_dims[0]*options.mesh_dims[1]*options.mesh_dims[2]; break; } + printf("partition in %d parts \n", options.num_partitions); try { const int iSec = 0; ier = interface