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

new Min and Max functions on constants (at parse time)

parent 1628e574
No related branches found
No related tags found
No related merge requests found
Pipeline #5382 passed with warnings
3.3.1 (Work-in-progress): new Min and Max functions on constants (at parse
time).
3.3.0 (December 21, 2019): improved support for curved elements; added support
for auto-similar trees of edges (e.g. for sliding surfaces in 3D); update for
latest Gmsh version.
......
......
......@@ -314,7 +314,9 @@ MPI_Rank return tMPI_Rank;
MPI_SetCommSelf return tSetCommSelf;
MPI_SetCommWorld return tSetCommWorld;
MPI_Size return tMPI_Size;
Min return tMin;
Macro return tMacro;
Max return tMax;
MaxNumberOfDivisions return tMaxNumberOfDivisions;
MaxNumberOfPoints return tMaxNumberOfPoints;
MeshMovingBand2D return tMeshMovingBand2D;
......
......
This diff is collapsed.
This diff is collapsed.
......@@ -257,7 +257,7 @@ struct doubleXstring{
%token tCurrentDirectory tAbsolutePath tDirName tBaseFileName tCurrentFileName
%token tGETDP_MAJOR_VERSION tGETDP_MINOR_VERSION tGETDP_PATCH_VERSION
%token tExp tLog tLog10 tSqrt tSin tAsin tCos tAcos tTan
%token tExp tLog tLog10 tSqrt tSin tAsin tCos tAcos tTan tMin tMax
%token tAtan tAtan2 tSinh tCosh tTanh tAtanh tFabs tFloor tCeil tRound tSign
%token tFmod tModulo tHypot tRand
%token tSolidAngle tTrace tOrder tCrossProduct tDofValue tRational
......@@ -8842,6 +8842,16 @@ FloatParameterOption :
List_Delete($2);
}
| tMin FExpr
{
floatOptions["Min"].push_back($2);
}
| tMax FExpr
{
floatOptions["Max"].push_back($2);
}
| tSTRING
{
std::string key($1);
......@@ -9138,6 +9148,8 @@ NameForMathFunction :
| tModulo { $$ = (char*)"Modulo"; }
| tHypot { $$ = (char*)"Hypot"; }
| tRand { $$ = (char*)"Rand"; }
| tMin { $$ = (char*)"Min"; }
| tMax { $$ = (char*)"Max"; }
;
NameForFunction :
......@@ -9192,6 +9204,8 @@ FExpr :
| tModulo '[' FExpr ',' FExpr ']' { $$ = fmod($3,$5); }
| tHypot '[' FExpr ',' FExpr ']' { $$ = sqrt($3*$3+$5*$5); }
| tRand '[' FExpr ']' { $$ = $3 * (double)rand() / (double)RAND_MAX; }
| tMax '[' FExpr ',' FExpr ']' { $$ = std::max($3, $5); }
| tMin '[' FExpr ',' FExpr ']' { $$ = std::min($3, $5); }
| FExpr '?' FExpr tDOTS FExpr { $$ = $1? $3 : $5; }
......
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment