diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index efc593e79de991346b944eb0ed4f9545c11f3429..560a279f8e1b367864066efe1fa9b5aa1efd6e48 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -998,7 +998,7 @@ StringXNumber MeshOptions_Number[] = { { F|O, "RemeshAlgorithm" , opt_mesh_remesh_algo , 0 , "Remeshing algorithm (0=no split, 1=automatic, 2=automatic only with metis)" }, { F|O, "RemeshParametrization" , opt_mesh_remesh_param , 0 , - "Remeshing using discrete parametrization (0=harmonic_circle, 1=conformal, 2=rbf, 3=harmonic_plane, 4=convex_circle, 5=convex_plane, 6=harmonic square" }, + "Remeshing using discrete parametrization (0=harmonic_circle, 1=conformal_spectral, 2=rbf, 3=harmonic_plane, 4=convex_circle, 5=convex_plane, 6=harmonic square, 7=conformal_fe" }, { F|O, "RefineSteps" , opt_mesh_refine_steps , 10 , "Number of refinement steps in the MeshAdapt-based 2D algorithms" }, diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index bcfb588ca454041b5372cd02f9a40ab503421b20..1e2680c76f23f65925c9729b3938696ba4614698 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -922,22 +922,26 @@ bool GFaceCompound::parametrize() const } // Conformal map parametrization else if (_mapping == CONFORMAL){ - Msg::Info("Parametrizing surface %d with 'conformal map'", tag()); + fillNeumannBCS(); std::vector<MVertex *> vert; bool oriented, hasOverlap; - hasOverlap = parametrize_conformal_spectral(); - printStuff(55); + if (_type == SPECTRAL){ + Msg::Info("Parametrizing surface %d with 'spectral conformal map'", tag()); + hasOverlap = parametrize_conformal_spectral(); + } + else if (_type == FE){ + Msg::Info("Parametrizing surface %d with 'FE conformal map'", tag()); + parametrize_conformal(0, NULL, NULL); + } oriented = checkOrientation(0); - printStuff(66); if (!oriented) oriented = checkOrientation(0, true); - printStuff(77); - if ( !oriented || checkOverlap(vert) ){ + if (_type==SPECTRAL && (!oriented || checkOverlap(vert)) ){ Msg::Warning("!!! parametrization switched to 'FE conformal' map"); parametrize_conformal(0, NULL, NULL); - checkOrientation(0, true); + oriented = checkOrientation(0, true); } - if (!checkOrientation(0) || checkOverlap(vert)){ + if (!oriented || checkOverlap(vert)){ Msg::Warning("$$$ parametrization switched to 'harmonic' map"); parametrize(ITERU,HARMONIC); parametrize(ITERV,HARMONIC); @@ -1177,17 +1181,26 @@ GFaceCompound::GFaceCompound(GModel *m, int tag, std::list<GFace*> &compound, getBoundingEdges(); + _mapping = HARMONIC; _type = UNITCIRCLE; - if (toc == HARMONIC_CIRCLE) _mapping = HARMONIC; - else if(toc == CONFORMAL_SPECTRAL) _mapping = CONFORMAL; - else if(toc == RADIAL_BASIS) _mapping = RBF; + if(toc == RADIAL_BASIS) _mapping = RBF; else if (toc == HARMONIC_PLANE) _type = MEANPLANE; else if (toc == CONVEX_CIRCLE) _mapping = CONVEX; else if (toc == CONVEX_PLANE){ _mapping = CONVEX; _type = MEANPLANE; } + else if(toc == CONFORMAL_SPECTRAL) { + _mapping = CONFORMAL; + _type = SPECTRAL; + } + else if(toc == CONFORMAL_FE) { + _mapping = CONFORMAL; + _type = FE; + } + + nbSplit = 0; fillTris.clear(); @@ -1216,15 +1229,21 @@ GFaceCompound::GFaceCompound(GModel *m, int tag, std::list<GFace*> &compound, _mapping = HARMONIC; _type = UNITCIRCLE; - if (toc == HARMONIC_CIRCLE) _mapping = HARMONIC; - else if(toc == CONFORMAL_SPECTRAL) _mapping = CONFORMAL; - else if(toc == RADIAL_BASIS) _mapping = RBF; + if(toc == RADIAL_BASIS) _mapping = RBF; else if (toc == HARMONIC_PLANE) _type = MEANPLANE; else if (toc == CONVEX_CIRCLE) _mapping = CONVEX; else if (toc == CONVEX_PLANE){ _mapping = CONVEX; _type = MEANPLANE; } + if(toc == CONFORMAL_SPECTRAL) { + _mapping = CONFORMAL; + _type = SPECTRAL; + } + else if(toc == CONFORMAL_FE) { + _mapping = CONFORMAL; + _type = FE; + } else if(toc == HARMONIC_SQUARE && _U0.size() && _V0.size() && _U1.size() && _V1.size()) { _type = SQUARE; } @@ -1564,7 +1583,7 @@ bool GFaceCompound::parametrize_conformal_spectral() const // mettre max NC contraintes par bord int NB = _ordered.size(); - int NC = std::min(60,NB); + int NC = std::min(30,NB); int jump = (int) NB/NC; int nbLoop = (int) NB/jump ; for (int i = 0; i< nbLoop; i++){ diff --git a/Geo/GFaceCompound.h b/Geo/GFaceCompound.h index 748483399cd4c091b8dc5272d0cd72f53d29fff0..1a7444e635599d184ef3df3faca44d01bebd72a3 100644 --- a/Geo/GFaceCompound.h +++ b/Geo/GFaceCompound.h @@ -54,9 +54,9 @@ class GFaceCompound : public GFace { public: typedef enum {ITERU=0,ITERV=1,ITERD=2} iterationStep; typedef enum {HARMONIC_CIRCLE=0, CONFORMAL_SPECTRAL=1, RADIAL_BASIS=2, HARMONIC_PLANE=3, - CONVEX_CIRCLE=4,CONVEX_PLANE=5, HARMONIC_SQUARE=6} typeOfCompound; + CONVEX_CIRCLE=4,CONVEX_PLANE=5, HARMONIC_SQUARE=6, CONFORMAL_FE=7} typeOfCompound; typedef enum {HARMONIC=0,CONFORMAL=1, RBF=2, CONVEX=3} typeOfMapping; - typedef enum {UNITCIRCLE, MEANPLANE, SQUARE, ALREADYFIXED} typeOfIsomorphism; + typedef enum {UNITCIRCLE, MEANPLANE, SQUARE, ALREADYFIXED,SPECTRAL, FE} typeOfIsomorphism; void computeNormals(std::map<MVertex*, SVector3> &normals) const; protected: mutable std::set<MVertex *> ov; @@ -159,9 +159,9 @@ class GFaceCompound : public GFace { public: typedef enum {ITERU=0,ITERV=1,ITERD=2} iterationStep; typedef enum {HARMONIC_CIRCLE=0, CONFORMAL_SPECTRAL=1, RADIAL_BASIS=2, HARMONIC_PLANE=3, - CONVEX_CIRCLE=4,CONVEX_PLANE=5, HARMONIC_SQUARE=6} typeOfCompound; + CONVEX_CIRCLE=4,CONVEX_PLANE=5, HARMONIC_SQUARE=6, CONFORMAL_FE=7} typeOfCompound; typedef enum {HARMONIC=0,CONFORMAL=1, RBF=2, CONVEX=3} typeOfMapping; - typedef enum {UNITCIRCLE, MEANPLANE, SQUARE, ALREADYFIXED} typeOfIsomorphism; + typedef enum {UNITCIRCLE, MEANPLANE, SQUARE, ALREADYFIXED,SPECTRAL, FE} typeOfIsomorphism; GFaceCompound(GModel *m, int tag, std::list<GFace*> &compound, std::list<GEdge*> &U0, typeOfMapping typ = HARMONIC, int allowPartition=1, diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index 4c2c7ce926b4d06ac30e9f653de4558a7d372bf4..bd87dc2215800f91cbfa8f3ed1d81ce3b0378bc4 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -2081,6 +2081,7 @@ GFace* GModel::addCompoundFace(std::vector<GFace*> faces, int param, int typeS) if (param == 4) typ = GFaceCompound::CONVEX_CIRCLE; if (param == 5) typ = GFaceCompound::CONVEX_PLANE; if (param == 6) typ = GFaceCompound::HARMONIC_SQUARE; + if (param == 7) typ = GFaceCompound::CONFORMAL_FE; GFaceCompound *gfc = new GFaceCompound(this, num, comp, U0, typ, typeS); diff --git a/Geo/GModelIO_Geo.cpp b/Geo/GModelIO_Geo.cpp index b78cd64679b9ff41378d177c4f76a1144e94bccc..e4df0f022a4ea39091b94d6b4725e5acbb961b8c 100644 --- a/Geo/GModelIO_Geo.cpp +++ b/Geo/GModelIO_Geo.cpp @@ -199,6 +199,7 @@ int GModel::importGEOInternals() if (param == 4) typ = GFaceCompound::CONVEX_CIRCLE; if (param == 5) typ = GFaceCompound::CONVEX_PLANE; if (param == 6) typ = GFaceCompound::HARMONIC_SQUARE; + if (param == 7) typ = GFaceCompound::CONFORMAL_FE; int algo = CTX::instance()->mesh.remeshAlgo; f = new GFaceCompound(this, s->Num, comp, b[0], b[1], b[2], b[3], typ, algo);