mappingEdge3D.hh

Go to the documentation of this file.
1 #ifndef MAPPINGEDGE3D_HH
2 #define MAPPINGEDGE3D_HH
3 
9 // #include "basics/outputOperator.hh"
10 // #include "basics/typedefs.hh"
11 // #include "basics/vectorsMatrices.hh"
12 // #include "basics/cloneable.hh"
13 #include "basics.hh"
14 #include "toolbox/sequence.hh"
15 #include "toolbox/arrayOp.hh"
16 
17 #include <array>
18 
19 namespace concepts {
20 
21 
22  // ********************************************************* MappingEdge3d **
23 
31  class MappingEdge3d : public Map1d {
32  public:
37  MappingEdge3d(const Real3d& vtx0, const Real3d& vtx1);
41  ~MappingEdge3d() override;
46  virtual MappingEdge3d* clone() const = 0;
51  virtual MappingEdge3d* inverse() const = 0;
55  virtual Real3d operator()(const Real t) const = 0;
60  virtual Real3d derivative(const Real t, const uint n = 1) const = 0;
64  inline const Real3d& vtx(uint i) const {return vtx_[i];}
65  protected:
66  std::ostream& info(std::ostream& os) const override;
68  std::array<Real3d,2> vtx_;
69  };
70 
71 
72  // ************************************************* MappingQuadEdge3d **
73  // Implementation of this class not yet done since not required to generate
74  // 3d geometry with curved hexahedra
75 
76  // ************************************************* MappingStraightEdge3d **
77 
84  public:
87  MappingStraightEdge3d(const Real3d& vtx0, const Real3d& vtx1);
91  MappingStraightEdge3d* clone() const override;
92  MappingStraightEdge3d* inverse() const override;
93  Real3d operator()(const Real t) const override;
94  Real3d derivative(const Real t, const uint n = 1) const override;
95  protected:
96  std::ostream& info(std::ostream& os) const override;
97  };
98 
99 
100  // ************************************************** CircleMappingEdge3d **
101 
116  public:
123  CircleMappingEdge3d(const Real3d& vtx0, const Real3d& vtx1,
124  const Real radius, const Real3d& center,
125  const Real tol=1e6*std::numeric_limits<double>::epsilon());
126 
131  CircleMappingEdge3d* clone() const override;
132  CircleMappingEdge3d* inverse() const override;
133  Real3d operator()(const Real t) const override;
134  Real3d derivative(const Real t, const uint n = 1) const override;
135  Real getRadius() const {return radius_;}
136  Real3d getCenter() const {return center_;}
137  protected:
138  std::ostream& info(std::ostream& os) const override;
139  private:
144  };
145 
146  // ************************************************** MappingHexahedronEdge3d **
147 
148  // forward declaration
149  class MappingHexahedron3d;
150 
162  public:
170  MappingHexahedronEdge3d(const MappingHexahedron3d& map, const uint edge);
178  const Real3d xi, const Real3d diff);
181  MappingHexahedronEdge3d* clone() const override;
183  Real3d operator()(const Real t) const override;
184  Real3d derivative(const Real t, const uint n = 1) const override;
185  MappingHexahedronEdge3d* inverse() const override;
186  protected:
187  std::ostream& info(std::ostream& os) const override;
188  private:
190  std::unique_ptr<MappingHexahedron3d> map_;
193 
195  inline const Real3d lcoord_(const Real t) const {
196  return xi_ + diff_*t;
197  }
199  inline const Real3d lderiv_(const Real t) const {
200  return diff_;
201  }
202  };
203 
204 
205 } // namespace concepts
206 
207 #endif // MAPPINGEDGE3D_HH
std::unique_ptr< MappingHexahedron3d > map_
Mapping of the parent hexahedron.
MappingHexahedronEdge3d * inverse() const override
Create a heap-allocated copy of this edge with reversed parametrization.
Real3d derivative(const Real t, const uint n=1) const override
Evaluates the n-th derivative of the edge mapping at the coordinate t.
std::ostream & info(std::ostream &os) const override
Returns information in an output stream.
const Real3d & vtx(uint i) const
Returns i-th physical vertex of the edge.
MappingStraightEdge3d * clone() const override
Virtual constructor.
Real3d derivative(const Real t, const uint n=1) const override
Evaluates the n-th derivative of the edge mapping at the coordinate t.
MappingEdge3d(const Real3d &vtx0, const Real3d &vtx1)
Constructor.
Real3d derivative(const Real t, const uint n=1) const override
Evaluates the n-th derivative of the edge mapping at the coordinate t.
virtual MappingEdge3d * clone() const =0
Virtual constructor.
virtual Real3d operator()(const Real t) const =0
Evaluates the edge mapping at the coordinate t.
Base class for an edge element map .
virtual Real3d derivative(const Real t, const uint n=1) const =0
Evaluates the n-th derivative of the edge mapping at the coordinate t.
const Real3d lcoord_(const Real t) const
Embedding of local coordinates to parent hexahedron reference domain.
CircleMappingEdge3d * inverse() const override
Create a heap-allocated copy of this edge with reversed parametrization.
Real3d operator()(const Real t) const override
Evaluates the edge mapping at the coordinate t.
Interface for the element map of a hexahedron embedded in R^3 (analogous to the design of MappingQuad...
CircleMappingEdge3d * clone() const override
Virtual constructor.
MappingHexahedronEdge3d(const MappingHexahedronEdge3d &other)
Copy Constructor.
std::ostream & info(std::ostream &os) const override
Returns information in an output stream.
virtual MappingEdge3d * inverse() const =0
Create a heap-allocated copy of this edge with reversed parametrization.
MappingHexahedronEdge3d * clone() const override
Virtual constructor.
A 3D straight edge element map.
MappingStraightEdge3d * inverse() const override
Create a heap-allocated copy of this edge with reversed parametrization.
~MappingEdge3d() override
Virtual destructor.
const Real3d lderiv_(const Real t) const
Derivative of the local embedding.
MappingEdge3d(const MappingEdge3d &other)
Copy constructor.
3D element map for an edge as part of a Hexahedron.
MappingHexahedronEdge3d(const MappingHexahedron3d &map, const Real3d xi, const Real3d diff)
Constructor for an locally straight edge inside the hexahedron.
Real3d operator()(const Real t) const override
Evaluates the edge mapping at the coordinate t.
Real radius_
Radius of the circle.
Real3d center_
Center of the circle.
std::array< Real3d, 2 > vtx_
Physical vertices .
~CircleMappingEdge3d() override
Destructor.
Real3d xi_
Vertex and edge vector in hexahedral coordinates.
std::ostream & info(std::ostream &os) const override
Returns information in an output stream.
An abstract class for a 1d map.
Definition: elementMaps.hh:24
Real3d operator()(const Real t) const override
Evaluates the edge mapping at the coordinate t.
MappingStraightEdge3d(const Real3d &vtx0, const Real3d &vtx1)
Constructor.
MappingStraightEdge3d(const MappingStraightEdge3d &other)
Copy Constructor.
std::ostream & info(std::ostream &os) const override
Returns information in an output stream.
CircleMappingEdge3d(const CircleMappingEdge3d &other)
Copy Constructor.
CircleMappingEdge3d(const Real3d &vtx0, const Real3d &vtx1, const Real radius, const Real3d &center, const Real tol=1e6 *std::numeric_limits< double >::epsilon())
Constructor.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
MappingHexahedronEdge3d(const MappingHexahedron3d &map, const uint edge)
Constructor for an edge as a part of a parent hexahedron.
A 3D circular edge element map.
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich