Skip to content
Snippets Groups Projects
Commit 0c62c4ce authored by Francois Henrotte's avatar Francois Henrotte
Browse files

additional parmeter PhysicalRegion

parent 703d17ad
Branches
Tags
No related merge requests found
...@@ -14,7 +14,8 @@ StringXNumber MathEvalOptions_Number[] = { ...@@ -14,7 +14,8 @@ StringXNumber MathEvalOptions_Number[] = {
{GMSH_FULLRC, "View", NULL, -1.}, {GMSH_FULLRC, "View", NULL, -1.},
{GMSH_FULLRC, "OtherTimeStep", NULL, -1.}, {GMSH_FULLRC, "OtherTimeStep", NULL, -1.},
{GMSH_FULLRC, "OtherView", NULL, -1.}, {GMSH_FULLRC, "OtherView", NULL, -1.},
{GMSH_FULLRC, "ForceInterpolation", NULL, 0.} {GMSH_FULLRC, "ForceInterpolation", NULL, 0.},
{GMSH_FULLRC, "PhysicalRegion", NULL, -1.}
}; };
StringXString MathEvalOptions_String[] = { StringXString MathEvalOptions_String[] = {
...@@ -62,6 +63,9 @@ std::string GMSH_MathEvalPlugin::getHelp() const ...@@ -62,6 +63,9 @@ std::string GMSH_MathEvalPlugin::getHelp() const
"If `TimeStep' < 0, the plugin extracts data from all " "If `TimeStep' < 0, the plugin extracts data from all "
"the time steps in the view.\n\n" "the time steps in the view.\n\n"
"If `View' < 0, the plugin is run on the current view.\n\n" "If `View' < 0, the plugin is run on the current view.\n\n"
"Plugin(MathEval) creates one new view."
"If `PhysicalRegion' < 0, the plugin is run"
"on all physical regions.\n\n"
"Plugin(MathEval) creates one new view."; "Plugin(MathEval) creates one new view.";
} }
...@@ -92,6 +96,7 @@ PView *GMSH_MathEvalPlugin::execute(PView *view) ...@@ -92,6 +96,7 @@ PView *GMSH_MathEvalPlugin::execute(PView *view)
int otherTimeStep = (int)MathEvalOptions_Number[2].def; int otherTimeStep = (int)MathEvalOptions_Number[2].def;
int iOtherView = (int)MathEvalOptions_Number[3].def; int iOtherView = (int)MathEvalOptions_Number[3].def;
int forceInterpolation = (int)MathEvalOptions_Number[4].def; int forceInterpolation = (int)MathEvalOptions_Number[4].def;
int region = (int)MathEvalOptions_Number[5].def;
std::vector<std::string> expr(9); std::vector<std::string> expr(9);
for(int i = 0; i < 9; i++) expr[i] = MathEvalOptions_String[i].def; for(int i = 0; i < 9; i++) expr[i] = MathEvalOptions_String[i].def;
...@@ -180,6 +185,7 @@ PView *GMSH_MathEvalPlugin::execute(PView *view) ...@@ -180,6 +185,7 @@ PView *GMSH_MathEvalPlugin::execute(PView *view)
int timeBeg = (timeStep < 0) ? firstNonEmptyStep : timeStep; int timeBeg = (timeStep < 0) ? firstNonEmptyStep : timeStep;
int timeEnd = (timeStep < 0) ? -timeStep : timeStep + 1; int timeEnd = (timeStep < 0) ? -timeStep : timeStep + 1;
for(int ent = 0; ent < data1->getNumEntities(timeBeg); ent++){ for(int ent = 0; ent < data1->getNumEntities(timeBeg); ent++){
if (region>0 && ent!=region) continue;
for(int ele = 0; ele < data1->getNumElements(timeBeg, ent); ele++){ for(int ele = 0; ele < data1->getNumElements(timeBeg, ent); ele++){
if(data1->skipElement(timeBeg, ent, ele)) continue; if(data1->skipElement(timeBeg, ent, ele)) continue;
int numNodes = data1->getNumNodes(timeBeg, ent, ele); int numNodes = data1->getNumNodes(timeBeg, ent, ele);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment