topology3D.hh

Go to the documentation of this file.
1 
7 #ifndef topology3D_hh
8 #define topology3D_hh
9 
10 #include <memory>
11 #include "basics/typedefs.hh"
12 #include "basics/Zm.hh"
13 #include "connector.hh"
14 #include "topology.hh"
15 #include "hexsubdiv.hh"
16 
17 namespace concepts {
18 
19  // *********************************************************** Tetrahedron **
20 
35  class Tetrahedron : public Connector3 {
36  public:
53  Tetrahedron(Triangle& tri0, Triangle& tri1, Triangle& tri2,
54  Triangle& tri3, Attribute attrib = Attribute());
55  virtual ~Tetrahedron();
56 
69  virtual Tetrahedron* child(uint i, bool mode = 0);
70  virtual const Tetrahedron* child(uint i) const;
71 
72  Edge* edge(uint i) const;
73  Triangle* face(uint i) const { return i < 4 ? tri_[i] : 0; }
74  Vertex* vertex(uint i) const;
75 
79  int rho(int i) const { return rho_[i]; }
80 
85  int tau(int i) const { return tau_[i]; }
86  protected:
87  virtual std::ostream& info(std::ostream& os) const;
88  private:
93 
96 
99 
105  Z3 tau_[4];
106 
113  Z2 rho_[4];
114  };
115 
116  // ************************************************************ Hexahedron **
117 
134  class Hexahedron : public Connector3 {
135  friend class HexSubdiv8;
136  friend class HexSubdiv2x;
137  friend class HexSubdiv2y;
138  friend class HexSubdiv2z;
139  friend class HexSubdiv4x;
140  friend class HexSubdiv4y;
141  friend class HexSubdiv4z;
142  public:
162  Hexahedron(Quad& quad0, Quad& quad1, Quad& quad2,
163  Quad& quad3, Quad& quad4, Quad& quad5,
164  const Attribute attrib = Attribute());
165  virtual ~Hexahedron();
166 
178  virtual Hexahedron* child(uint i, bool mode = 0);
179  virtual const Hexahedron* child(uint i) const;
180 
181  Edge* edge(uint i) const;
182  Quad* face(uint i) const { return i < 6 ? quad_[i] : 0; }
183  Vertex* vertex(uint i) const;
184 
188  Z2 rho(int i) const { return rho_[i]; }
189 
193  Z4 tau(int i) const { return tau_[i]; }
194 
195 
196 
208  void setStrategy(const HexSubdivision* strategy = 0)
209  throw(StrategyChange);
210 
216  const HexSubdivision* getStrategy() const { return subdivStrategy_; }
217  protected:
218  virtual std::ostream& info(std::ostream& os) const;
219  private:
224 
227 
229  Quad* quad_[6];
230 
239  Z4 tau_[6];
240 
249  Z2 rho_[6];
268  };
269 
270 } // namespace concepts
271 
272 #endif // topology3D_hh
Subdivision strategy for hexahedrons which generates 2 children perpendicular the y direction.
Definition: hexsubdiv.hh:211
A 3D element of the topology.
Definition: connector.hh:277
Hexahedron * chld_
Pointer to the first child.
Definition: topology3D.hh:223
Interface for topological subdivision strategies for hexahedrons.
Definition: hexsubdiv.hh:40
Z3 tau_[4]
Array of the rotation flags for the triangles.
Definition: topology3D.hh:105
const Attribute & attrib() const
Returns the attribute of the connector.
Definition: connector.hh:108
Hexahedron(Quad &quad0, Quad &quad1, Quad &quad2, Quad &quad3, Quad &quad4, Quad &quad5, const Attribute attrib=Attribute())
Constructor.
Triangle * tri_[4]
Array of triangles.
Definition: topology3D.hh:98
A quadrilateral in the topology.
Definition: topology.hh:272
virtual Hexahedron * child(uint i, bool mode=0)
Returns a child.
virtual const Hexahedron * child(uint i) const
Edge * edge(uint i) const
Returns a 1D component: edge.
Edge * edge(uint i) const
Returns a 1D component: edge.
int tau(int i) const
Returns the rotation of a face.
Definition: topology3D.hh:85
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Subdivision strategy for hexahedrons which generates 4 children along the x direction.
Definition: hexsubdiv.hh:255
void setStrategy(const HexSubdivision *strategy=0)
Sets the subdivision strategy of this hexahedron.
virtual const Tetrahedron * child(uint i) const
Exception indicating that changing the subdivision strategy is not allowed (but was tried anyway).
Vertex * vertex(uint i) const
Returns a 0D component: vertex A 3D element consists of 2D, 1D and 0D elements, the vertices can be q...
Z4 tau(int i) const
Returns the rotation of a face.
Definition: topology3D.hh:193
Subdivision strategy for hexahedrons which generates 2 children perpendicular to the x direction.
Definition: hexsubdiv.hh:189
Z4 tau_[6]
Array of the rotation flags for the quadrilaterals.
Definition: topology3D.hh:239
Quad * quad_[6]
Array of quadrilaterals.
Definition: topology3D.hh:229
Tetrahedron * chld_
Pointer to the first child.
Definition: topology3D.hh:92
Tetrahedron * lnk_
Pointer to a sibling.
Definition: topology3D.hh:95
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
A hexahedron in the topology.
Definition: topology3D.hh:134
const HexSubdivision * getStrategy() const
Returns the subdivision strategy of this quad.
Definition: topology3D.hh:216
Tetrahedron(Triangle &tri0, Triangle &tri1, Triangle &tri2, Triangle &tri3, Attribute attrib=Attribute())
Constructor.
virtual Tetrahedron * child(uint i, bool mode=0)
Returns a child.
Subdivision strategy for hexahedrons which generates 8 children.
Definition: hexsubdiv.hh:167
Z2 rho_[6]
Array of the orientation flags for the quadrilaterals.
Definition: topology3D.hh:249
A vertex in the topology.
Definition: topology.hh:40
A tetrahedron in the topology.
Definition: topology3D.hh:35
int rho(int i) const
Returns the orientation of a face.
Definition: topology3D.hh:79
const HexSubdivision * subdivStrategy_
NOTE: You have to look at the Hexahedron like this, where the numbering are the quads.
Definition: topology3D.hh:267
Algebraic group with three elements: 0, 1 and 2.
Definition: Zm.hh:40
Quad * face(uint i) const
Returns a 2D component: face.
Definition: topology3D.hh:182
Subdivision strategy for hexahedrons which generates 4 children along the z direction.
Definition: hexsubdiv.hh:299
Vertex * vertex(uint i) const
Returns a 0D component: vertex A 3D element consists of 2D, 1D and 0D elements, the vertices can be q...
Triangle * face(uint i) const
Returns a 2D component: face.
Definition: topology3D.hh:73
Subdivision strategy for hexahedrons which generates 2 children perpendicular to the z direction.
Definition: hexsubdiv.hh:233
Binary group (algebraic): only the values 0 and 1 are represented.
Definition: Zm.hh:16
An edge in the topology.
Definition: topology.hh:73
Algebraic group with four elements: 0, 1, 2 and 3.
Definition: Zm.hh:68
A triangle in the topology.
Definition: topology.hh:193
Z2 rho_[4]
Array of the orientation flags for the triangles.
Definition: topology3D.hh:113
Attributes for elements of the topology.
Definition: connector.hh:22
Subdivision strategy for hexahedrons which generates 4 children along the y direction.
Definition: hexsubdiv.hh:277
Hexahedron * lnk_
Pointer to a sibling.
Definition: topology3D.hh:226
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Z2 rho(int i) const
Returns the orientation of a face.
Definition: topology3D.hh:188
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich