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

try to use adaptive data if available

parent 08d2b8aa
No related branches found
No related tags found
No related merge requests found
...@@ -62,8 +62,8 @@ PView *GMSH_WarpPlugin::execute(PView *v) ...@@ -62,8 +62,8 @@ PView *GMSH_WarpPlugin::execute(PView *v)
PView *v2 = getView(otherView, v); PView *v2 = getView(otherView, v);
if(!v2) return v; if(!v2) return v;
PViewData *data1 = v1->getData(); PViewData *data1 = getPossiblyAdaptiveData(v1);
PViewData *data2 = v2->getData(); PViewData *data2 = getPossiblyAdaptiveData(v2);
// sanity checks // sanity checks
if(data1->getNumEntities() != data2->getNumEntities() || if(data1->getNumEntities() != data2->getNumEntities() ||
...@@ -75,7 +75,7 @@ PView *GMSH_WarpPlugin::execute(PView *v) ...@@ -75,7 +75,7 @@ PView *GMSH_WarpPlugin::execute(PView *v)
Msg::Error("Invalid TimeStep (%d) in View[%d]", TimeStep, v2->getIndex()); Msg::Error("Invalid TimeStep (%d) in View[%d]", TimeStep, v2->getIndex());
return v; return v;
} }
// create smooth normal field if we don't have an explicit warp field // create smooth normal field if we don't have an explicit warp field
smooth_normals *normals = 0; smooth_normals *normals = 0;
if(otherView < 0){ if(otherView < 0){
...@@ -106,7 +106,7 @@ PView *GMSH_WarpPlugin::execute(PView *v) ...@@ -106,7 +106,7 @@ PView *GMSH_WarpPlugin::execute(PView *v)
} }
} }
} }
// transform each "0" node: (x,y,z) += factor * mult * (valx, valy, valz) // transform each "0" node: (x,y,z) += factor * mult * (valx, valy, valz)
for(int step = 0; step < data1->getNumTimeSteps(); step++){ for(int step = 0; step < data1->getNumTimeSteps(); step++){
for(int ent = 0; ent < data1->getNumEntities(step); ent++){ for(int ent = 0; ent < data1->getNumEntities(step); ent++){
...@@ -143,7 +143,7 @@ PView *GMSH_WarpPlugin::execute(PView *v) ...@@ -143,7 +143,7 @@ PView *GMSH_WarpPlugin::execute(PView *v)
} }
} }
} }
if(normals) delete normals; if(normals) delete normals;
data1->finalize(); data1->finalize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment