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