FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
mapping.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8// includes, FEAT
9#include <kernel/trafo/mapping_base.hpp>
10#include <kernel/trafo/standard/evaluator.hpp>
11#include <kernel/geometry/mesh_part.hpp>
12#include <kernel/geometry/atlas/chart.hpp>
13
14namespace FEAT
15{
16 namespace Trafo
17 {
24 namespace Standard
25 {
36 template<typename Mesh_>
37 class Mapping :
38 public MappingBase<Mesh_>
39 {
40 public:
44 typedef Mesh_ MeshType;
46 typedef typename MeshType::VertexSetType::CoordType CoordType;
48 typedef typename MeshType::ShapeType ShapeType;
51 typedef typename Shape::FaceTraits<ShapeType, ShapeType::dimension - 1>::ShapeType FacetType;
52
53 public:
55 template<
56 typename Shape_ = ShapeType,
57 typename CoordType_ = Real>
59 {
60 private:
63
64 public:
67 };
68
69 public:
76 explicit Mapping(MeshType& mesh) :
77 BaseClass(mesh)
78 {
79 }
80
81 Mapping(Mapping&& other) = default;
82 Mapping& operator=(Mapping&&) = default;
83
98 template<typename ShapeType_ = ShapeType, typename CoordType_ = CoordType>
99 CoordType_ compute_vol(const Index cell) const
100 {
101 typename Evaluator<ShapeType_, CoordType_>::Type evaluator(*this);
102
103 evaluator.prepare(cell);
104 CoordType_ vol = evaluator.volume();
105 evaluator.finish();
106 return vol;
107 }
108
115 {
116 typename Evaluator<ShapeType, CoordType>::Type evaluator(*this);
117
118 CoordType vol(0);
119
120 Index num_cells = this->get_mesh().get_num_entities(ShapeType::dimension);
121 for(Index cell(0); cell < num_cells; ++cell)
122 {
123 evaluator.prepare(cell);
124 vol += evaluator.volume();
125 evaluator.finish();
126 }
127
128 return vol;
129 }
130
141 {
142 // nothing to do here; the only purpose of this function is to supply
143 // the same interface as the Trafo::Isoparam::Mapping class
144 }
145 }; // class Mapping<...>
146 } // namespace Standard
147 } // namespace Trafo
148} // namespace FEAT
Class template for partial meshes.
Definition: mesh_part.hpp:90
void finish()
Finishes the evaluator for the currently active cell.
Trafo-Mapping base class.
MeshType & get_mesh()
Returns a reference to the underlying mesh.
Standard trafo evaluator class template.
Definition: evaluator.hpp:29
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
Definition: evaluator.hpp:100
DataType volume() const
Computes and returns the volume of the current cell.
Definition: evaluator.hpp:167
Trafo evaluator class template.
Definition: mapping.hpp:59
Trafo::StandardEvalPolicy< Shape_, CoordType_, MeshType::world_dim > EvalPolicy
evaluation policy
Definition: mapping.hpp:62
Trafo::Standard::Evaluator< Mapping, EvalPolicy > Type
evaluator type
Definition: mapping.hpp:66
Standard transformation mapping class template.
Definition: mapping.hpp:39
CoordType_ compute_vol(const Index cell) const
Computes the volume of one cell.
Definition: mapping.hpp:99
MappingBase< Mesh_ > BaseClass
base-class typedef
Definition: mapping.hpp:42
Shape::FaceTraits< ShapeType, ShapeType::dimension-1 >::ShapeType FacetType
Definition: mapping.hpp:51
MeshType::VertexSetType::CoordType CoordType
data type
Definition: mapping.hpp:46
MeshType::ShapeType ShapeType
shape type
Definition: mapping.hpp:48
CoordType compute_vol()
Computes the volume of the whole mesh given by this trafo.
Definition: mapping.hpp:114
void add_meshpart_chart(const Geometry::MeshPart< MeshType > &mesh_part, const Geometry::Atlas::ChartBase< MeshType > &chart)
Adds a mesh-part and its associated chart to the trafo.
Definition: mapping.hpp:140
Mapping(MeshType &mesh)
Constructor.
Definition: mapping.hpp:76
FEAT namespace.
Definition: adjactor.hpp:12
double Real
Real data type.
std::uint64_t Index
Index data type.
Face traits tag struct template.
Definition: shape.hpp:106
Standard evaluation policy class template.
Definition: base.hpp:44