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

*** empty log message ***

parent d40fa91f
No related branches found
No related tags found
No related merge requests found
...@@ -2,23 +2,24 @@ ...@@ -2,23 +2,24 @@
std::string GEntity::getInfoString() std::string GEntity::getInfoString()
{ {
char str[256]; char tmp[256];
sprintf(str, "%s %d", getTypeString().c_str(), tag()); sprintf(tmp, " %d", tag());
std::string out = getTypeString() + " " + tmp;
std::string info = getAdditionalInfoString(); std::string info = getAdditionalInfoString();
if(info.size()){ if(info.size())
strcat(str, " "); out += " " + info;
strcat(str, info.c_str());
}
if(physicals.size()){ if(physicals.size()){
char str2[256] = " ["; out += " [";
for(unsigned int i = 0; i < physicals.size(); i++){ for(unsigned int i = 0; i < physicals.size(); i++){
char str3[256]; if(i) out += " ";
sprintf(str3, "%d", physicals[i]); sprintf(tmp, "%d", physicals[i]);
if(i) strcat(str2, " "); out += tmp;
strcat(str2, str3);
} }
strcat(str2, "]"); out += "]";
strcat(str, str2);
} }
return std::string(str);
return out;
} }
...@@ -334,7 +334,8 @@ int GModel::readMSH(const std::string &name) ...@@ -334,7 +334,8 @@ int GModel::readMSH(const std::string &name)
v = new gmshVertex(this, it->first); v = new gmshVertex(this, it->first);
add(v); add(v);
} }
v->mesh_vertices.push_back(it->second[0]); for(unsigned int i = 0; i < it->second.size(); i++)
v->mesh_vertices.push_back(it->second[i]);
} }
} }
......
#include "GVertex.h" #include "GVertex.h"
#include <algorithm> #include <algorithm>
GVertex::~GVertex()
{
for(unsigned int i = 0; i < mesh_vertices.size(); i++)
delete mesh_vertices[i];
mesh_vertices.clear();
}
void GVertex::addEdge(GEdge *e) void GVertex::addEdge(GEdge *e)
{ {
l_edges.push_back(e); l_edges.push_back(e);
......
...@@ -12,14 +12,8 @@ class GVertex : public GEntity ...@@ -12,14 +12,8 @@ class GVertex : public GEntity
std::list<GEdge*> l_edges; std::list<GEdge*> l_edges;
public: public:
GVertex(GModel *m, int tag) : GEntity (m, tag) GVertex(GModel *m, int tag) : GEntity (m, tag) {}
{ virtual ~GVertex() ;
}
virtual ~GVertex()
{
if(mesh_vertices.size())
delete mesh_vertices[0];
}
virtual GPoint point() const = 0; virtual GPoint point() const = 0;
virtual double x() const = 0; virtual double x() const = 0;
virtual double y() const = 0; virtual double y() const = 0;
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
#include "GVertex.h" #include "GVertex.h"
class gmshVertex : public GVertex { class gmshVertex : public GVertex {
public: protected:
Vertex *v;
public:
gmshVertex(GModel *m, Vertex *_v) : GVertex(m, _v->Num), v(_v) gmshVertex(GModel *m, Vertex *_v) : GVertex(m, _v->Num), v(_v)
{ {
mesh_vertices.push_back(new MVertex(x(), y(), z(), this)); mesh_vertices.push_back(new MVertex(x(), y(), z(), this));
...@@ -40,8 +43,6 @@ public: ...@@ -40,8 +43,6 @@ public:
} }
void * getNativePtr() const {return v;} void * getNativePtr() const {return v;}
virtual double prescribedMeshSizeAtVertex() const {return v ? v->lc : 0.;} virtual double prescribedMeshSizeAtVertex() const {return v ? v->lc : 0.;}
protected:
Vertex *v;
}; };
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment