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

*** empty log message ***

parent 1626d8bf
Branches
Tags
No related merge requests found
#ifndef _GMSH_DEFINES_H_ #ifndef _GMSH_DEFINES_H_
#define _GMSH_DEFINES_H_ #define _GMSH_DEFINES_H_
// IO file formats
#define FORMAT_MSH 1 #define FORMAT_MSH 1
#define FORMAT_UNV 2 #define FORMAT_UNV 2
#define FORMAT_GREF 3 #define FORMAT_GREF 3
...@@ -30,6 +32,23 @@ ...@@ -30,6 +32,23 @@
#define FORMAT_P3D 28 #define FORMAT_P3D 28
#define FORMAT_SVG 29 #define FORMAT_SVG 29
// Element types in .msh file format
#define LGN1 1
#define TRI1 2
#define QUA1 3
#define TET1 4
#define HEX1 5
#define PRI1 6
#define PYR1 7
#define LGN2 8
#define TRI2 9
#define QUA2 10
#define TET2 11
#define HEX2 12
#define PRI2 13
#define PYR2 14
#define PNT 15
#define CONV_VALUE 0.8 #define CONV_VALUE 0.8
#define VIS_GEOM (1<<0) #define VIS_GEOM (1<<0)
......
This diff is collapsed.
# $Id: Makefile,v 1.33 2006-07-25 12:08:23 remacle Exp $ # $Id: Makefile,v 1.34 2006-08-04 14:28:01 geuzaine Exp $
# #
# Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
# #
...@@ -55,9 +55,15 @@ depend: ...@@ -55,9 +55,15 @@ depend:
rm -f Makefile.new rm -f Makefile.new
# DO NOT DELETE THIS LINE # DO NOT DELETE THIS LINE
# 1 "/Users/geuzaine/.gmsh/DataStr//"
List.o: List.cpp Malloc.h List.h ../Common/Message.h SafeIO.h List.o: List.cpp Malloc.h List.h ../Common/Message.h SafeIO.h
# 1 "/Users/geuzaine/.gmsh/DataStr//"
Malloc.o: Malloc.cpp Malloc.h ../Common/Message.h Malloc.o: Malloc.cpp Malloc.h ../Common/Message.h
# 1 "/Users/geuzaine/.gmsh/DataStr//"
SafeIO.o: SafeIO.cpp SafeIO.h ../Common/Message.h SafeIO.o: SafeIO.cpp SafeIO.h ../Common/Message.h
# 1 "/Users/geuzaine/.gmsh/DataStr//"
Tree.o: Tree.cpp Malloc.h Tree.h avl.h ../Common/Message.h Tree.o: Tree.cpp Malloc.h Tree.h avl.h ../Common/Message.h
# 1 "/Users/geuzaine/.gmsh/DataStr//"
avl.o: avl.cpp avl.h Malloc.h avl.o: avl.cpp avl.h Malloc.h
# 1 "/Users/geuzaine/.gmsh/DataStr//"
Tools.o: Tools.cpp Tools.h List.h Tree.h avl.h Tools.o: Tools.cpp Tools.h List.h Tree.h avl.h
// $Id: Main.cpp,v 1.90 2006-07-12 07:24:13 geuzaine Exp $ // $Id: Main.cpp,v 1.91 2006-08-04 14:28:01 geuzaine Exp $
// //
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// //
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
#include "Geo.h" #include "Geo.h"
#include "CreateFile.h"
#include "Mesh.h" #include "Mesh.h"
#include "Draw.h" #include "Draw.h"
#include "Context.h" #include "Context.h"
...@@ -135,10 +136,10 @@ int main(int argc, char *argv[]) ...@@ -135,10 +136,10 @@ int main(int argc, char *argv[])
} }
if(CTX.batch > 0) { if(CTX.batch > 0) {
mai3d(CTX.batch); mai3d(CTX.batch);
Print_Mesh(CTX.output_filename, CTX.mesh.format); CreateOutputFile(CTX.output_filename, CTX.mesh.format);
} }
else else
Print_Geo(CTX.output_filename); CreateOutputFile(CTX.output_filename, FORMAT_GEO);
if(CTX.mesh.histogram) { if(CTX.mesh.histogram) {
Mesh_Quality(THEM); Mesh_Quality(THEM);
Print_Histogram(THEM->Histogram[0]); Print_Histogram(THEM->Histogram[0]);
......
This diff is collapsed.
...@@ -2,30 +2,38 @@ ...@@ -2,30 +2,38 @@
#include "GmshDefines.h" #include "GmshDefines.h"
#include <algorithm> #include <algorithm>
void GEdge::addFace ( GFace *e ) void GEdge::addFace(GFace *e)
{ {
l_faces.push_back (e); l_faces.push_back(e);
} }
void GEdge::delFace ( GFace *e ) void GEdge::delFace(GFace *e)
{ {
l_faces.erase(std::find(l_faces.begin(),l_faces.end(),e)); l_faces.erase(std::find(l_faces.begin(), l_faces.end(), e));
} }
GEdge::GEdge(GModel *model, GEdge::GEdge(GModel *model,
int tag, int tag,
GVertex *_v0, GVertex *_v0,
GVertex *_v1) GVertex *_v1)
: GEntity (model,tag),v0(_v0),v1(_v1) : GEntity(model, tag), v0(_v0), v1(_v1)
{ {
v0->addEdge (this); if(v0) v0->addEdge(this);
v1->addEdge (this); if(v1) v1->addEdge(this);
meshAttributes.Method = LIBRE; meshAttributes.Method = LIBRE;
} }
GEdge::~GEdge() GEdge::~GEdge()
{ {
v0->delEdge (this); if(v0) v0->delEdge(this);
v1->delEdge (this); if(v1) v1->delEdge(this);
for(unsigned int i = 0; i < mesh_vertices.size(); i++)
delete mesh_vertices[i];
mesh_vertices.clear();
for(unsigned int i = 0; i < lines.size(); i++)
delete lines[i];
lines.clear();
} }
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "SVector3.h" #include "SVector3.h"
#include "SPoint3.h" #include "SPoint3.h"
#include "SPoint2.h" #include "SPoint2.h"
#include "MElement.h"
// A model edge. // A model edge.
...@@ -53,6 +54,8 @@ class GEdge : public GEntity { ...@@ -53,6 +54,8 @@ class GEdge : public GEntity {
int typeTransfinite; int typeTransfinite;
} meshAttributes ; } meshAttributes ;
std::vector<MLine*> lines;
virtual int minimumMeshSegments () const {return 1;} virtual int minimumMeshSegments () const {return 1;}
virtual int minimumDrawSegments () const {return 1;} virtual int minimumDrawSegments () const {return 1;}
......
...@@ -15,7 +15,7 @@ class GVertex; ...@@ -15,7 +15,7 @@ class GVertex;
class GEdge; class GEdge;
class GFace; class GFace;
class GRegion; class GRegion;
//class MeshRep; class MRep;
// A geometric model entity. All enitites are owned by a GModel. // A geometric model entity. All enitites are owned by a GModel.
class GEntity { class GEntity {
...@@ -23,7 +23,7 @@ class GEntity { ...@@ -23,7 +23,7 @@ class GEntity {
private: private:
GModel *_model; GModel *_model;
int _tag; int _tag;
// DiscreteRep *mesh, *modelMesh; MRep *_geom, *_mesh;
public: public:
...@@ -89,12 +89,6 @@ class GEntity { ...@@ -89,12 +89,6 @@ class GEntity {
virtual ~GEntity() {}; virtual ~GEntity() {};
// Returns a renderable representation of the entity.
// virtual MeshRep * getGeometry();
// Returns a mesh of the entity
// virtual MeshRep * getMesh();
// Spatial dimension of the entity // Spatial dimension of the entity
virtual int dim() const = 0; virtual int dim() const = 0;
...@@ -149,11 +143,19 @@ class GEntity { ...@@ -149,11 +143,19 @@ class GEntity {
// The mesh vertices uniquely owned by the entity // The mesh vertices uniquely owned by the entity
std::vector<MVertex*> mesh_vertices; std::vector<MVertex*> mesh_vertices;
// The physical entitites (if any) that contain this entity
std::vector<int> physicals;
// The standard drawing attributes of the entity // The standard drawing attributes of the entity
struct { struct {
char Visible, Frozen; char Visible, Frozen;
} drawAttributes ; } drawAttributes ;
// Returns a renderable representation of the geometry
virtual MRep *geomRep(){ return _geom; }
// Returns a renderable representation of the mesh
virtual MRep *meshRep(){ return _mesh; }
}; };
// A minimal, non-abstract entity that can be used for sorting // A minimal, non-abstract entity that can be used for sorting
......
...@@ -5,27 +5,36 @@ GFace::~GFace () ...@@ -5,27 +5,36 @@ GFace::~GFace ()
{ {
std::list<GEdge*>::iterator it = l_edges.begin(); std::list<GEdge*>::iterator it = l_edges.begin();
while (it != l_edges.end()) while (it != l_edges.end()){
{ (*it)->delFace(this);
(*it)->delFace(this); ++it;
++it; }
}
} for(unsigned int i = 0; i < mesh_vertices.size(); i++)
delete mesh_vertices[i];
mesh_vertices.clear();
for(unsigned int i = 0; i < triangles.size(); i++)
delete triangles[i];
triangles.clear();
for(unsigned int i = 0; i < quadrangles.size(); i++)
delete quadrangles[i];
quadrangles.clear();
}
std::list<GVertex*> GFace::vertices() const std::list<GVertex*> GFace::vertices() const
{ {
std::list<GEdge*>::const_iterator it = l_edges.begin(); std::list<GEdge*>::const_iterator it = l_edges.begin();
std::list<GVertex*>ret; std::list<GVertex*>ret;
while (it != l_edges.end()) while (it != l_edges.end()){
{ GVertex *v1 = (*it)->getBeginVertex();
GVertex *v1 = (*it)->getBeginVertex (); GVertex *v2 = (*it)->getEndVertex();
GVertex *v2 = (*it)->getEndVertex (); if(std::find (ret.begin(),ret.end(),v1) == ret.end())
if (std::find (ret.begin(),ret.end(),v1) == ret.end()) ret.push_back(v1);
ret.push_back(v1); if(std::find (ret.begin(),ret.end(),v2) == ret.end())
if (std::find (ret.begin(),ret.end(),v2) == ret.end()) ret.push_back(v2);
ret.push_back(v2); ++it;
++it; }
}
return ret; return ret;
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "GPoint.h" #include "GPoint.h"
#include "GEntity.h" #include "GEntity.h"
//#include "GEdgeLoop.h" #include "MElement.h"
#include "SPoint2.h" #include "SPoint2.h"
#include "SVector3.h" #include "SVector3.h"
#include "Pair.h" #include "Pair.h"
...@@ -27,7 +27,7 @@ class GFace : public GEntity ...@@ -27,7 +27,7 @@ class GFace : public GEntity
GRegion *r1, *r2; GRegion *r1, *r2;
public: public:
GFace(GModel *model, int tag) : GEntity (model,tag),r1(0),r2(0){} GFace(GModel *model, int tag) : GEntity(model,tag), r1(0), r2(0) {}
virtual ~GFace(); virtual ~GFace();
void addRegion(GRegion *r){ r1?r2=r:r1=r; } void addRegion(GRegion *r){ r1?r2=r:r1=r; }
...@@ -74,7 +74,8 @@ class GFace : public GEntity ...@@ -74,7 +74,8 @@ class GFace : public GEntity
// to worry about that. // to worry about that.
virtual bool surfPeriodic(int dim) const = 0; virtual bool surfPeriodic(int dim) const = 0;
std::vector<MVertex*> triangles; std::vector<MTriangle*> triangles;
std::vector<MQuadrangle*> quadrangles;
mean_plane mp; mean_plane mp;
}; };
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <algorithm> #include <algorithm>
#include <set> #include <set>
#include <map>
#include "GVertex.h" #include "GVertex.h"
#include "GEdge.h" #include "GEdge.h"
#include "GFace.h" #include "GFace.h"
...@@ -55,6 +56,12 @@ public: ...@@ -55,6 +56,12 @@ public:
void remove(GEdge *e){edges.erase(std::find(firstEdge(),lastEdge(),e));} void remove(GEdge *e){edges.erase(std::find(firstEdge(),lastEdge(),e));}
void remove(GVertex *v){vertices.erase(std::find(firstVertex(),lastVertex(),v));} void remove(GVertex *v){vertices.erase(std::find(firstVertex(),lastVertex(),v));}
// IO routines
int readMSH(const std::string &name);
int writeMSH(const std::string &name, double version=1.0, bool saveAll=false,
double scalingFactor=1.0);
int writePOS(const std::string &name);
protected: protected:
std::string modelName; std::string modelName;
GModel(const std::string &name):modelName(name){} GModel(const std::string &name):modelName(name){}
......
#include <map>
#include <string>
#include "Message.h"
#include "GmshDefines.h"
#include "gmshRegion.h"
#include "gmshFace.h"
#include "gmshEdge.h"
#include "MElement.h"
static int getNumVerticesForElementType(int type)
{
switch (type) {
case PNT : return 1;
case LGN1: return 2;
case LGN2: return 2 + 1;
case TRI1: return 3;
case TRI2: return 3 + 3;
case QUA1: return 4;
case QUA2: return 4 + 4 + 1;
case TET1: return 4;
case TET2: return 4 + 6;
case HEX1: return 8;
case HEX2: return 8 + 12 + 6 + 1;
case PRI1: return 6;
case PRI2: return 6 + 9 + 3;
case PYR1: return 5;
case PYR2: return 5 + 8 + 1;
default: return 0;
}
}
template<class T>
static void associateEntityWithVertices(GEntity *ge, std::vector<T*> &elements)
{
for(unsigned int i = 0; i < elements.size(); i++)
for(int j = 0; j < elements[i]->getNumVertices(); j++)
elements[i]->getVertex(j)->setEntity(ge);
}
template<class T>
void copyElements(std::vector<T*> &dst, const std::vector<MElement*> &src)
{
dst.resize(src.size());
for(unsigned int i = 0; i < src.size(); i++) dst[i] = (T*)src[i];
}
static void storeElementsInEntities(GModel *m, int type,
std::map<int, std::vector<MElement*> > &map)
{
std::map<int, std::vector<MElement*> >::const_iterator it = map.begin();
std::map<int, std::vector<MElement*> >::const_iterator ite = map.end();
for(; it != ite; ++it){
switch(type){
case PNT:
{
GVertex *v = m->vertexByTag(it->first);
if(!v){
v = new gmshVertex(m, it->first);
m->add(v);
}
if(type == PNT) copyElements(v->mesh_vertices, it->second);
}
break;
case LGN1:
{
GEdge *e = m->edgeByTag(it->first);
if(!e){
e = new gmshEdge(m, it->first);
m->add(e);
}
if(type == LGN1) copyElements(e->lines, it->second);
}
break;
case TRI1: case QUA1:
{
GFace *f = m->faceByTag(it->first);
if(!f){
f = new gmshFace(m, it->first);
m->add(f);
}
if(type == TRI1) copyElements(f->triangles, it->second);
else if(type == QUA1) copyElements(f->quadrangles, it->second);
}
break;
case TET1: case HEX1: case PRI1: case PYR1:
{
GRegion *r = m->regionByTag(it->first);
if(!r){
r = new gmshRegion(m, it->first);
m->add(r);
}
if(type == TET1) copyElements(r->tetrahedra, it->second);
else if(type == HEX1) copyElements(r->hexahedra, it->second);
else if(type == PRI1) copyElements(r->prisms, it->second);
else if(type == PYR1) copyElements(r->pyramids, it->second);
}
break;
}
}
}
static void storePhysicalTagsInEntities(GModel *m, int dim,
std::map<int, std::map<int, std::string> > &map)
{
std::map<int, std::map<int, std::string> >::const_iterator it = map.begin();
std::map<int, std::map<int, std::string> >::const_iterator ite = map.end();
for(; it != ite; ++it){
GEntity *ge = 0;
switch(dim){
case 0: ge = m->vertexByTag(it->first); break;
case 1: ge = m->edgeByTag(it->first); break;
case 2: ge = m->faceByTag(it->first); break;
case 3: ge = m->regionByTag(it->first); break;
}
if(ge){
std::map<int, std::string>::const_iterator it2 = it->second.begin();
std::map<int, std::string>::const_iterator ite2 = it->second.end();
for(; it2 != ite2; ++it2)
ge->physicals.push_back(it2->first);
}
}
}
int GModel::readMSH(const std::string &name)
{
FILE *fp = fopen(name.c_str(), "r");
if(!fp){
Msg(GERROR, "Unable to open file '%s'", name.c_str());
return 0;
}
int elementTypes[7] = {LGN1, TRI1, QUA1, TET1, HEX1, PRI1, PYR1};
double version = 1.0;
char str[256];
std::map<int, MVertex*> vertices;
std::map<int, std::vector<MVertex*> > points;
std::map<int, std::vector<MElement*> > elements[7];
std::map<int, std::map<int, std::string> > physicals[4];
while(1) {
do {
if(!fgets(str, sizeof(str), fp) || feof(fp))
break;
} while(str[0] != '$');
if(feof(fp))
break;
if(!strncmp(&str[1], "MeshFormat", 10)) {
int format, size;
fscanf(fp, "%lf %d %d\n", &version, &format, &size);
}
else if(!strncmp(&str[1], "NO", 2) || !strncmp(&str[1], "Nodes", 5)) {
int numVertices;
fscanf(fp, "%d", &numVertices);
Msg(INFO, "%d vertices", numVertices);
int progress = (numVertices > 100000) ? numVertices / 50 : numVertices / 10;
for(int i = 0; i < numVertices; i++) {
int num;
double x, y, z;
fscanf(fp, "%d %lf %lf %lf", &num, &x, &y, &z);
if(vertices.count(num))
Msg(WARNING, "Skipping duplicate vertex %d", num);
else
vertices[num] = new MVertex(x, y, z);
if(progress && (i % progress == progress - 1))
Msg(PROGRESS, "Read %d vertices", i + 1);
}
Msg(PROGRESS, "");
}
else if(!strncmp(&str[1], "ELM", 3) || !strncmp(&str[1], "Elements", 8)) {
int numElements;
fscanf(fp, "%d", &numElements);
Msg(INFO, "%d elements", numElements);
int progress = (numElements > 100000) ? numElements / 50 : numElements / 10;
for(int i = 0; i < numElements; i++) {
int num, type, physical = 1, elementary = 1, partition = 1, numVertices;
if(version <= 1.0){
fscanf(fp, "%d %d %d %d %d", &num, &type, &physical, &elementary, &numVertices);
int check = getNumVerticesForElementType(type);
if(!check){
Msg(GERROR, "Unknown type for element %d", num);
continue;
}
if(numVertices != check){
Msg(GERROR, "Wrong number of vertices (%d) for element %d", numVertices, num);
continue;
}
}
else{
int numTags;
fscanf(fp, "%d %d %d", &num, &type, &numTags);
for(int j = 0; j < numTags; j++){
int tag;
fscanf(fp, "%d", &tag);
if(j == 0) physical = tag;
else if(j == 1) elementary = tag;
else if(j == 2) partition = tag;
// ignore any other tags for now
}
numVertices = getNumVerticesForElementType(type);
if(!numVertices){
Msg(GERROR, "Unknown type (%d) for element %d", type, num);
continue;
}
}
int n[30];
for(int j = 0; j < numVertices; j++) fscanf(fp, "%d", &n[j]);
int dim = 0;
switch (type) {
case PNT:
points[elementary].push_back(vertices[n[0]]);
dim = 0;
break;
case LGN1:
elements[0][elementary].push_back
(new MLine(vertices[n[0]], vertices[n[1]], num, partition));
dim = 1;
break;
case TRI1:
elements[1][elementary].push_back
(new MTriangle(vertices[n[0]], vertices[n[1]], vertices[n[2]],
num, partition));
dim = 2;
break;
case QUA1:
elements[2][elementary].push_back
(new MQuadrangle(vertices[n[0]], vertices[n[1]], vertices[n[2]],
vertices[n[3]], num, partition));
dim = 2;
break;
case TET1:
elements[3][elementary].push_back
(new MTetrahedron(vertices[n[0]], vertices[n[1]], vertices[n[2]],
vertices[n[3]], num, partition));
dim = 3;
break;
case HEX1:
elements[4][elementary].push_back
(new MHexahedron(vertices[n[0]], vertices[n[1]], vertices[n[2]],
vertices[n[3]], vertices[n[4]], vertices[n[5]],
vertices[n[6]], vertices[n[7]], num, partition));
dim = 3;
break;
case PRI1:
elements[5][elementary].push_back
(new MPrism(vertices[n[0]], vertices[n[1]], vertices[n[2]],
vertices[n[3]], vertices[n[4]], vertices[n[5]],
num, partition));
dim = 3;
break;
case PYR1:
elements[6][elementary].push_back
(new MPyramid(vertices[n[0]], vertices[n[1]], vertices[n[2]],
vertices[n[3]], vertices[n[4]], num, partition));
dim = 3;
break;
default:
Msg(GERROR, "Unknown type (%d) for element %d", type, num);
break;
}
if(!physicals[dim].count(elementary) || !physicals[dim][elementary].count(physical))
physicals[dim][elementary][physical] = "unnamed";
if(progress && (i % progress == progress - 1))
Msg(PROGRESS, "Read %d elements", i + 1);
}
Msg(PROGRESS, "");
}
do {
if(!fgets(str, sizeof(str), fp) || feof(fp))
Msg(GERROR, "Prematured end of mesh file");
} while(str[0] != '$');
}
// store the elements in their associated elementary entity. If the
// entity does not exist, create a new one.
for(int i = 0; i < 7; i++)
storeElementsInEntities(this, elementTypes[i], elements[i]);
// loop on regions, then on faces, edges and vertices and store the
// entity pointer in the the elements' vertices (this way we
// associate the entity of lowest geometrical degree with each
// vertex)
for(riter it = firstRegion(); it != lastRegion(); ++it){
associateEntityWithVertices(*it, (*it)->tetrahedra);
associateEntityWithVertices(*it, (*it)->hexahedra);
associateEntityWithVertices(*it, (*it)->prisms);
associateEntityWithVertices(*it, (*it)->pyramids);
}
for(fiter it = firstFace(); it != lastFace(); ++it){
associateEntityWithVertices(*it, (*it)->triangles);
associateEntityWithVertices(*it, (*it)->quadrangles);
}
for(eiter it = firstEdge(); it != lastEdge(); ++it){
associateEntityWithVertices(*it, (*it)->lines);
}
for(viter it = firstVertex(); it != lastVertex(); ++it){
//FIXME: TODO
}
// store the vertices in their associated geometrical entity
std::map<int, MVertex*>::const_iterator it = vertices.begin();
std::map<int, MVertex*>::const_iterator ite = vertices.end();
for(; it != ite; ++it){
MVertex *v = it->second;
GEntity *ge = v->onWhat();
if(ge)
ge->mesh_vertices.push_back(v);
else
delete v; // delete unused vertex
}
// store the physical tags
for(int i = 0; i < 4; i++)
storePhysicalTagsInEntities(this, i, physicals[i]);
fclose(fp);
return 1;
}
static void numVerticesAndElementsInModel(GModel *m, bool saveAll,
int &numVertices, int &numElements)
{
// get the number of vertices and elements in the msh file and
// renumber the nodes in a continuous sequence
numVertices = numElements = 0;
for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it){
int n = (*it)->mesh_vertices.size();
numElements += (saveAll ? 1 : (*it)->physicals.size()) * n;
for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++)
(*it)->mesh_vertices[i]->setNum(++numVertices);
}
for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it){
int n = (*it)->lines.size();
numElements += (saveAll ? 1 : (*it)->physicals.size()) * n;
for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++)
(*it)->mesh_vertices[i]->setNum(++numVertices);
}
for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it){
int n = (*it)->triangles.size() + (*it)->quadrangles.size();
numElements += (saveAll ? 1 : (*it)->physicals.size()) * n;
for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++)
(*it)->mesh_vertices[i]->setNum(++numVertices);
}
for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it){
int n = (*it)->tetrahedra.size() + (*it)->hexahedra.size() +
(*it)->prisms.size() + (*it)->pyramids.size();
numElements += (saveAll ? 1 : (*it)->physicals.size()) * n;
for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++)
(*it)->mesh_vertices[i]->setNum(++numVertices);
}
}
template<class T>
static void writeElementsMSH(FILE *fp, const std::vector<T*> &ele, int saveAll,
double version, int &num, int elementary,
std::vector<int> &physicals)
{
for(unsigned int i = 0; i < ele.size(); i++)
if(saveAll)
ele[i]->writeMSH(fp, version, ++num, elementary, elementary);
else
for(unsigned int j = 0; j < physicals.size(); j++)
ele[i]->writeMSH(fp, version, ++num, elementary, physicals[j]);
}
int GModel::writeMSH(const std::string &name, double version, bool saveAll,
double scalingFactor)
{
FILE *fp = fopen(name.c_str(), "w");
if(!fp){
Msg(GERROR, "Unable to open file '%s'", name.c_str());
return 0;
}
if(version > 2.0){
fprintf(fp, "$MeshFormat\n");
fprintf(fp, "%g %d %d\n", version, 0, (int)sizeof(double));
fprintf(fp, "$EndMeshFormat\n");
fprintf(fp, "$Nodes\n");
}
else
fprintf(fp, "$NOD\n");
int numVertices, numElements;
numVerticesAndElementsInModel(this, saveAll, numVertices, numElements);
fprintf(fp, "%d\n", numVertices);
for(viter it = firstVertex(); it != lastVertex(); ++it)
for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++)
(*it)->mesh_vertices[i]->writeMSH(fp, scalingFactor);
for(eiter it = firstEdge(); it != lastEdge(); ++it)
for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++)
(*it)->mesh_vertices[i]->writeMSH(fp, scalingFactor);
for(fiter it = firstFace(); it != lastFace(); ++it)
for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++)
(*it)->mesh_vertices[i]->writeMSH(fp, scalingFactor);
for(riter it = firstRegion(); it != lastRegion(); ++it)
for(unsigned int i = 0; i < (*it)->mesh_vertices.size(); i++)
(*it)->mesh_vertices[i]->writeMSH(fp, scalingFactor);
if(version > 2.0){
fprintf(fp, "$EndNodes\n");
fprintf(fp, "$Elements\n");
}
else{
fprintf(fp, "$ENDNOD\n");
fprintf(fp, "$ELM\n");
}
fprintf(fp, "%d\n", numElements);
int num = 0;
for(viter it = firstVertex(); it != lastVertex(); ++it){
writeElementsMSH(fp, (*it)->mesh_vertices, saveAll, version, num,
(*it)->tag(), (*it)->physicals);
}
for(eiter it = firstEdge(); it != lastEdge(); ++it){
writeElementsMSH(fp, (*it)->lines, saveAll, version, num,
(*it)->tag(), (*it)->physicals);
}
for(fiter it = firstFace(); it != lastFace(); ++it){
writeElementsMSH(fp, (*it)->triangles, saveAll, version, num,
(*it)->tag(), (*it)->physicals);
writeElementsMSH(fp, (*it)->quadrangles, saveAll, version, num,
(*it)->tag(), (*it)->physicals);
}
for(riter it = firstRegion(); it != lastRegion(); ++it){
writeElementsMSH(fp, (*it)->tetrahedra, saveAll, version, num,
(*it)->tag(), (*it)->physicals);
writeElementsMSH(fp, (*it)->hexahedra, saveAll, version, num,
(*it)->tag(), (*it)->physicals);
writeElementsMSH(fp, (*it)->prisms, saveAll, version, num,
(*it)->tag(), (*it)->physicals);
writeElementsMSH(fp, (*it)->pyramids, saveAll, version, num,
(*it)->tag(), (*it)->physicals);
}
if(version > 2.0){
fprintf(fp, "$EndElements\n");
}
else{
fprintf(fp, "$ENDELM\n");
}
return 1;
}
int GModel::writePOS(const std::string &name)
{
FILE *fp = fopen(name.c_str(), "w");
if(!fp){
Msg(GERROR, "Unable to open file '%s'", name.c_str());
return 0;
}
if(numRegion()){
fprintf(fp, "View \"Volumes\" {\n");
fprintf(fp, "T2(1.e5,30,%d){\"Elementary Entity\", \"Element Number\", "
"\"Gamma\", \"Eta\", \"Rho\"};\n", (1<<16)|(4<<8));
for(riter it = firstRegion(); it != lastRegion(); ++it) {
for(unsigned int i = 0; i < (*it)->tetrahedra.size(); i++)
(*it)->tetrahedra[i]->writePOS(fp);
for(unsigned int i = 0; i < (*it)->hexahedra.size(); i++)
(*it)->hexahedra[i]->writePOS(fp);
for(unsigned int i = 0; i < (*it)->prisms.size(); i++)
(*it)->prisms[i]->writePOS(fp);
for(unsigned int i = 0; i < (*it)->pyramids.size(); i++)
(*it)->pyramids[i]->writePOS(fp);
}
fprintf(fp, "};\n");
}
if(numFace()){
fprintf(fp, "View \"Surfaces\" {\n");
fprintf(fp, "T2(1.e5,30,%d){\"Elementary Entity\", \"Element Number\", "
"\"Gamma\", \"Eta\", \"Rho\"};\n", (1<<16)|(4<<8));
for(fiter it = firstFace(); it != lastFace(); ++it) {
for(unsigned int i = 0; i < (*it)->triangles.size(); i++)
(*it)->triangles[i]->writePOS(fp);
for(unsigned int i = 0; i < (*it)->quadrangles.size(); i++)
(*it)->quadrangles[i]->writePOS(fp);
}
fprintf(fp, "};\n");
}
if(numEdge()){
fprintf(fp, "View \"Lines\" {\n");
fprintf(fp, "T2(1.e5,30,%d){\"Elementary Entity\", \"Element Number\", "
"\"Gamma\", \"Eta\", \"Rho\"};\n", (1<<16)|(4<<8));
for(eiter it = firstEdge(); it != lastEdge(); ++it) {
for(unsigned int i = 0; i < (*it)->lines.size(); i++)
(*it)->lines[i]->writePOS(fp);
}
fprintf(fp, "};\n");
}
fclose(fp);
return 1;
}
...@@ -5,9 +5,28 @@ GRegion::~GRegion () ...@@ -5,9 +5,28 @@ GRegion::~GRegion ()
{ {
std::list<GFace*>::iterator it = l_faces.begin(); std::list<GFace*>::iterator it = l_faces.begin();
while (it != l_faces.end()) while(it != l_faces.end()){
{ (*it)->delRegion(this);
(*it)->delRegion(this); ++it;
++it; }
}
for(unsigned int i = 0; i < mesh_vertices.size(); i++)
delete mesh_vertices[i];
mesh_vertices.clear();
for(unsigned int i = 0; i < tetrahedra.size(); i++)
delete tetrahedra[i];
tetrahedra.clear();
for(unsigned int i = 0; i < hexahedra.size(); i++)
delete hexahedra[i];
hexahedra.clear();
for(unsigned int i = 0; i < prisms.size(); i++)
delete prisms[i];
prisms.clear();
for(unsigned int i = 0; i < pyramids.size(); i++)
delete pyramids[i];
pyramids.clear();
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define _GREGION_H_ #define _GREGION_H_
#include "GEntity.h" #include "GEntity.h"
#include "MElement.h"
// A model region. // A model region.
class GRegion : public GEntity { class GRegion : public GEntity {
...@@ -9,10 +10,14 @@ class GRegion : public GEntity { ...@@ -9,10 +10,14 @@ class GRegion : public GEntity {
std::list<GFace *> l_faces; std::list<GFace *> l_faces;
std::list<int> l_dirs; std::list<int> l_dirs;
public: public:
GRegion(GModel *model, int tag) : GEntity (model,tag) {} GRegion(GModel *model, int tag) : GEntity (model, tag) {}
virtual ~GRegion(); virtual ~GRegion();
virtual int dim() const {return 3;} virtual int dim() const {return 3;}
virtual GeomType geomType() const {return Volume;} virtual GeomType geomType() const {return Volume;}
std::vector<MTetrahedron*> tetrahedra;
std::vector<MHexahedron*> hexahedra;
std::vector<MPrism*> prisms;
std::vector<MPyramid*> pyramids;
}; };
#endif #endif
...@@ -10,13 +10,13 @@ class GVertex : public GEntity ...@@ -10,13 +10,13 @@ class GVertex : public GEntity
{ {
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()) if(mesh_vertices.size())
delete mesh_vertices[0]; 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;
......
#include <math.h>
#include "MElement.h"
#include "GEntity.h"
int MElement::_globalNum = 0;
static double dist(MVertex *v1, MVertex *v2)
{
double dx = v1->x() - v2->x();
double dy = v1->y() - v2->y();
double dz = v1->z() - v2->z();
return sqrt(dx * dx + dy * dy + dz * dz);
}
double MElement::minEdge()
{
double m = 1.e25;
MVertex *v[2];
for(int i = 0; i < getNumEdges(); i++){
getEdge(i, v);
m = std::min(m, dist(v[0], v[1]));
}
return m;
}
double MElement::maxEdge()
{
double m = 0.;
MVertex *v[2];
for(int i = 0; i < getNumEdges(); i++){
getEdge(i, v);
m = std::max(m, dist(v[0], v[1]));
}
return m;
}
double MElement::rhoShapeMeasure()
{
double min = minEdge();
double max = maxEdge();
if(max)
return min / max;
else
return 0.;
}
void MElement::cog(double &x, double &y, double &z)
{
x = y = z = 0.;
int n = getNumVertices();
for(int i = 0; i < n; i++) {
MVertex *v = getVertex(i);
x += v->x();
y += v->y();
z += v->z();
}
x /= (double)n;
y /= (double)n;
z /= (double)n;
}
void MElement::writeMSH(FILE *fp, double version, int num, int elementary,
int physical)
{
int n = getNumVertices();
fprintf(fp, "%d %d", num ? num : _num, getTypeForMSH());
if(version < 2.0)
fprintf(fp, " %d %d %d", physical, elementary, n);
else
fprintf(fp, " 3 %d %d %d", physical, elementary, _partition);
for(int i = 0; i < n; i++){
fprintf(fp, " %d", getVertex(i)->getNum());
}
fprintf(fp, " \n");
}
void MElement::writePOS(FILE *fp)
{
int n = getNumVertices();
double gamma = gammaShapeMeasure();
double eta = etaShapeMeasure();
double rho = rhoShapeMeasure();
fprintf(fp, "%s(", getStringForPOS());
for(int i = 0; i < n; i++){
if(i) fprintf(fp, ",");
fprintf(fp, "%g,%g,%g", getVertex(i)->x(), getVertex(i)->y(), getVertex(i)->z());
}
fprintf(fp, "){");
for(int i = 0; i < n; i++)
fprintf(fp, "%d,", getVertex(i)->onWhat()->tag());
for(int i = 0; i < n; i++)
fprintf(fp, "%d,", getNum());
for(int i = 0; i < n; i++)
fprintf(fp, "%g,", gamma);
for(int i = 0; i < n; i++)
fprintf(fp, "%g,", eta);
for(int i = 0; i < n; i++){
if(i == n - 1)
fprintf(fp, "%g", rho);
else
fprintf(fp, "%g,", rho);
}
fprintf(fp, "};\n");
}
#ifndef _MELEMENT_H_
#define _MELEMENT_H_
#include <stdio.h>
#include <algorithm>
#include "GmshDefines.h"
#include "MVertex.h"
// the reference topology is defined in Mesh/{Edge,Face}.cpp
extern int edges_tetra[6][2];
extern int edges_quad[4][2];
extern int edges_hexa[12][2];
extern int edges_prism[9][2];
extern int edges_pyramid[8][2];
extern int trifaces_tetra[4][3];
extern int trifaces_prism[2][3];
extern int trifaces_pyramid[4][3];
extern int quadfaces_hexa[6][4];
extern int quadfaces_prism[3][4];
extern int quadfaces_pyramid[1][4];
class MElement
{
private:
static int _globalNum;
int _num, _partition;
bool _visible;
public :
MElement(int num=0, int part=0)
: _partition(part), _visible(true)
{
if(num){
_num = num;
_globalNum = std::max(_globalNum, _num);
}
else{
_num = ++_globalNum;
}
}
virtual ~MElement(){}
// returns the tag of the element
virtual int getNum(){ return _num; }
// returns the partition to which the element belongs
virtual int getPartition(){ return _partition; }
// get/set the visibility flag
virtual bool isVisible(){ return _visible; }
virtual void setVisible(bool val){ _visible = val; }
// get the vertices
virtual int getNumVertices() = 0;
virtual MVertex *getVertex(int num) = 0;
// get the edges
virtual int getNumEdges() = 0;
virtual void getEdge(int num, MVertex *v[2]) = 0;
// get an edge representation for drawing
virtual int getNumEdgesRep(){ return getNumEdges(); }
virtual void getEdgeRep(int num, MVertex *v[2]){ getEdgeRep(num, v); }
// get the faces
virtual int getNumFaces() = 0;
virtual void getFace(int num, MVertex *v[4]) = 0;
// get a face representation for drawing
virtual int getNumFacesRep(){ return getNumFaces(); }
virtual void getFaceRep(int num, MVertex *v[4]){ getFace(num, v); }
// get the max/min edge length
virtual double maxEdge();
virtual double minEdge();
// get the quality measures
virtual double rhoShapeMeasure();
virtual double gammaShapeMeasure(){ return 0.; }
virtual double etaShapeMeasure(){ return 0.; }
// computes the barycenter
virtual void cog(double &x, double &y, double &z);
// IO routines
virtual void writeMSH(FILE *fp, double version=1.0, int num=0,
int elementary=1, int physical=1);
virtual void writePOS(FILE *fp);
virtual char *getStringForPOS() = 0;
virtual int getTypeForMSH() = 0;
};
class MLine : public MElement {
protected:
MVertex *_v[2];
public :
MLine (MVertex *v0, MVertex *v1, int num=0, int part=0)
: MElement (num, part)
{
_v[0] = v0; _v[1] = v1;
}
~MLine(){}
inline int getNumVertices(){ return 2; }
inline MVertex *getVertex(int num){ return _v[num]; }
virtual int getNumEdges(){ return 1; }
virtual void getEdge(int num, MVertex *v[2])
{
v[0] = _v[0]; v[1] = _v[1];
}
virtual int getNumFaces(){ return 0; }
virtual void getFace(int num, MVertex *v[4])
{
v[0] = v[1] = v[2] = v[3] = 0;
}
int getTypeForMSH(){ return LGN1; }
char *getStringForPOS(){ return "SL"; }
};
class MLine2 : public MLine {
protected:
MVertex *_vs[1];
public :
MLine2 (MVertex *v0, MVertex *v1, MVertex *v2, int num=0, int part=0)
: MLine(v0, v1, num, part)
{
_vs[0] = v2;
}
~MLine2(){}
inline int getNumVertices(){ return 3; }
inline MVertex *getVertex(int num){ return num < 2 ? _v[num] : _vs[num - 2]; }
int getNumEdgesRep(){ return 2; }
void getEdgeRep(int num, MVertex *v[2])
{
static int edges_lin2[2][2] = {
{0, 2}, {2, 1},
};
int i0 = edges_lin2[num][0];
int i1 = edges_lin2[num][1];
v[0] = i0 < 2? _v[i0] : _vs[i0 - 2];
v[1] = i1 < 2? _v[i1] : _vs[i1 - 2];
}
int getTypeForMSH(){ return LGN2; }
char *getStringForPOS(){ return "SL2"; }
};
class MTriangle : public MElement {
protected:
MVertex *_v[3];
public :
MTriangle (MVertex *v0, MVertex *v1, MVertex *v2, int num=0, int part=0)
: MElement (num, part)
{
_v[0] = v0; _v[1] = v1; _v[2] = v2;
}
~MTriangle(){}
inline int getNumVertices(){ return 3; }
inline MVertex *getVertex(int num){ return _v[num]; }
virtual int getNumEdges(){ return 3; }
virtual void getEdge(int num, MVertex *v[2])
{
v[0] = _v[edges_tetra[num][0]];
v[1] = _v[edges_tetra[num][1]];
}
virtual int getNumFaces(){ return 1; }
virtual void getFace(int num, MVertex *v[4])
{
v[0] = _v[0]; v[1] = _v[1]; v[2] = _v[2]; v[3] = 0;
}
int getTypeForMSH(){ return TRI1; }
char *getStringForPOS(){ return "ST"; }
};
class MTriangle2 : public MTriangle {
protected:
MVertex *_vs[3];
public :
MTriangle2 (MVertex *v0, MVertex *v1, MVertex *v2,
MVertex *v3, MVertex *v4, MVertex *v5,
int num=0, int part=0)
: MTriangle(v0, v1, v2, num, part)
{
_vs[0] = v3; _vs[1] = v4; _vs[2] = v5;
}
~MTriangle2(){}
inline int getNumVertices(){ return 6; }
inline MVertex *getVertex(int num){ return num < 3 ? _v[num] : _vs[num - 3]; }
int getNumEdgesRep(){ return 6; }
void getEdgeRep(int num, MVertex *v[2])
{
static int edges_tri2[6][2] = {
{0, 3}, {3, 1},
{1, 4}, {4, 2},
{2, 5}, {5, 0},
};
int i0 = edges_tri2[num][0];
int i1 = edges_tri2[num][1];
v[0] = i0 < 3? _v[i0] : _vs[i0 - 3];
v[1] = i1 < 3? _v[i1] : _vs[i1 - 3];
}
int getNumFacesRep(){ return 4; }
void getFaceRep(int num, MVertex *v[4])
{
static int trifaces_tri2[4][3] = {
{0, 3, 5},
{1, 4, 3},
{2, 5, 4},
{3, 4, 5},
};
int i0 = trifaces_tri2[num][0];
int i1 = trifaces_tri2[num][1];
int i2 = trifaces_tri2[num][2];
v[0] = i0 < 3? _v[i0] : _vs[i0 - 3];
v[1] = i1 < 3? _v[i1] : _vs[i1 - 3];
v[2] = i2 < 3? _v[i2] : _vs[i2 - 3];
v[3] = 0;
}
int getTypeForMSH(){ return TRI2; }
char *getStringForPOS(){ return "ST2"; }
};
class MQuadrangle : public MElement {
protected:
MVertex *_v[4];
public :
MQuadrangle(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3,
int num=0, int part=0)
: MElement (num, part)
{
_v[0] = v0; _v[1] = v1; _v[2] = v2; _v[3] = v3;
}
~MQuadrangle(){}
inline int getNumVertices(){ return 4; }
inline MVertex *getVertex(int num){ return _v[num]; }
virtual int getNumEdges(){ return 4; }
virtual void getEdge(int num, MVertex *v[2])
{
v[0] = _v[edges_quad[num][0]];
v[1] = _v[edges_quad[num][1]];
}
int getNumFaces(){ return 1; }
void getFace(int num, MVertex *v[4])
{
v[0] = _v[0]; v[1] = _v[1]; v[2] = _v[2]; v[3] = _v[3];
}
int getTypeForMSH(){ return QUA1; }
char *getStringForPOS(){ return "SQ"; }
};
class MQuadrangle2 : public MQuadrangle {
protected:
MVertex *_vs[5];
public :
MQuadrangle2(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3,
MVertex *v4, MVertex *v5, MVertex *v6, MVertex *v7,
MVertex *v8, int num=0, int part=0)
: MQuadrangle(v0, v1, v2, v3, num, part)
{
_vs[0] = v4; _v[1] = v5; _v[2] = v6; _v[3] = v7; _v[4] = v8;
}
~MQuadrangle2(){}
inline int getNumVertices(){ return 9; }
inline MVertex *getVertex(int num){ return num < 4 ? _v[num] : _vs[num - 4]; }
int getTypeForMSH(){ return QUA2; }
char *getStringForPOS(){ return "SQ2"; }
};
class MTetrahedron : public MElement {
protected:
MVertex *_v[4];
public :
MTetrahedron(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3,
int num=0, int part=0)
: MElement (num, part)
{
_v[0] = v0; _v[1] = v1; _v[2] = v2; _v[3] = v3;
}
~MTetrahedron(){}
inline int getNumVertices(){ return 4; }
inline MVertex *getVertex(int num){ return _v[num]; }
virtual int getNumEdges(){ return 4; }
virtual void getEdge(int num, MVertex *v[2])
{
v[0] = _v[edges_tetra[num][0]];
v[1] = _v[edges_tetra[num][1]];
}
int getNumFaces(){ return 4; }
void getFace(int num, MVertex *v[4])
{
v[0] = _v[trifaces_tetra[num][0]];
v[1] = _v[trifaces_tetra[num][1]];
v[2] = _v[trifaces_tetra[num][2]];
v[3] = 0;
}
int getTypeForMSH(){ return TET1; }
char *getStringForPOS(){ return "SS"; }
};
class MHexahedron : public MElement {
protected:
MVertex *_v[8];
public :
MHexahedron(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3,
MVertex *v4, MVertex *v5, MVertex *v6, MVertex *v7,
int num=0, int part=0)
: MElement (num, part)
{
_v[0] = v0; _v[1] = v1; _v[2] = v2; _v[3] = v3;
_v[4] = v4; _v[5] = v5; _v[6] = v6; _v[7] = v7;
}
~MHexahedron(){}
inline int getNumVertices(){ return 8; }
inline MVertex *getVertex(int num){ return _v[num]; }
virtual int getNumEdges(){ return 12; }
virtual void getEdge(int num, MVertex *v[2])
{
v[0] = _v[edges_hexa[num][0]];
v[1] = _v[edges_hexa[num][1]];
}
int getNumFaces(){ return 6; }
void getFace(int num, MVertex *v[4])
{
v[0] = _v[quadfaces_hexa[num][0]];
v[1] = _v[quadfaces_hexa[num][1]];
v[2] = _v[quadfaces_hexa[num][2]];
v[3] = _v[quadfaces_hexa[num][3]];
}
int getTypeForMSH(){ return HEX1; }
char *getStringForPOS(){ return "SH"; }
};
class MPrism : public MElement {
protected:
MVertex *_v[6];
public :
MPrism(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3,
MVertex *v4, MVertex *v5, int num=0, int part=0)
: MElement (num, part)
{
_v[0] = v0; _v[1] = v1; _v[2] = v2; _v[3] = v3;
_v[4] = v4; _v[5] = v5;
}
~MPrism(){}
inline int getNumVertices(){ return 6; }
inline MVertex *getVertex(int num){ return _v[num]; }
virtual int getNumEdges(){ return 9; }
virtual void getEdge(int num, MVertex *v[2])
{
v[0] = _v[edges_prism[num][0]];
v[1] = _v[edges_prism[num][1]];
}
int getNumFaces(){ return 5; }
void getFace(int num, MVertex *v[4])
{
if(num < 3){
v[0] = _v[trifaces_prism[num][0]];
v[1] = _v[trifaces_prism[num][1]];
v[2] = _v[trifaces_prism[num][2]];
v[3] = 0;
}
else{
v[0] = _v[quadfaces_prism[num - 3][0]];
v[1] = _v[quadfaces_prism[num - 3][1]];
v[2] = _v[quadfaces_prism[num - 3][2]];
v[3] = _v[quadfaces_prism[num - 3][3]];
}
}
int getTypeForMSH(){ return PRI1; }
char *getStringForPOS(){ return "SI"; }
};
class MPyramid : public MElement {
protected:
MVertex *_v[5];
public :
MPyramid(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3,
MVertex *v4, int num=0, int part=0)
: MElement (num, part)
{
_v[0] = v0; _v[1] = v1; _v[2] = v2; _v[3] = v3; _v[4] = v4;
}
~MPyramid(){}
inline int getNumVertices(){ return 5; }
inline MVertex *getVertex(int num){ return _v[num]; }
virtual int getNumEdges(){ return 8; }
virtual void getEdge(int num, MVertex *v[2])
{
v[0] = _v[edges_pyramid[num][0]];
v[1] = _v[edges_pyramid[num][1]];
}
int getNumFaces(){ return 5; }
void getFace(int num, MVertex *v[4])
{
if(num < 4){
v[0] = _v[trifaces_pyramid[num][0]];
v[1] = _v[trifaces_pyramid[num][1]];
v[2] = _v[trifaces_pyramid[num][2]];
v[3] = 0;
}
else{
v[0] = _v[quadfaces_pyramid[num - 4][0]];
v[1] = _v[quadfaces_pyramid[num - 4][1]];
v[2] = _v[quadfaces_pyramid[num - 4][2]];
v[3] = _v[quadfaces_pyramid[num - 4][3]];
}
}
int getTypeForMSH(){ return PYR1; }
char *getStringForPOS(){ return "SY"; }
};
#endif
#include <math.h>
#include "MVertex.h"
int MVertex::_globalNum = 0;
#ifndef _MVERTEX_H_ #ifndef _MVERTEX_H_
#define _MVERTEX_H_ #define _MVERTEX_H_
#include <stdio.h>
#include <algorithm>
class GEntity; class GEntity;
class MVertex
{ class MVertex{
double x_,y_,z_; private:
GEntity *ge; static int _globalNum;
int _num;
double _x, _y, _z;
GEntity *_ge;
public : public :
MVertex ( double _x, double _y, double _z , GEntity * _ge ) : MVertex(double x, double y, double z, GEntity *ge=0, int num=0)
x_(_x),y_(_y),z_(_z),ge(_ge) : _x(x), _y(y), _z(z), _ge(ge)
{
if(num){
_num = num;
_globalNum = std::max(_globalNum, _num);
}
else{
_num = ++_globalNum;
}
}
virtual ~MVertex(){}
inline double x() const {return _x;}
inline double y() const {return _y;}
inline double z() const {return _z;}
inline double & x() {return _x;}
inline double & y() {return _y;}
inline double & z() {return _z;}
inline GEntity* onWhat() const {return _ge;}
inline void setEntity(GEntity *ge) { _ge = ge; }
inline int getNum() const {return _num;}
inline void setNum(int num) { _num = num; }
void writeMSH(FILE *fp, double scalingFactor=1.0)
{ {
fprintf(fp, "%d %.16g %.16g %.16g\n", getNum(),
x() * scalingFactor, y() * scalingFactor, z() * scalingFactor);
}
void writeMSH(FILE *fp, double version, int num, int elementary, int physical)
{
fprintf(fp, "%d 15", num);
if(version < 2.0)
fprintf(fp, " %d %d 1", physical, elementary);
else
fprintf(fp, " 2 %d %d", physical, elementary);
fprintf(fp, " %d\n", _num);
} }
inline double x() const {return x_;}
inline double y() const {return y_;}
inline double z() const {return z_;}
inline double & x() {return x_;}
inline double & y() {return y_;}
inline double & z() {return z_;}
inline GEntity* onWhat() const {return ge;}
}; };
class MEdgeVertex : public MVertex { class MEdgeVertex : public MVertex{
private: private:
double u; double _u;
public : public :
MEdgeVertex ( double _x, double _y, double _z , GEntity * _ge , double _u) : MEdgeVertex(double x, double y, double z, GEntity *ge, double u)
MVertex (_x,_y,_z,_ge),u(_u) : MVertex(x, y, z, ge), _u(u)
{ {
} }
~MEdgeVertex(){}
}; };
class MFaceVertex : public MVertex class MFaceVertex : public MVertex{
{ private:
double u,v; double _u, _v;
public : public :
MFaceVertex ( double _x, double _y, double _z , GEntity * _ge , double _u, double _v) : MFaceVertex(double x, double y, double z, GEntity *ge, double u, double v)
MVertex (_x,_y,_z,_ge),u(_u),v(_v) : MVertex(x, y, z, ge), _u(u), _v(v)
{ {
} }
~MFaceVertex(){}
}; };
#endif #endif
# $Id: Makefile,v 1.80 2006-07-25 12:08:23 remacle Exp $ # $Id: Makefile,v 1.81 2006-08-04 14:28:02 geuzaine Exp $
# #
# Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
# #
...@@ -43,6 +43,9 @@ SRC = CAD.cpp \ ...@@ -43,6 +43,9 @@ SRC = CAD.cpp \
GFace.cpp\ GFace.cpp\
GRegion.cpp\ GRegion.cpp\
GModel.cpp\ GModel.cpp\
GModelIO.cpp\
MVertex.cpp \
MElement.cpp \
gmshModel.cpp\ gmshModel.cpp\
gmshEdge.cpp\ gmshEdge.cpp\
gmshFace.cpp\ gmshFace.cpp\
...@@ -75,6 +78,7 @@ depend: ...@@ -75,6 +78,7 @@ depend:
rm -f Makefile.new rm -f Makefile.new
# DO NOT DELETE THIS LINE # DO NOT DELETE THIS LINE
# 1 "/Users/geuzaine/.gmsh/Geo//"
CAD.o: CAD.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \ CAD.o: CAD.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \ ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
../DataStr/List.h ../DataStr/Tree.h ../Numeric/Numeric.h Geo.h \ ../DataStr/List.h ../DataStr/Tree.h ../Numeric/Numeric.h Geo.h \
...@@ -87,10 +91,12 @@ CAD.o: CAD.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \ ...@@ -87,10 +91,12 @@ CAD.o: CAD.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
../Mesh/Interpolation.h ../Mesh/Vertex.h ../Mesh/Mesh.h \ ../Mesh/Interpolation.h ../Mesh/Vertex.h ../Mesh/Mesh.h \
../Mesh/Create.h ../Mesh/Vertex.h ../Mesh/Mesh.h CAD.h ExtrudeParams.h \ ../Mesh/Create.h ../Mesh/Vertex.h ../Mesh/Mesh.h CAD.h ExtrudeParams.h \
../Common/Visibility.h ../Common/Context.h ../Common/Visibility.h ../Common/Context.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
MinMax.o: MinMax.cpp ../Common/Gmsh.h ../Common/Message.h \ MinMax.o: MinMax.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
../Numeric/Numeric.h ../Mesh/Vertex.h ../Common/Context.h ../Numeric/Numeric.h ../Mesh/Vertex.h ../Common/Context.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
ExtrudeParams.o: ExtrudeParams.cpp ../Common/Gmsh.h ../Common/Message.h \ ExtrudeParams.o: ExtrudeParams.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
...@@ -101,6 +107,7 @@ ExtrudeParams.o: ExtrudeParams.cpp ../Common/Gmsh.h ../Common/Message.h \ ...@@ -101,6 +107,7 @@ ExtrudeParams.o: ExtrudeParams.cpp ../Common/Gmsh.h ../Common/Message.h \
../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \ ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
../Common/GmshDefines.h ../Mesh/Metric.h ../Mesh/Vertex.h \ ../Common/GmshDefines.h ../Mesh/Metric.h ../Mesh/Vertex.h \
../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h ExtrudeParams.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h ExtrudeParams.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
Geo.o: Geo.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \ Geo.o: Geo.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \ ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
../DataStr/List.h ../DataStr/Tree.h ../Numeric/Numeric.h Geo.h CAD.h \ ../DataStr/List.h ../DataStr/Tree.h ../Numeric/Numeric.h Geo.h CAD.h \
...@@ -112,8 +119,9 @@ Geo.o: Geo.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \ ...@@ -112,8 +119,9 @@ Geo.o: Geo.cpp ../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \ ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
ExtrudeParams.h ../Parser/Parser.h ../Common/Context.h gmshModel.h \ ExtrudeParams.h ../Parser/Parser.h ../Common/Context.h gmshModel.h \
GModel.h GVertex.h GEntity.h Range.h SPoint3.h SBoundingBox3d.h \ GModel.h GVertex.h GEntity.h Range.h SPoint3.h SBoundingBox3d.h \
MVertex.h GPoint.h GEdge.h SVector3.h SPoint2.h GFace.h Pair.h \ MVertex.h GPoint.h GEdge.h SVector3.h SPoint2.h MElement.h GFace.h \
GRegion.h Pair.h GRegion.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
GeoUtils.o: GeoUtils.cpp ../Common/Gmsh.h ../Common/Message.h \ GeoUtils.o: GeoUtils.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
...@@ -124,62 +132,88 @@ GeoUtils.o: GeoUtils.cpp ../Common/Gmsh.h ../Common/Message.h \ ...@@ -124,62 +132,88 @@ GeoUtils.o: GeoUtils.cpp ../Common/Gmsh.h ../Common/Message.h \
../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \ ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
../Common/GmshDefines.h ../Mesh/Metric.h ../Mesh/Vertex.h \ ../Common/GmshDefines.h ../Mesh/Metric.h ../Mesh/Vertex.h \
../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h ExtrudeParams.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h ExtrudeParams.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
GVertex.o: GVertex.cpp GVertex.h GEntity.h Range.h SPoint3.h \ GVertex.o: GVertex.cpp GVertex.h GEntity.h Range.h SPoint3.h \
SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
GEdge.o: GEdge.cpp GEdge.h GEntity.h Range.h SPoint3.h SBoundingBox3d.h \ GEdge.o: GEdge.cpp GEdge.h GEntity.h Range.h SPoint3.h SBoundingBox3d.h \
MVertex.h ../Common/GmshDefines.h GVertex.h GPoint.h SVector3.h \ MVertex.h ../Common/GmshDefines.h GVertex.h GPoint.h SVector3.h \
SPoint2.h SPoint2.h MElement.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
GFace.o: GFace.cpp GFace.h GPoint.h GEntity.h Range.h SPoint3.h \ GFace.o: GFace.cpp GFace.h GPoint.h GEntity.h Range.h SPoint3.h \
SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h SPoint2.h SVector3.h \ SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h MElement.h SPoint2.h \
Pair.h GEdge.h GVertex.h SVector3.h Pair.h GEdge.h GVertex.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
GRegion.o: GRegion.cpp GRegion.h GEntity.h Range.h SPoint3.h \ GRegion.o: GRegion.cpp GRegion.h GEntity.h Range.h SPoint3.h \
SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GFace.h GPoint.h \ SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h MElement.h GFace.h \
SPoint2.h SVector3.h Pair.h GPoint.h SPoint2.h SVector3.h Pair.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
GModel.o: GModel.cpp GModel.h GVertex.h GEntity.h Range.h SPoint3.h \ GModel.o: GModel.cpp GModel.h GVertex.h GEntity.h Range.h SPoint3.h \
SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h GEdge.h \ SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h GEdge.h \
SVector3.h SPoint2.h GFace.h Pair.h GRegion.h SVector3.h SPoint2.h MElement.h GFace.h Pair.h GRegion.h
gmshModel.o: gmshModel.cpp gmshModel.h GModel.h GVertex.h GEntity.h \ # 1 "/Users/geuzaine/.gmsh/Geo//"
Range.h SPoint3.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h \ GModelIO.o: GModelIO.cpp ../Common/Message.h ../Common/GmshDefines.h \
GPoint.h GEdge.h SVector3.h SPoint2.h GFace.h Pair.h GRegion.h \ gmshRegion.h ../Mesh/Mesh.h ../DataStr/List.h ../DataStr/Tree.h \
../Mesh/Mesh.h ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h \
../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h ../Mesh/Vertex.h \
../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
../Geo/ExtrudeParams.h ../Common/VertexArray.h \
../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
../Parser/OpenFile.h ../DataStr/Tools.h ../DataStr/List.h \
../DataStr/Tree.h ../Common/Message.h gmshVertex.h gmshFace.h \
gmshEdge.h gmshRegion.h
gmshEdge.o: gmshEdge.cpp gmshModel.h GModel.h GVertex.h GEntity.h Range.h \
SPoint3.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h \
GEdge.h SVector3.h SPoint2.h GFace.h Pair.h GRegion.h gmshEdge.h \
gmshVertex.h ../Mesh/Mesh.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \ ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \
../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \ ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \ ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \ ../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \ ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \ ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
../Mesh/Interpolation.h ../Mesh/Vertex.h ../Mesh/Mesh.h CAD.h \ gmshModel.h GModel.h GVertex.h GEntity.h Range.h SPoint3.h \
ExtrudeParams.h Geo.h ../Common/Context.h SBoundingBox3d.h MVertex.h GPoint.h GEdge.h SVector3.h SPoint2.h \
gmshFace.o: gmshFace.cpp gmshModel.h GModel.h GVertex.h GEntity.h Range.h \ MElement.h GFace.h Pair.h GRegion.h gmshFace.h gmshVertex.h gmshEdge.h
SPoint3.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h \ # 1 "/Users/geuzaine/.gmsh/Geo//"
GEdge.h SVector3.h SPoint2.h GFace.h Pair.h GRegion.h gmshEdge.h \ MVertex.o: MVertex.cpp MVertex.h
gmshVertex.h ../Mesh/Mesh.h ../DataStr/List.h ../DataStr/Tree.h \ # 1 "/Users/geuzaine/.gmsh/Geo//"
MElement.o: MElement.cpp MElement.h MVertex.h GEntity.h Range.h SPoint3.h \
SBoundingBox3d.h ../Common/GmshDefines.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
gmshModel.o: gmshModel.cpp gmshModel.h GModel.h GVertex.h GEntity.h \
Range.h SPoint3.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h \
GPoint.h GEdge.h SVector3.h SPoint2.h MElement.h GFace.h Pair.h \
GRegion.h ../Mesh/Mesh.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \ ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Vertex.h \
../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \ ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Face.h \
../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \ ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h ../Mesh/Vertex.h \
../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \ ../Mesh/Simplex.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \ ../Common/SmoothNormals.h ../Numeric/Numeric.h ../Mesh/Metric.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \ ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
gmshFace.h ../Mesh/Interpolation.h ../Mesh/Vertex.h ../Mesh/Mesh.h \ Geo.h ../Parser/OpenFile.h ../DataStr/Tools.h ../DataStr/List.h \
CAD.h ExtrudeParams.h Geo.h ../Mesh/Utils.h ../Mesh/Vertex.h \ ../DataStr/Tree.h ../Common/Message.h gmshVertex.h gmshFace.h \
../Mesh/Mesh.h gmshEdge.h gmshRegion.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
gmshEdge.o: gmshEdge.cpp gmshModel.h GModel.h GVertex.h GEntity.h Range.h \
SPoint3.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h \
GEdge.h SVector3.h SPoint2.h MElement.h GFace.h Pair.h GRegion.h \
gmshEdge.h gmshVertex.h ../Mesh/Mesh.h ../DataStr/List.h \
../DataStr/Tree.h ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
../Mesh/Matrix.h ../Mesh/Interpolation.h ../Mesh/Vertex.h \
../Mesh/Mesh.h CAD.h ExtrudeParams.h Geo.h ../Common/Context.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
gmshFace.o: gmshFace.cpp gmshModel.h GModel.h GVertex.h GEntity.h Range.h \
SPoint3.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h \
GEdge.h SVector3.h SPoint2.h MElement.h GFace.h Pair.h GRegion.h \
gmshEdge.h gmshVertex.h ../Mesh/Mesh.h ../DataStr/List.h \
../DataStr/Tree.h ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
../Mesh/Matrix.h gmshFace.h ../Mesh/Interpolation.h ../Mesh/Vertex.h \
../Mesh/Mesh.h CAD.h ExtrudeParams.h Geo.h ../Mesh/Utils.h \
../Mesh/Vertex.h ../Mesh/Mesh.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
gmshRegion.o: gmshRegion.cpp gmshModel.h GModel.h GVertex.h GEntity.h \ gmshRegion.o: gmshRegion.cpp gmshModel.h GModel.h GVertex.h GEntity.h \
Range.h SPoint3.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h \ Range.h SPoint3.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h \
GPoint.h GEdge.h SVector3.h SPoint2.h GFace.h Pair.h GRegion.h \ GPoint.h GEdge.h SVector3.h SPoint2.h MElement.h GFace.h Pair.h \
gmshEdge.h gmshVertex.h ../Mesh/Mesh.h ../DataStr/List.h \ GRegion.h gmshEdge.h gmshVertex.h ../Mesh/Mesh.h ../DataStr/List.h \
../DataStr/Tree.h ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h \ ../DataStr/Tree.h ../DataStr/avl.h ../Mesh/Vertex.h ../Mesh/Element.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \ ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Vertex.h ../Mesh/Element.h \
../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \ ../Mesh/Face.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Edge.h \
...@@ -188,8 +222,11 @@ gmshRegion.o: gmshRegion.cpp gmshModel.h GModel.h GVertex.h GEntity.h \ ...@@ -188,8 +222,11 @@ gmshRegion.o: gmshRegion.cpp gmshModel.h GModel.h GVertex.h GEntity.h \
../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \ ../Mesh/Metric.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h \
../Mesh/Matrix.h gmshFace.h gmshRegion.h ../Mesh/Interpolation.h \ ../Mesh/Matrix.h gmshFace.h gmshRegion.h ../Mesh/Interpolation.h \
../Mesh/Vertex.h ../Mesh/Mesh.h CAD.h ExtrudeParams.h Geo.h ../Mesh/Vertex.h ../Mesh/Mesh.h CAD.h ExtrudeParams.h Geo.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
SVector3.o: SVector3.cpp SVector3.h SPoint3.h SVector3.o: SVector3.cpp SVector3.h SPoint3.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
SBoundingBox3d.o: SBoundingBox3d.cpp SBoundingBox3d.h SPoint3.h SBoundingBox3d.o: SBoundingBox3d.cpp SBoundingBox3d.h SPoint3.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
ExtractContour.o: ExtractContour.cpp ../Common/Gmsh.h ../Common/Message.h \ ExtractContour.o: ExtractContour.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
...@@ -200,6 +237,7 @@ ExtractContour.o: ExtractContour.cpp ../Common/Gmsh.h ../Common/Message.h \ ...@@ -200,6 +237,7 @@ ExtractContour.o: ExtractContour.cpp ../Common/Gmsh.h ../Common/Message.h \
../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \ ../Common/VertexArray.h ../Common/SmoothNormals.h ../Numeric/Numeric.h \
../Common/GmshDefines.h ../Mesh/Metric.h ../Mesh/Vertex.h \ ../Common/GmshDefines.h ../Mesh/Metric.h ../Mesh/Vertex.h \
../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h CAD.h ExtrudeParams.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h CAD.h ExtrudeParams.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
Print_Geo.o: Print_Geo.cpp ../Common/Gmsh.h ../Common/Message.h \ Print_Geo.o: Print_Geo.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment