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

don't mesh GVertices in the constructor: this has nasty side effects when
loading geos+mesh+new post-processing datasets

-> Mesh0D in Generator

Please test: this change could have unexpected consequences... :-)
parent 3e79b658
No related branches found
No related tags found
No related merge requests found
...@@ -17,9 +17,6 @@ ACISVertex::ACISVertex(GModel *m, int num, VERTEX *v) ...@@ -17,9 +17,6 @@ ACISVertex::ACISVertex(GModel *m, int num, VERTEX *v)
_x = pos.coordinate(0); _x = pos.coordinate(0);
_y = pos.coordinate(1); _y = pos.coordinate(1);
_z = pos.coordinate(2); _z = pos.coordinate(2);
mesh_vertices.push_back(new MVertex(x(), y(), z(), this));
points.push_back(new MPoint(mesh_vertices.back()));
} }
void ACISVertex::setPosition(GPoint &p) void ACISVertex::setPosition(GPoint &p)
......
...@@ -474,8 +474,11 @@ SBoundingBox3d GModel::bounds() ...@@ -474,8 +474,11 @@ SBoundingBox3d GModel::bounds()
// using the mesh vertices for now; should use entities[i]->bounds() instead // using the mesh vertices for now; should use entities[i]->bounds() instead
SBoundingBox3d bb; SBoundingBox3d bb;
for(unsigned int i = 0; i < entities.size(); i++) for(unsigned int i = 0; i < entities.size(); i++)
for(unsigned int j = 0; j < entities[i]->mesh_vertices.size(); j++) if(entities[i]->dim() == 0)
bb += entities[i]->mesh_vertices[j]->point(); bb += static_cast<GVertex*>(entities[i])->xyz();
else
for(unsigned int j = 0; j < entities[i]->mesh_vertices.size(); j++)
bb += entities[i]->mesh_vertices[j]->point();
return bb; return bb;
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "GEntity.h" #include "GEntity.h"
#include "GPoint.h" #include "GPoint.h"
#include "SPoint2.h" #include "SPoint2.h"
#include "SPoint3.h"
#define MAX_LC 1.e22 #define MAX_LC 1.e22
...@@ -37,6 +38,7 @@ class GVertex : public GEntity ...@@ -37,6 +38,7 @@ class GVertex : public GEntity
virtual double x() const = 0; virtual double x() const = 0;
virtual double y() const = 0; virtual double y() const = 0;
virtual double z() const = 0; virtual double z() const = 0;
virtual SPoint3 xyz() const { return SPoint3(x(), y(), z()); }
virtual void setPosition(GPoint &p); virtual void setPosition(GPoint &p);
// add/delete an edge bounded by this vertex // add/delete an edge bounded by this vertex
......
...@@ -21,8 +21,6 @@ OCCVertex::OCCVertex(GModel *m, int num, TopoDS_Vertex _v) ...@@ -21,8 +21,6 @@ OCCVertex::OCCVertex(GModel *m, int num, TopoDS_Vertex _v)
_x = pnt.X(); _x = pnt.X();
_y = pnt.Y(); _y = pnt.Y();
_z = pnt.Z(); _z = pnt.Z();
mesh_vertices.push_back(new MVertex(x(), y(), z(), this));
points.push_back(new MPoint(mesh_vertices.back()));
} }
void OCCVertex::setPosition(GPoint &p) void OCCVertex::setPosition(GPoint &p)
......
...@@ -19,10 +19,7 @@ class fourierVertex : public GVertex { ...@@ -19,10 +19,7 @@ class fourierVertex : public GVertex {
protected: protected:
FM::TopoVertex *v; FM::TopoVertex *v;
public: public:
fourierVertex(GModel *m, int num, FM::TopoVertex* _v) : GVertex(m, num), v(_v) fourierVertex(GModel *m, int num, FM::TopoVertex* _v) : GVertex(m, num), v(_v){}
{
mesh_vertices.push_back(new MVertex(x(), y(), z(), this));
}
virtual ~fourierVertex() {} virtual ~fourierVertex() {}
virtual GPoint point() const { return GPoint(x(),y(),z()); } virtual GPoint point() const { return GPoint(x(),y(),z()); }
virtual double x() const { return v->GetX(); } virtual double x() const { return v->GetX(); }
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
gmshVertex::gmshVertex(GModel *m, Vertex *_v) gmshVertex::gmshVertex(GModel *m, Vertex *_v)
: GVertex(m, _v->Num, _v->lc), v(_v) : GVertex(m, _v->Num, _v->lc), v(_v)
{ {
mesh_vertices.push_back(new MVertex(x(), y(), z(), this));
points.push_back(new MPoint(mesh_vertices.back()));
} }
void gmshVertex::setPosition(GPoint &p) void gmshVertex::setPosition(GPoint &p)
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "Context.h" #include "Context.h"
#include "OS.h" #include "OS.h"
#include "GModel.h" #include "GModel.h"
#include "MPoint.h"
#include "MLine.h" #include "MLine.h"
#include "MTriangle.h" #include "MTriangle.h"
#include "MQuadrangle.h" #include "MQuadrangle.h"
...@@ -333,6 +334,17 @@ static bool CancelDelaunayHybrid(GModel *m) ...@@ -333,6 +334,17 @@ static bool CancelDelaunayHybrid(GModel *m)
return false; return false;
} }
static void Mesh0D(GModel *m)
{
for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it){
GVertex *gv = *it;
if(gv->mesh_vertices.empty())
gv->mesh_vertices.push_back(new MVertex(gv->x(), gv->y(), gv->z(), gv));
if(gv->points.empty())
gv->points.push_back(new MPoint(gv->mesh_vertices.back()));
}
}
static void Mesh1D(GModel *m) static void Mesh1D(GModel *m)
{ {
if(TooManyElements(m, 1)) return; if(TooManyElements(m, 1)) return;
...@@ -593,6 +605,7 @@ void GenerateMesh(GModel *m, int ask) ...@@ -593,6 +605,7 @@ void GenerateMesh(GModel *m, int ask)
if(ask == 1 || (ask > 1 && old < 1)) { if(ask == 1 || (ask > 1 && old < 1)) {
std::for_each(m->firstRegion(), m->lastRegion(), deMeshGRegion()); std::for_each(m->firstRegion(), m->lastRegion(), deMeshGRegion());
std::for_each(m->firstFace(), m->lastFace(), deMeshGFace()); std::for_each(m->firstFace(), m->lastFace(), deMeshGFace());
Mesh0D(m);
Mesh1D(m); Mesh1D(m);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment