diff --git a/Geo/MVertex.h b/Geo/MVertex.h index 6f5edf7ce5039005bcea6e7c5b2c3392752b9ac0..a931a7a9d0f820057797e98103bbc4ebf69dfb47 100644 --- a/Geo/MVertex.h +++ b/Geo/MVertex.h @@ -10,6 +10,7 @@ #include <set> #include "SPoint2.h" #include "SPoint3.h" +#include "MVertexBoundaryLayerData.h" class GEntity; class GEdge; @@ -124,6 +125,8 @@ class MEdgeVertex : public MVertex{ protected: double _u, _lc; public: + MVertexBoundaryLayerData* bl_data; + MEdgeVertex(double x, double y, double z, GEntity *ge, double u, double lc = -1.0, int num = 0) : MVertex(x, y, z, ge,num), _u(u), _lc(lc) @@ -139,6 +142,8 @@ class MFaceVertex : public MVertex{ protected: double _u, _v; public : + MVertexBoundaryLayerData* bl_data; + MFaceVertex(double x, double y, double z, GEntity *ge, double u, double v, int num = 0) : MVertex(x, y, z, ge, num), _u(u), _v(v) { diff --git a/Geo/MVertexBoundaryLayerData.cpp b/Geo/MVertexBoundaryLayerData.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0257cfafa4e30785beb15f9c5c764de3b2ea6354 --- /dev/null +++ b/Geo/MVertexBoundaryLayerData.cpp @@ -0,0 +1,30 @@ +// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle +// +// See the LICENSE.txt file for license information. Please report all +// bugs and problems to <gmsh@geuz.org>. + +#include "MVertexBoundaryLayerData.h" + +std::vector<MVertex*>* MVertexBoundaryLayerData::getChildren(int i){ + if (i < this->children.size() && i >= 0) { + return &(children[i]); + } else { + return 0; + } +} + +int MVertexBoundaryLayerData::getNumChildren(int i) { + if (i < this->children.size() && i >= 0) { + return this->children[i].size(); + } else { + return -1; + } +} + +int MVertexBoundaryLayerData::getNumChildrenFamilies() { + return this->children.size(); +} + +void MVertexBoundaryLayerData::addChildrenFamily(std::vector<MVertex*> family) { + this->children.push_back(family); +} diff --git a/Geo/MVertexBoundaryLayerData.h b/Geo/MVertexBoundaryLayerData.h new file mode 100644 index 0000000000000000000000000000000000000000..510a2f4d382db608f91ebe78e8bcf49daaa9701d --- /dev/null +++ b/Geo/MVertexBoundaryLayerData.h @@ -0,0 +1,33 @@ +// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle +// +// See the LICENSE.txt file for license information. Please report all +// bugs and problems to <gmsh@geuz.org>. + +#ifndef _MVERTEXBOUNDARYLAYERDATA_H_ +#define _MVERTEXBOUNDARYLAYERDATA_H_ + +#include <vector> + +class MVertex; + +/* A simple data structure to keep track of the "children" of + * vertices in a boundary layer meshes. + * + * It should be filled for each MVertex on the boundary of the + * geometry with the vertices along the normal direction, in order. + */ +class MVertexBoundaryLayerData { + + private: + std::vector<std::vector<MVertex*> > children; + + public: + std::vector<MVertex*>* getChildren(int i); + int getNumChildren(int i); + + int getNumChildrenFamilies(); + void addChildrenFamily(std::vector<MVertex*> family); +}; + + +#endif