From 62c5572ca5ec4d392b95f642f77e599e85a86caf Mon Sep 17 00:00:00 2001 From: Bastien Gorissen <bastien.gorissen@cenaero.be> Date: Wed, 13 Jul 2011 15:06:44 +0000 Subject: [PATCH] Added proposed data structure for boundary layer information storage. --- Geo/MVertex.h | 5 +++++ Geo/MVertexBoundaryLayerData.cpp | 30 +++++++++++++++++++++++++++++ Geo/MVertexBoundaryLayerData.h | 33 ++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 Geo/MVertexBoundaryLayerData.cpp create mode 100644 Geo/MVertexBoundaryLayerData.h diff --git a/Geo/MVertex.h b/Geo/MVertex.h index 6f5edf7ce5..a931a7a9d0 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 0000000000..0257cfafa4 --- /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 0000000000..510a2f4d38 --- /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 -- GitLab