Class documentation of Concepts

Loading...
Searching...
No Matches
cell.hh
Go to the documentation of this file.
1
8#ifndef cell_hh
9#define cell_hh
10
11#include <iostream>
12
14#include "basics/typedefs.hh"
15#include "basics/exceptions.hh"
18#include "connector.hh"
19
20namespace concepts {
21
22 // ****************************************************************** Cell **
23
39 class Cell: public OutputOperator {
40 public:
44 virtual Cell* child(uint i) = 0;
48 virtual const Cell* child(uint i) const = 0;
50 inline bool hasChildren() const {
51 return child(0) != 0;
52 }
54 virtual Connector& connector() const = 0;
55
57 virtual Real3d elemMap(const Real coord_local) const;
58
60 virtual Real3d elemMap(const Real2d& coord_local) const;
61
63 virtual Real3d elemMap(const Real3d& coord_local) const;
64
65 protected:
66 virtual std::ostream& info(std::ostream& os) const = 0;
67 };
68
70 bool operator<(const Cell& cell_x, const Cell& cell_y);
71
72 // ***************************************************************** Cell1 **
73
75 class Cell1: public Cell {
76 public:
77 virtual Cell1* child(uint i) = 0;
78 virtual const Cell1* child(uint i) const = 0;
79 virtual Connector1& connector() const = 0;
81 virtual Real3d vertex(uint i) const = 0;
83 virtual Real3d center() const = 0;
84 };
85
86 // ***************************************************************** Cell2 **
87
89 class Cell2: public Cell {
90 public:
91 virtual Cell2* child(uint i) = 0;
92 virtual const Cell2* child(uint i) const = 0;
93 virtual Connector2& connector() const = 0;
95 virtual Real3d vertex(uint i) const = 0;
97 virtual Real3d center() const = 0;
98
99 virtual Real3d elemMap(const Real2d& coord_local) const = 0;
104 virtual Real3d elemMap(const Real3d& coord_local) const {
105 return elemMap(Real2d(coord_local[0], coord_local[1]));
106 }
107 };
108
109 // ***************************************************************** Cell3 **
110
112 class Cell3: public Cell {
113 public:
114 virtual Cell3* child(uint i) = 0;
115 virtual const Cell3* child(uint i) const = 0;
116 virtual Connector3& connector() const = 0;
118 virtual Real3d vertex(uint i) const = 0;
120 virtual Real3d center() const = 0;
121 };
122
123} // namespace concepts
124
125namespace std {
126
127 // ****************************************************** std::less<Cell*> **
128
137 template<>
138 struct less<concepts::Cell*> : public std::binary_function<concepts::Cell*,
139 concepts::Cell*, bool> {
140 bool operator()(concepts::Cell* const & __x,
141 concepts::Cell* const & __y) const;
142 };
143
144 template<>
145 struct less<concepts::Cell1*> : less<concepts::Cell*> {
146 };
147 template<>
148 struct less<concepts::Cell2*> : less<concepts::Cell*> {
149 };
150 template<>
151 struct less<concepts::Cell3*> : less<concepts::Cell*> {
152 };
153
154} // namespace std
155
156#endif // cell_hh
One dimensional cell.
Definition cell.hh:75
virtual Real3d vertex(uint i) const =0
Returns the coordinates of the ith vertex.
virtual const Cell1 * child(uint i) const =0
virtual Cell1 * child(uint i)=0
virtual Connector1 & connector() const =0
Returns the connector.
virtual Real3d center() const =0
Returns the center of the cell.
Two dimensional cell.
Definition cell.hh:89
virtual Real3d vertex(uint i) const =0
Returns the coordinates of the ith vertex.
virtual Real3d center() const =0
Returns the center of the cell.
virtual Real3d elemMap(const Real3d &coord_local) const
Definition cell.hh:104
virtual Cell2 * child(uint i)=0
virtual Real3d elemMap(const Real2d &coord_local) const =0
Element map from point local coordinates in 2D.
virtual Connector2 & connector() const =0
Returns the connector.
virtual const Cell2 * child(uint i) const =0
Three dimensional cell.
Definition cell.hh:112
virtual const Cell3 * child(uint i) const =0
virtual Cell3 * child(uint i)=0
virtual Connector3 & connector() const =0
Returns the connector.
virtual Real3d center() const =0
Returns the center of the cell.
virtual Real3d vertex(uint i) const =0
Returns the coordinates of the ith vertex.
bool hasChildren() const
Returns true if there is a least one child.
Definition cell.hh:50
virtual Real3d elemMap(const Real3d &coord_local) const
Element map from point local coordinates in 3D.
virtual const Cell * child(uint i) const =0
virtual Real3d elemMap(const Real2d &coord_local) const
Element map from point local coordinates in 2D.
virtual Real3d elemMap(const Real coord_local) const
Element map from point local coordinates in 1D.
virtual Cell * child(uint i)=0
virtual std::ostream & info(std::ostream &os) const =0
Returns information in an output stream.
virtual Connector & connector() const =0
Returns the connector.
bool operator<(const Cell &cell_x, const Cell &cell_y)
<-operator could be useful for sorting, e.g. in std::set.
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320