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
95 template<typename ShapeType_ = ShapeType, typename CoordType_ = CoordType>
96 CoordType_ compute_vol(const Index cell) const
97 {
98 typename Evaluator<ShapeType_, CoordType_>::Type evaluator(*this);
99
100 evaluator.prepare(cell);
101 CoordType_ vol = evaluator.volume();
102 evaluator.finish();
103 return vol;
104 }
105
112 {
113 typename Evaluator<ShapeType, CoordType>::Type evaluator(*this);
114
115 CoordType vol(0);
116
117 Index num_cells = this->get_mesh().get_num_entities(ShapeType::dimension);
118 for(Index cell(0); cell < num_cells; ++cell)
119 {
120 evaluator.prepare(cell);
121 vol += evaluator.volume();
122 evaluator.finish();
123 }
124
125 return vol;
126 }
127
138 {
139 // nothing to do here; the only purpose of this function is to supply
140 // the same interface as the Trafo::Isoparam::Mapping class
141 }
142 }; // class Mapping<...>
143 } // namespace Standard
144 } // namespace Trafo
145} // 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:96
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:111
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:137
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