FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
target_index_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/geometry/intern/congruency_mapping.hpp>
10
11namespace FEAT
12{
13 namespace Geometry
14 {
16 namespace Intern
17 {
25 template<
26 typename Shape_,
27 int face_dim_>
28 class TargetIndexMapping
29 {
30 static_assert(face_dim_ < Shape_::dimension, "invalid cell dimension");
31 static_assert(face_dim_ >= 0, "invalid face dimension");
32
33 protected:
34 template<
35 typename Inner_,
36 typename Outer_>
37 class CompIndexMap
38 {
39 protected:
40 const Inner_& _inner;
41 const Outer_& _outer;
42
43 public:
44 explicit CompIndexMap(
45 const Inner_& inner,
46 const Outer_& outer)
47 :
48 _inner(inner),
49 _outer(outer)
50 {
51 }
52
53 Index operator[](int i) const
54 {
55 return _outer[_inner[i]];
56 }
57 }; // class CompIndexMap
58
60 int _cell_orient;
61
62 public:
63 template<
64 typename TrgVerts_,
65 typename SrcVerts_,
66 typename VertIdx_>
67 explicit TargetIndexMapping(
68 const TrgVerts_& target_verts,
69 const SrcVerts_& source_verts,
70 const VertIdx_& vert_idx)
71 {
72 typedef CongruencySampler<Shape_> SamplerType;
73
74 CompIndexMap<SrcVerts_, VertIdx_> comp_index_map(source_verts, vert_idx);
75
76 _cell_orient = SamplerType::compare(comp_index_map, target_verts);
77 }
78
79 Index map(int face) const
80 {
81 return Index(CongruencyMapping<Shape_, face_dim_>::map(_cell_orient, face));
82 }
83 }; // class TargetIndexMapping
84 } // namespace Intern
86 } // namespace Geometry
87} // namespace FEAT
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.