Skip to content
Snippets Groups Projects
Commit 6f93c4ac authored by Amaury Johnen's avatar Amaury Johnen
Browse files

avoid to create PView if there are no data

parent 50b49ffd
Branches
No related tags found
No related merge requests found
...@@ -4,23 +4,17 @@ ...@@ -4,23 +4,17 @@
// bugs and problems to the public mailing list <gmsh@geuz.org>. // bugs and problems to the public mailing list <gmsh@geuz.org>.
#include "AnalyseCurvedMesh.h" #include "AnalyseCurvedMesh.h"
#include "GModel.h"
#include "OS.h" #include "OS.h"
#include "Context.h" #include "Context.h"
#include <cmath>
#include <queue>
#include <sstream>
#include "GmshMessage.h"
#include "PView.h"
#if defined(HAVE_OPENGL) #if defined(HAVE_OPENGL)
#include "drawContext.h" #include "drawContext.h"
#endif #endif
#if defined(HAVE_FLTK) #include "PView.h"
#include "FlGui.h" #include "GModel.h"
#endif #include "MElement.h"
#include "bezierBasis.h"
#include "MetricBasis.h"
#include <sstream>
namespace { namespace {
...@@ -181,9 +175,11 @@ PView *GMSH_AnalyseCurvedMeshPlugin::execute(PView *v) ...@@ -181,9 +175,11 @@ PView *GMSH_AnalyseCurvedMeshPlugin::execute(PView *v)
dataPV[el->getNum()].push_back(_data[i].minJ()); dataPV[el->getNum()].push_back(_data[i].minJ());
} }
} }
std::stringstream name; if (dataPV.size()) {
name << "min J " << dim << "D"; std::stringstream name;
new PView(name.str().c_str(), "ElementData", _m, dataPV); name << "min J " << dim << "D";
new PView(name.str().c_str(), "ElementData", _m, dataPV);
}
} }
if (!_PViewR[dim-1] && _computeMetric) { if (!_PViewR[dim-1] && _computeMetric) {
_PViewR[dim-1] = true; _PViewR[dim-1] = true;
...@@ -193,9 +189,11 @@ PView *GMSH_AnalyseCurvedMeshPlugin::execute(PView *v) ...@@ -193,9 +189,11 @@ PView *GMSH_AnalyseCurvedMeshPlugin::execute(PView *v)
if (el->getDim() == dim) if (el->getDim() == dim)
dataPV[el->getNum()].push_back(_data[i].minR()); dataPV[el->getNum()].push_back(_data[i].minR());
} }
std::stringstream name; if (dataPV.size()) {
name << "min R " << dim << "D"; std::stringstream name;
new PView(name.str().c_str(), "ElementData", _m, dataPV); name << "min R " << dim << "D";
new PView(name.str().c_str(), "ElementData", _m, dataPV);
}
} }
} }
} }
......
...@@ -7,11 +7,8 @@ ...@@ -7,11 +7,8 @@
#define _ANALYSECURVEDMESH_H_ #define _ANALYSECURVEDMESH_H_
#include "Plugin.h" #include "Plugin.h"
#include "JacobianBasis.h"
#include "MetricBasis.h"
#include "MElement.h"
#include <vector> #include <vector>
class MElement;
extern "C" extern "C"
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment