/usr/include/gmsh/GRegion.h is in libgmsh-dev 3.0.6+dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | // Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
#ifndef _GREGION_H_
#define _GREGION_H_
#include <list>
#include <string>
#include <vector>
#include <stdio.h>
#include "GEntity.h"
#include "boundaryLayersData.h"
class MElement;
class MTetrahedron;
class MHexahedron;
class MPrism;
class MPyramid;
class MPolyhedron;
class MTrihedron;
class ExtrudeParams;
class GRegionCompound;
class BoundaryLayerColumns;
// A model region.
class GRegion : public GEntity {
protected:
std::list<GFace*> l_faces;
std::list<GVertex *> embedded_vertices;
std::list<GFace *> embedded_faces;
std::list<GEdge *> embedded_edges;
std::list<int> l_dirs;
GRegionCompound *compound; // this model ede belongs to a compound
// replace faces (for gluing) for specific modelers, we have to
// re-create internal data ...
virtual void replaceFacesInternal (std::list<GFace*> &) {}
BoundaryLayerColumns _columns;
public:
GRegion(GModel *model, int tag);
virtual ~GRegion();
// delete mesh data
virtual void deleteMesh();
// get the dimension of the region (3)
virtual int dim() const { return 3; }
// set the visibility flag
virtual void setVisibility(char val, bool recursive=false);
// set color
virtual void setColor(unsigned int val, bool recursive=false);
// add embedded vertices/edges/faces
void addEmbeddedVertex(GVertex *v){ embedded_vertices.push_back(v); }
void addEmbeddedEdge(GEdge *e){ embedded_edges.push_back(e); }
void addEmbeddedFace(GFace *f){ embedded_faces.push_back(f); }
// get/set faces that bound the region
virtual std::list<GFace*> faces() const{ return l_faces; }
virtual std::list<int> faceOrientations() const{ return l_dirs; }
inline void set(const std::list<GFace*> f) { l_faces = f; }
// vertices that are embedded in the region
virtual std::list<GVertex*> &embeddedVertices() { return embedded_vertices; }
// edges that are embedded in the region
virtual std::list<GEdge*> embeddedEdges() const { return embedded_edges; }
virtual std::list<GEdge*> &embeddedEdges() { return embedded_edges; }
// faces that are embedded in the region
virtual std::list<GFace*> embeddedFaces() const { return embedded_faces; }
// edges that bound the region
virtual std::list<GEdge*> edges() const;
// vertices that bound the region
virtual std::list<GVertex*> vertices() const;
// get the bounding box
virtual SBoundingBox3d bounds() const;
// get the oriented bounding box
virtual SOrientedBoundingBox getOBB();
// check if the region is connected to another region by an edge
bool edgeConnected(GRegion *r) const;
// replace edges (gor gluing)
void replaceFaces (std::list<GFace*> &);
// compute volume, moment of intertia and center of gravity
double computeSolidProperties (std::vector<double> cg,
std::vector<double> inertia);
// return a type-specific additional information string
virtual std::string getAdditionalInfoString();
// export in GEO format
virtual void writeGEO(FILE *fp);
// number of types of elements
int getNumElementTypes() const { return 6; }
// get total/by-type number of elements in the mesh
unsigned int getNumMeshElements();
unsigned int getNumMeshParentElements();
void getNumMeshElements(unsigned *const c) const;
// get the start of the array of a type of element
MElement *const *getStartElementType(int type) const;
// get the element at the given index
MElement *getMeshElement(unsigned int index);
// reset the mesh attributes to default values
virtual void resetMeshAttributes();
// compound
void setCompound(GRegionCompound *grc) { compound = grc; }
GRegionCompound *getCompound() const { return compound; }
struct {
// do we recombine the tetrahedra of the mesh into hex?
int recombine3D;
// is this surface meshed using a transfinite interpolation
char method;
// the extrusion parameters (if any)
ExtrudeParams *extrude;
// corners of the transfinite interpolation
std::vector<GVertex*> corners;
// structured/unstructured coupling using pyramids
int QuadTri;
} meshAttributes ;
// a array for accessing the transfinite vertices using a triplet of
// indices
std::vector<std::vector<std::vector<MVertex*> > > transfinite_vertices;
std::vector<MTetrahedron*> tetrahedra;
std::vector<MHexahedron*> hexahedra;
std::vector<MPrism*> prisms;
std::vector<MPyramid*> pyramids;
std::vector<MTrihedron*> trihedra;
std::vector<MPolyhedron*> polyhedra;
void addTetrahedron(MTetrahedron *t){ tetrahedra.push_back(t); }
void addHexahedron(MHexahedron *h){ hexahedra.push_back(h); }
void addPrism(MPrism *p){ prisms.push_back(p); }
void addPyramid(MPyramid *p){ pyramids.push_back(p); }
void addPolyhedron(MPolyhedron *p){ polyhedra.push_back(p); }
void addTrihedron(MTrihedron *t){ trihedra.push_back(t); }
void addElement(int type, MElement *e);
// get the boundary layer columns
BoundaryLayerColumns *getColumns () { return &_columns; }
};
#endif
|