diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp index 55c356f17f578d17ec923bb0d25d83434412799b..aa03f766ea99c8c7f3cc909dfe725ba6c536440d 100644 --- a/Geo/GEdge.cpp +++ b/Geo/GEdge.cpp @@ -209,7 +209,7 @@ SVector3 GEdge::secondDer(double par) const SPoint2 GEdge::reparamOnFace(const GFace *face, double epar,int dir) const { - // reparmaterize the point onto the given face. + // reparametrize the point onto the given face. const GPoint p3 = point(epar); SPoint3 sp3(p3.x(), p3.y(), p3.z()); return face->parFromPoint(sp3); diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index fc8400c91ee46959532708463aa390409726c85b..f79b65b4683abbfd57b430ad20811c450b972fb6 100644 --- a/Geo/GFace.cpp +++ b/Geo/GFace.cpp @@ -129,6 +129,7 @@ void GFace::resetMeshAttributes() meshAttributes.recombineAngle = 45.; meshAttributes.Method = MESH_UNSTRUCTURED; meshAttributes.transfiniteArrangement = 0; + meshAttributes.typeOfMapping = 0; meshAttributes.transfiniteSmoothing = -1; meshAttributes.extrude = 0; } diff --git a/Geo/GFace.h b/Geo/GFace.h index 64a812b27968bd996eb2c3239ac95be69ad6ce99..8ca6d9ab2f36c13b1b561cc8bf76ff8b6cf908d0 100644 --- a/Geo/GFace.h +++ b/Geo/GFace.h @@ -247,9 +247,11 @@ class GFace : public GEntity char Method; // corners of the transfinite interpolation std::vector<GVertex*> corners; - // all diagonals of the triangulation are left (1), right (2) or - // alternated (3) + // all diagonals of the triangulation are left (-1), right (1) or + // alternated (0) int transfiniteArrangement; + // type of mapping is cad (0), harmonic (1) or conformal (-1) + int typeOfMapping; // do we smooth (transfinite) mesh? (<0 to use default smoothing) int transfiniteSmoothing; // the extrusion parameters (if any) diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index 203d8fca12d6d4fd5a365571f791cf9461a02015..272fecc0a45ff2bacf11df95c17a42de3df45279 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -533,7 +533,7 @@ bool GFaceCompound::parametrize() const if (checkAspectRatio() > AR_MAX){ printf("WARNING: geom aspect ratio too high \n"); - exit(1); + //exit(1); paramOK = false; } @@ -1333,7 +1333,6 @@ SPoint2 GFaceCompound::parFromPoint(const SPoint3 &p) const std::map<SPoint3,SPoint3>::const_iterator it = _coordPoints.find(p); SPoint3 sp = it->second; - printf("return u,v=%g %g \n", sp.x(), sp.y()); return SPoint2(sp.x(), sp.y()); diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index ac68c649aaf9a7153d8171e4b3db13beda6609b1..944db841d3c25fe6cf8a762805c783d931c227a6 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -603,7 +603,7 @@ Surface *Create_Surface(int Num, int Typ) pS->Method = MESH_UNSTRUCTURED; pS->Recombine = 0; pS->Recombine_Dir = -1; - pS->RecombineAngle = 45; + pS->TypeOfMapping = 0; pS->TransfiniteSmoothing = -1; pS->TrsfPoints = List_Create(4, 4, sizeof(Vertex *)); pS->Generatrices = NULL; diff --git a/Geo/Geo.h b/Geo/Geo.h index 0aa29f94ccc7362e12dd5d8e86d2868a66edf58c..5a74456d16d80b3c7cab5acccb7f3d8dea8aa59f 100644 --- a/Geo/Geo.h +++ b/Geo/Geo.h @@ -148,6 +148,7 @@ class Surface{ int Method; int Recombine; int Recombine_Dir; // -1 is left, +1 is right, 0 is alternated + int TypeOfMapping; // 0 is cad, +1 is harmonic, -1 is conformal double RecombineAngle; int TransfiniteSmoothing; List_T *Generatrices; diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index a88d38b14c75d9f056d8e0c51f03118bfec70605..7e76b1443588c370392990d4129565f1ee364f19 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -1485,7 +1485,7 @@ void partitionAndRemesh(GFaceCompound *gf) Msg::Info("*** Mesh of surface %d done by assembly remeshed faces", gf->tag()); Msg::Info("-----------------------------------------------------------"); - //gf->coherenceNormals(); + gf->coherenceNormals(); gf->meshStatistics.status = GFace::DONE; //CreateOutputFile("toto.msh", CTX::instance()->mesh.format); diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index 5b43385a48887523828b911ef42fd4201659ef00..8805123782cbec445de15ee11b85482ae99fa411 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -118,6 +118,7 @@ fullMatrix<double> ListOfListOfDouble2Matrix(List_T *list); %type <d> FExpr FExpr_Single %type <v> VExpr VExpr_Single CircleOptions TransfiniteType +%type <i> CompoundMap %type <i> NumericAffectation NumericIncrement PhysicalId %type <i> TransfiniteArrangement RecombineAngle %type <u> ColorExpr @@ -1452,7 +1453,7 @@ Shape : $$.Type = MSH_SURF_LOOP; $$.Num = num; } - | tCompound tSurface '(' FExpr ')' tAFFECT ListOfDouble tEND + | tCompound tSurface '(' FExpr ')' tAFFECT ListOfDouble CompoundMap tEND { int num = (int)$4; if(FindSurface(num)){ @@ -1460,8 +1461,10 @@ Shape : } else{ Surface *s = Create_Surface(num, MSH_SURF_COMPOUND); - for(int i = 0; i < List_Nbr($7); i++) + for(int i = 0; i < List_Nbr($7); i++){ s->compound.push_back((int)*(double*)List_Pointer($7, i)); + s->Parametrization = $8; + } Tree_Add(GModel::current()->getGEOInternals()->Surfaces, &s); } List_Delete($7); @@ -1469,7 +1472,7 @@ Shape : $$.Num = num; } | tCompound tSurface '(' FExpr ')' tAFFECT ListOfDouble tSTRING - '{' RecursiveListOfListOfDouble '}' tEND + '{' RecursiveListOfListOfDouble '}' CompoundMap tEND { int num = (int)$4; if(FindSurface(num)){ @@ -1485,8 +1488,10 @@ Shape : break; } List_T *l = *(List_T**)List_Pointer($10, i); - for (int j = 0; j < List_Nbr(l); j++) + for (int j = 0; j < List_Nbr(l); j++){ s->compoundBoundary[i].push_back((int)*(double*)List_Pointer(l, j)); + s->Parametrization = $12; + } } Tree_Add(GModel::current()->getGEOInternals()->Surfaces, &s); } @@ -2870,6 +2875,23 @@ ExtrudeParameter : // T R A N S F I N I T E , R E C O M B I N E & S M O O T H I N G +CompoundMap : + { + $$ = 1; // harmonic + } + | tSTRING + { + if(!strcmp($1, "Convex")) + $$ = 0; + else if(!strcmp($1, "Harmonic")) + $$ = 1; + else if(!strcmp($1, "Conformal")) + $$ = -1; + Free($1); + } +; + + TransfiniteType : { $$[0] = $$[1] = 1.; diff --git a/benchmarks/stl/PelvisHEMI.stl.gz b/benchmarks/stl/PelvisHEMI.stl.gz deleted file mode 100644 index de08c2458cd27450eb073d61459d624c2f4a39a1..0000000000000000000000000000000000000000 Binary files a/benchmarks/stl/PelvisHEMI.stl.gz and /dev/null differ diff --git a/benchmarks/stl/PelvisHEMI_CLASS_GEO.geo b/benchmarks/stl/PelvisHEMI_CLASS_GEO.geo deleted file mode 100644 index 3680f14d55d967901ad80f3dfb5f2f2c80e93845..0000000000000000000000000000000000000000 --- a/benchmarks/stl/PelvisHEMI_CLASS_GEO.geo +++ /dev/null @@ -1,22 +0,0 @@ -Mesh.CharacteristicLengthFactor=0.1; - -Merge "PelvisHEMI_CLASS.msh"; -CreateTopology; - -//on doit creer volume -Surface Loop(999)={2,3,4,5}; -Volume(1000)={999}; - -Compound Line(60)={6}; -Compound Line(70)={7}; -Compound Line(80)={8}; -Compound Line(90)={9}; - -Compound Surface(100)={2} Boundary {{}}; -Compound Surface(200)={3} Boundary {{}}; -Compound Surface(300)={4} Boundary {{}}; -Compound Surface(400)={5} Boundary {{}}; - -Compound Volume(5000)={1000}; - - diff --git a/benchmarks/stl/artery.geo b/benchmarks/stl/artery.geo new file mode 100644 index 0000000000000000000000000000000000000000..c011dbf955e3a937f06db8bbc4e6aadc421d91ca --- /dev/null +++ b/benchmarks/stl/artery.geo @@ -0,0 +1,10 @@ +Mesh.CharacteristicLengthFactor=0.1; +Mesh.Algorithm3D = 4; //Frontal (4) Delaunay(1) + +//merge the stl triangulation +Merge "artery.stl"; +CreateTopology; + +Compound Surface(100)={1}; + +Physical Surface(101)={100}; \ No newline at end of file diff --git a/benchmarks/stl/artery_GEO.geo b/benchmarks/stl/artery_GEO.geo deleted file mode 100644 index d1843ff642239abc1903a8904e73d83306f43b88..0000000000000000000000000000000000000000 --- a/benchmarks/stl/artery_GEO.geo +++ /dev/null @@ -1,26 +0,0 @@ -Mesh.CharacteristicLengthFactor=0.15; - -//merge the stl triangulation -Merge "artery.stl"; - -CreateTopology; - -Compound Line(10) = {1}; -Compound Line(20) = {2}; -Compound Line(30) = {3}; -Compound Surface(110)={1}; - -//Line Loop(11)={10}; -//Plane Surface(12)={10}; -//Line Loop(21)={20}; -//Plane Surface(22)={21}; -//Line Loop(31)={30}; -//Plane Surface(23)={3}; - -//Create a Volume defined by a surface loop -//Surface Loop(100)={1,10,20,30}; -//Volume(101)={100}; - -//REMESHING THE INITIAL TRIANGULATION in 2D then 3D - -//Compound Volume(111)={101}; \ No newline at end of file diff --git a/benchmarks/stl/pelvis.geo b/benchmarks/stl/pelvis.geo index 7c06bc19f05ac77454db4ca45c36739fb0f48b79..f128ad886467487cb4b81cc8fbb67ee4c6c069be 100644 --- a/benchmarks/stl/pelvis.geo +++ b/benchmarks/stl/pelvis.geo @@ -1,14 +1,15 @@ Mesh.CharacteristicLengthFactor=0.133; +Mesh.Algorithm3D = 4; //Frontal (4) Delaunay(1) Merge "pelvisSMOOTH.stl"; CreateTopology; -Compound Surface(200)={1}; +Compound Surface(200)={1} ; //Conformal; -Surface Loop(1000)={200}; -Volume(1001)={1000}; - -Physical Surface (100)={200}; +Surface Loop(300)={200}; +Volume(301)={300}; +Physical Surface (501)={200}; +Physical Volume(502)={301}; diff --git a/benchmarks/stl/pelvisPARTS.geo b/benchmarks/stl/pelvisPARTS.geo new file mode 100644 index 0000000000000000000000000000000000000000..1a876fdf9d0609726cd7215845643fef3282ed5b --- /dev/null +++ b/benchmarks/stl/pelvisPARTS.geo @@ -0,0 +1,20 @@ +Mesh.CharacteristicLengthFactor=0.1; + +Merge "pelvis_CLASS.msh"; +CreateTopology; + +Compound Line(60)={6}; +Compound Line(70)={7}; +Compound Line(80)={8}; +Compound Line(90)={9}; + +Compound Surface(100)={2}; // NoSplit; +Compound Surface(200)={3}; // NoSplit; +Compound Surface(300)={4}; // NoSplit; +Compound Surface(400)={5}; // NoSplit; + +Surface Loop(500)={100,200,300,400}; +Volume(501)={500}; + +Physical Surface(555)={100,200,300,400}; +Physical Volume(666)={501}; \ No newline at end of file diff --git a/benchmarks/stl/PelvisHEMI_CLASS.msh b/benchmarks/stl/pelvis_CLASS.msh similarity index 100% rename from benchmarks/stl/PelvisHEMI_CLASS.msh rename to benchmarks/stl/pelvis_CLASS.msh