proteus  1.8.1
C/C++/Fortran libraries
Domain.h
Go to the documentation of this file.
1 #ifndef DOMAIN_H
2 #define DOMAIN_H
3 
4 #include <iostream>
5 #include <vector>
6 #include <utility>
7 
8 using namespace std;
9 
10 class D_base
11 {
12  public:
13  D_base(int dimIn = 3, string nameIn = string("Domain"), string unitsIn = string("m"));
14  virtual void writeAsymptote(const char* filename)=0;
15  virtual void writePoly(const char* filename)=0;
16  //virtual void writeXdmf()=0;
17  int dim;
18  string name;
19  string units;
20  vector<double> x;//minx, miny, minz
21  vector<double> L;//bounding box when x is origin
22  };
23 
25 {
26  public:
27  RectangularDomain(int dimIn = 3, string nameIn = string("Domain"), string unitsIn = string("m"));
28  RectangularDomain(double x0 ,double Lx, string nameIn = string("Domain"), string unitsIn = string("m"));
29  RectangularDomain(double x0, double y0, double Lx, double Ly, string nameIn = string("Domain"), string unitsIn = string("m"));
30  RectangularDomain(double x0, double y0, double z0, double Lx, double Ly, double Lz, string nameIn = string("Domain"), string unitsIn = string("m"));
31  void writePoly(const char* filename);
32  void writeAsymptote(const char* filename);
33  //void writeXdmf();
34 };
35 
37 {
38  public:
39  PlanarStraightLineGraphDomain(int dimIn = 2, string nameIn = string("Domain"), string unitsIn = string("m"));
40  PlanarStraightLineGraphDomain(const vector<vector<double> >& verticesIn,const vector< vector<int> >& segmentsIn, const vector< vector<double> >& holesIn, const vector<double>& regionsIn, const vector<int>& vertexFlagsIn, const vector<int>& segmentFlagsIn, string nameIn = string("Domain"),string unitsIn = string("m"));
42 
43  void getSegmentPartition(vector<int>& s);
44  void getBoundingBox(vector<double>& v);
45  void readPoly(const char* filename);
46  void writePoly(const char* filename);
47  void writeAsymptote(const char* filename);
48  vector<vector<double> > vertices;
49  vector< vector<int> > segments;
50  vector< vector<double> > holes;
51  vector<double> regions;
52  vector<int> nVertices;
53  vector<int> nVertexAttributes;
54  vector<int> vertexAttributes;
55  vector<int> vertexFlags;
56  vector<int> segmentFlags;
57  vector<int> regionFlags;
58  vector<double> v;
59  vector<int> vN;
60  vector<int> sN;
61  vector<int> s;
62  vector<int> sFlags;
63  vector<int> hN;
64  vector<double> h;
65  vector<int> rN;
66  vector<double> r;
67  vector<string> line;
68  int xMax, xMin;
69  int yMax, yMin;
70  int sMax, sMin;
73 };
74 
75 /* class TriangulatedSurfaceDomain:public D_base */
76 /* { */
77 /* public: */
78 /* TriangulatedSurfaceDomain(); */
79 /* virtual ~TriangulatedSurfaceDomain(); */
80 /* void readSTL(const char* filename); */
81 /* void writePoly(const char* filename); */
82 /* void writeAsymptote(const char* filename); */
83 /* vector<double[3]> vertices; */
84 /* //triangles are vectors analagous to segments in 2D */
85 /* vector<int> triangles; */
86 /* vector<double[3]> nodes; */
87 /* }; */
88 /* class Mesh2DMDomain: public D_base
89  {
90  public:
91  Mesh2DMDomain();
92  virtual ~Mesh2DMDomain();
93  };
94  class Mesh3DMDomain: D_base;
95  {
96  public:
97  Mesh3DMDomain();
98  virtual ~Mesh3DMDomain();
99  };
100 */
102 {
103  public:
104  PiecewiseLinearComplexDomain(int dimIn = 3, string nameIn = string("Domain"), string unitsIn = string("m"));
105  PiecewiseLinearComplexDomain(const vector<vector < vector <double> > >& verticesIn,const vector< vector < vector < vector <int> > > >& facetsIn, const vector<vector<double> >& holesIn, const vector<double>& regionsIn, const vector<int>& vertexFlagsIn,const vector <int>& facetFlagsIn, string nameIn = string("Domain"),string unitsIn = string("m"));
106  virtual ~PiecewiseLinearComplexDomain();
107  void getBoundingBox(vector <double>& v);
108  void readPoly(const char* filename);
109  void writePoly(const char* filename);
110  void writeAsymptote(const char* filename);
111  vector < vector < vector <double> > > vertices;
112  vector < vector < vector <int> > > facets;
113  vector<double> regions;
114  vector<double> holes;
115  vector<int> facetHoles;
116  vector<int> vertexFlags;
117  vector<int> facetFlags;
120  vector<int> vN;
121  vector<double> v;
122  vector<int> f;
123  vector<int> fN;
124 
125 };
126 #endif
PlanarStraightLineGraphDomain::hN
vector< int > hN
Definition: Domain.h:63
PiecewiseLinearComplexDomain::regions
vector< double > regions
Definition: Domain.h:113
PlanarStraightLineGraphDomain::xMin
int xMin
Definition: Domain.h:68
PiecewiseLinearComplexDomain::vN
vector< int > vN
Definition: Domain.h:120
PlanarStraightLineGraphDomain::hasSegmentFlags
int hasSegmentFlags
Definition: Domain.h:72
PiecewiseLinearComplexDomain::facets
vector< vector< vector< int > > > facets
Definition: Domain.h:112
PlanarStraightLineGraphDomain::regions
vector< double > regions
Definition: Domain.h:51
PlanarStraightLineGraphDomain::sFlags
vector< int > sFlags
Definition: Domain.h:62
PlanarStraightLineGraphDomain
Definition: Domain.h:37
PiecewiseLinearComplexDomain::vertices
vector< vector< vector< double > > > vertices
Definition: Domain.h:111
PlanarStraightLineGraphDomain::holes
vector< vector< double > > holes
Definition: Domain.h:50
D_base::dim
int dim
Definition: Domain.h:17
s
Double s
Definition: Headers.h:84
PiecewiseLinearComplexDomain::fN
vector< int > fN
Definition: Domain.h:123
PlanarStraightLineGraphDomain::vertexAttributes
vector< int > vertexAttributes
Definition: Domain.h:54
PlanarStraightLineGraphDomain::s
vector< int > s
Definition: Domain.h:61
PiecewiseLinearComplexDomain::holes
vector< double > holes
Definition: Domain.h:114
PiecewiseLinearComplexDomain::hasFacetFlags
int hasFacetFlags
Definition: Domain.h:119
PlanarStraightLineGraphDomain::vN
vector< int > vN
Definition: Domain.h:59
PiecewiseLinearComplexDomain::vertexFlags
vector< int > vertexFlags
Definition: Domain.h:116
PlanarStraightLineGraphDomain::segmentFlags
vector< int > segmentFlags
Definition: Domain.h:56
RectangularDomain
Definition: Domain.h:25
PiecewiseLinearComplexDomain::f
vector< int > f
Definition: Domain.h:122
PlanarStraightLineGraphDomain::v
vector< double > v
Definition: Domain.h:58
PiecewiseLinearComplexDomain::readPoly
void readPoly(const char *filename)
PiecewiseLinearComplexDomain::facetHoles
vector< int > facetHoles
Definition: Domain.h:115
PlanarStraightLineGraphDomain::rN
vector< int > rN
Definition: Domain.h:65
PlanarStraightLineGraphDomain::segments
vector< vector< int > > segments
Definition: Domain.h:49
PiecewiseLinearComplexDomain::facetFlags
vector< int > facetFlags
Definition: Domain.h:117
PlanarStraightLineGraphDomain::line
vector< string > line
Definition: Domain.h:67
v
Double v
Definition: Headers.h:95
PlanarStraightLineGraphDomain::yMin
int yMin
Definition: Domain.h:69
PlanarStraightLineGraphDomain::hasVertexFlags
int hasVertexFlags
Definition: Domain.h:71
D_base::L
vector< double > L
Definition: Domain.h:21
PiecewiseLinearComplexDomain::getBoundingBox
void getBoundingBox(vector< double > &v)
PlanarStraightLineGraphDomain::nVertices
vector< int > nVertices
Definition: Domain.h:52
D_base::units
string units
Definition: Domain.h:19
PlanarStraightLineGraphDomain::r
vector< double > r
Definition: Domain.h:66
D_base::name
string name
Definition: Domain.h:18
PlanarStraightLineGraphDomain::vertexFlags
vector< int > vertexFlags
Definition: Domain.h:55
PiecewiseLinearComplexDomain::hasVertexFlags
int hasVertexFlags
Definition: Domain.h:118
PlanarStraightLineGraphDomain::vertices
vector< vector< double > > vertices
Definition: Domain.h:48
vector
float * vector(long nl, long nh)
PlanarStraightLineGraphDomain::sMin
int sMin
Definition: Domain.h:70
PlanarStraightLineGraphDomain::h
vector< double > h
Definition: Domain.h:64
PiecewiseLinearComplexDomain::v
vector< double > v
Definition: Domain.h:121
D_base::writeAsymptote
virtual void writeAsymptote(const char *filename)=0
D_base::writePoly
virtual void writePoly(const char *filename)=0
PiecewiseLinearComplexDomain
Definition: Domain.h:102
D_base::x
vector< double > x
Definition: Domain.h:20
PlanarStraightLineGraphDomain::regionFlags
vector< int > regionFlags
Definition: Domain.h:57
PlanarStraightLineGraphDomain::sN
vector< int > sN
Definition: Domain.h:60
D_base
Definition: Domain.h:11
PlanarStraightLineGraphDomain::nVertexAttributes
vector< int > nVertexAttributes
Definition: Domain.h:53