Skip to content
Snippets Groups Projects
Commit 4359762c authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

add RefineMesh in parser

parent e3124b7b
Branches
Tags
No related merge requests found
...@@ -500,6 +500,16 @@ int GModel::mesh(int dimension) ...@@ -500,6 +500,16 @@ int GModel::mesh(int dimension)
#endif #endif
} }
int GModel::refineMesh(int linear)
{
#if defined(HAVE_MESH)
RefineMesh(this, linear);
return true;
#else
Msg::Error("Mesh module not compiled");
return false;
#endif
}
int GModel::setOrderN(int order, int linear, int incomplete) int GModel::setOrderN(int order, int linear, int incomplete)
{ {
......
...@@ -366,6 +366,9 @@ class GModel ...@@ -366,6 +366,9 @@ class GModel
// incomplete is 1 if incomplete basis are used // incomplete is 1 if incomplete basis are used
int setOrderN(int order, int linear, int incomplete); int setOrderN(int order, int linear, int incomplete);
// refine the mesh by splitting all elements
int refineMesh(int linear);
// create partition boundaries // create partition boundaries
void createPartitionBoundaries(int createGhostCells); void createPartitionBoundaries(int createGhostCells);
......
...@@ -184,6 +184,7 @@ Recombine return tRecombine; ...@@ -184,6 +184,7 @@ Recombine return tRecombine;
Rotate return tRotate; Rotate return tRotate;
Ruled return tRuled; Ruled return tRuled;
Rand return tRand; Rand return tRand;
RefineMesh return tRefineMesh;
Return return tReturn; Return return tReturn;
Smoother return tSmoother; Smoother return tSmoother;
......
This diff is collapsed.
...@@ -94,80 +94,81 @@ ...@@ -94,80 +94,81 @@
tLength = 311, tLength = 311,
tParametric = 312, tParametric = 312,
tElliptic = 313, tElliptic = 313,
tPlane = 314, tRefineMesh = 314,
tRuled = 315, tPlane = 315,
tTransfinite = 316, tRuled = 316,
tComplex = 317, tTransfinite = 317,
tPhysical = 318, tComplex = 318,
tCompound = 319, tPhysical = 319,
tPeriodic = 320, tCompound = 320,
tUsing = 321, tPeriodic = 321,
tPlugin = 322, tUsing = 322,
tDegenerated = 323, tPlugin = 323,
tRotate = 324, tDegenerated = 324,
tTranslate = 325, tRotate = 325,
tSymmetry = 326, tTranslate = 326,
tDilate = 327, tSymmetry = 327,
tExtrude = 328, tDilate = 328,
tLevelset = 329, tExtrude = 329,
tLoop = 330, tLevelset = 330,
tRecombine = 331, tLoop = 331,
tSmoother = 332, tRecombine = 332,
tSplit = 333, tSmoother = 333,
tDelete = 334, tSplit = 334,
tCoherence = 335, tDelete = 335,
tIntersect = 336, tCoherence = 336,
tLayers = 337, tIntersect = 337,
tHole = 338, tLayers = 338,
tAlias = 339, tHole = 339,
tAliasWithOptions = 340, tAlias = 340,
tText2D = 341, tAliasWithOptions = 341,
tText3D = 342, tText2D = 342,
tInterpolationScheme = 343, tText3D = 343,
tTime = 344, tInterpolationScheme = 344,
tCombine = 345, tTime = 345,
tBSpline = 346, tCombine = 346,
tBezier = 347, tBSpline = 347,
tNurbs = 348, tBezier = 348,
tNurbsOrder = 349, tNurbs = 349,
tNurbsKnots = 350, tNurbsOrder = 350,
tColor = 351, tNurbsKnots = 351,
tColorTable = 352, tColor = 352,
tFor = 353, tColorTable = 353,
tIn = 354, tFor = 354,
tEndFor = 355, tIn = 355,
tIf = 356, tEndFor = 356,
tEndIf = 357, tIf = 357,
tExit = 358, tEndIf = 358,
tField = 359, tExit = 359,
tReturn = 360, tField = 360,
tCall = 361, tReturn = 361,
tFunction = 362, tCall = 362,
tShow = 363, tFunction = 363,
tHide = 364, tShow = 364,
tGetValue = 365, tHide = 365,
tGetEnv = 366, tGetValue = 366,
tGetString = 367, tGetEnv = 367,
tGMSH_MAJOR_VERSION = 368, tGetString = 368,
tGMSH_MINOR_VERSION = 369, tGMSH_MAJOR_VERSION = 369,
tGMSH_PATCH_VERSION = 370, tGMSH_MINOR_VERSION = 370,
tHomRank = 371, tGMSH_PATCH_VERSION = 371,
tHomGen = 372, tHomRank = 372,
tHomCut = 373, tHomGen = 373,
tHomSeq = 374, tHomCut = 374,
tAFFECTDIVIDE = 375, tHomSeq = 375,
tAFFECTTIMES = 376, tAFFECTDIVIDE = 376,
tAFFECTMINUS = 377, tAFFECTTIMES = 377,
tAFFECTPLUS = 378, tAFFECTMINUS = 378,
tOR = 379, tAFFECTPLUS = 379,
tAND = 380, tOR = 380,
tNOTEQUAL = 381, tAND = 381,
tEQUAL = 382, tNOTEQUAL = 382,
tGREATEROREQUAL = 383, tEQUAL = 383,
tLESSOREQUAL = 384, tGREATEROREQUAL = 384,
UNARYPREC = 385, tLESSOREQUAL = 385,
tMINUSMINUS = 386, UNARYPREC = 386,
tPLUSPLUS = 387 tMINUSMINUS = 387,
tPLUSPLUS = 388
}; };
#endif #endif
...@@ -191,7 +192,7 @@ typedef union YYSTYPE ...@@ -191,7 +192,7 @@ typedef union YYSTYPE
/* Line 1685 of yacc.c */ /* Line 1685 of yacc.c */
#line 195 "Gmsh.tab.hpp" #line 196 "Gmsh.tab.hpp"
} YYSTYPE; } YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
......
...@@ -105,7 +105,7 @@ fullMatrix<double> ListOfListOfDouble2Matrix(List_T *list); ...@@ -105,7 +105,7 @@ fullMatrix<double> ListOfListOfDouble2Matrix(List_T *list);
%token tPrintf tSprintf tStrCat tStrPrefix tStrRelative %token tPrintf tSprintf tStrCat tStrPrefix tStrRelative
%token tBoundingBox tDraw tToday tSyncModel tCreateTopology tDistanceFunction %token tBoundingBox tDraw tToday tSyncModel tCreateTopology tDistanceFunction
%token tPoint tCircle tEllipse tLine tSphere tPolarSphere tSurface tSpline tVolume %token tPoint tCircle tEllipse tLine tSphere tPolarSphere tSurface tSpline tVolume
%token tCharacteristic tLength tParametric tElliptic %token tCharacteristic tLength tParametric tElliptic tRefineMesh
%token tPlane tRuled tTransfinite tComplex tPhysical tCompound tPeriodic %token tPlane tRuled tTransfinite tComplex tPhysical tCompound tPeriodic
%token tUsing tPlugin tDegenerated %token tUsing tPlugin tDegenerated
%token tRotate tTranslate tSymmetry tDilate tExtrude tLevelset %token tRotate tTranslate tSymmetry tDilate tExtrude tLevelset
...@@ -2413,7 +2413,11 @@ Command : ...@@ -2413,7 +2413,11 @@ Command :
{ {
GModel::current()->createTopologyFromMesh(); GModel::current()->createTopologyFromMesh();
} }
| tRefineMesh tEND
{
GModel::current()->importGEOInternals();
GModel::current()->refineMesh(CTX::instance()->mesh.secondOrderLinear);
}
; ;
// L O O P // L O O P
......
This diff is collapsed.
This diff is collapsed.
Mesh.Algorithm = 6; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg) Mesh.Algorithm = 6; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg)
Mesh.CharacteristicLengthMin=1.5; Mesh.CharacteristicLengthMin=1.5/2;
Mesh.CharacteristicLengthMax=2.5; Mesh.CharacteristicLengthMax=2.5/2;
Mesh.RemeshAlgorithm=1; Mesh.RemeshAlgorithm=1;
Mesh.RemeshParametrization=1;//(0) harmonic (1) conformal Mesh.RemeshParametrization=1;//(0) harmonic (1) conformal
// merge reclassified STL
Merge "mobilette-class.msh";
// oringinal STL is a bit coarse: refine it once!
RefineMesh;
//Merge "mobilette-class.msh"; // oringinal STL is a bit coarse
Merge "mobilette-class-fine.msh"; // this was produced by refining once
CreateTopology; CreateTopology;
ll[] = Line "*"; ll[] = Line "*";
...@@ -22,3 +25,5 @@ EndFor ...@@ -22,3 +25,5 @@ EndFor
Surface Loop(1) = {s : s + #ss[]-1}; Surface Loop(1) = {s : s + #ss[]-1};
Volume(1) = {1}; Volume(1) = {1};
//Physical Surface(1) = {s : s + #ss[]-1};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment