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

added parameter dimension

parent a83402a8
Branches
Tags
No related merge requests found
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
StringXNumber IntegrateOptions_Number[] = { StringXNumber IntegrateOptions_Number[] = {
{GMSH_FULLRC, "View", NULL, -1.}, {GMSH_FULLRC, "View", NULL, -1.},
{GMSH_FULLRC, "OverTime", NULL, -1.} {GMSH_FULLRC, "OverTime", NULL, -1.},
{GMSH_FULLRC, "Dimension", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -22,10 +23,12 @@ extern "C" ...@@ -22,10 +23,12 @@ extern "C"
std::string GMSH_IntegratePlugin::getHelp() const std::string GMSH_IntegratePlugin::getHelp() const
{ {
return "Plugin(Integrate) integrates scalar fields over " return "Plugin(Integrate) integrates a scalar field over "
"all the elements in the view `View', as well " "all the elements of the view `View' (if `Dimension' < 0), "
"as the circulation/flux of vector fields over " "or over all elements of the prescribed dimension "
"line/surface elements.\n\n" "(if `Dimension' > 0). If the field is a vector field,"
"the circulation/flux of the field over "
"line/surface elements is calculated.\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(Integrate) creates one new view." "Plugin(Integrate) creates one new view."
"If `OverTime' = 1 , the plugin integrates the scalar view " "If `OverTime' = 1 , the plugin integrates the scalar view "
...@@ -47,6 +50,7 @@ PView *GMSH_IntegratePlugin::execute(PView * v) ...@@ -47,6 +50,7 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
{ {
int iView = (int)IntegrateOptions_Number[0].def; int iView = (int)IntegrateOptions_Number[0].def;
int overTime = (int)IntegrateOptions_Number[1].def; int overTime = (int)IntegrateOptions_Number[1].def;
int dimension = (int)IntegrateOptions_Number[2].def;
PView *v1 = getView(iView, v); PView *v1 = getView(iView, v);
if(!v1) return v; if(!v1) return v;
...@@ -75,6 +79,7 @@ PView *GMSH_IntegratePlugin::execute(PView * v) ...@@ -75,6 +79,7 @@ PView *GMSH_IntegratePlugin::execute(PView * v)
bool flux = (numComp == 3 && (numEdges == 3 || numEdges == 4)); bool flux = (numComp == 3 && (numEdges == 3 || numEdges == 4));
int numNodes = data1->getNumNodes(step, ent, ele); int numNodes = data1->getNumNodes(step, ent, ele);
int dim = data1->getDimension(step, ent, ele); int dim = data1->getDimension(step, ent, ele);
if((dimension>0) && (dim!=dimension)) continue;
double x[8], y[8], z[8], val[8 * 3]; double x[8], y[8], z[8], val[8 * 3];
for(int nod = 0; nod < numNodes; nod++){ for(int nod = 0; nod < numNodes; nod++){
data1->getNode(step, ent, ele, nod, x[nod], y[nod], z[nod]); data1->getNode(step, ent, ele, nod, x[nod], y[nod], z[nod]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment