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

don't compute min/max if we don't have data

parent 8f230d42
Branches
Tags
No related merge requests found
...@@ -54,18 +54,22 @@ PView *GMSH_MinMaxPlugin::execute(PView * v) ...@@ -54,18 +54,22 @@ PView *GMSH_MinMaxPlugin::execute(PView * v)
dataMin->SP.push_back(x); dataMin->SP.push_back(y); dataMin->SP.push_back(z); dataMin->SP.push_back(x); dataMin->SP.push_back(y); dataMin->SP.push_back(z);
dataMax->SP.push_back(x); dataMax->SP.push_back(y); dataMax->SP.push_back(z); dataMax->SP.push_back(x); dataMax->SP.push_back(y); dataMax->SP.push_back(z);
for(int step = 0; step < data1->getNumTimeSteps(); step++){ for(int step = 0; step < data1->getNumTimeSteps(); step++){
dataMin->SP.push_back(data1->getMin(step)); if(data1->hasTimeStep(step)){
dataMax->SP.push_back(data1->getMax(step)); dataMin->SP.push_back(data1->getMin(step));
dataMax->SP.push_back(data1->getMax(step));
}
} }
dataMin->NbSP = 1; dataMin->NbSP = 1;
dataMax->NbSP = 1; dataMax->NbSP = 1;
vMin->getOptions()->intervalsType = PViewOptions::Numeric; vMin->getOptions()->intervalsType = PViewOptions::Numeric;
vMax->getOptions()->intervalsType = PViewOptions::Numeric; vMax->getOptions()->intervalsType = PViewOptions::Numeric;
for(int i = 0; i < data1->getNumTimeSteps(); i++){ for(int step = 0; step < data1->getNumTimeSteps(); step++){
double time = data1->getTime(i); if(data1->hasTimeStep(step)){
dataMin->Time.push_back(time); double time = data1->getTime(step);
dataMax->Time.push_back(time); dataMin->Time.push_back(time);
dataMax->Time.push_back(time);
}
} }
dataMin->setName(data1->getName() + "_Min"); dataMin->setName(data1->getName() + "_Min");
dataMin->setFileName(data1->getName() + "_Min.pos"); dataMin->setFileName(data1->getName() + "_Min.pos");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment