9#include <kernel/geometry/target_set.hpp>
10#include <kernel/geometry/intern/entity_counter.hpp>
11#include <kernel/geometry/intern/standard_refinement_traits.hpp>
23 struct SimpleTargetRefiner
25 typedef Shape_ ShapeType;
26 typedef TargetSet TargetSetType;
29 TargetSetType& target_set_out,
31 const Index index_offsets[],
32 const TargetSetType& target_set_in)
35 Index num_cells = target_set_in.get_num_entities();
36 static constexpr int shape_dim = ShapeType::dimension;
37 static constexpr int num_children = StandardRefinementTraits<ShapeType,cell_dim_>::count;
39 FEAT_PRAGMA_OMP(parallel
for)
40 for(Index i = 0; i < num_cells; ++i)
42 for(
int j(0); j < num_children; ++j)
44 target_set_out[offset + i*
Index(num_children) +
Index(j)] =
45 index_offsets[shape_dim] + target_set_in[i]*
Index(num_children) +
Index(j);
49 return num_cells*
Index(num_children);
56 int shape_dim_ = Shape_::dimension>
57 struct SimpleTargetRefineShapeWrapper
59 typedef Shape_ ShapeType;
60 typedef TargetSet TargetSetType;
61 typedef TargetSetHolder<ShapeType> TargetSetHolderType;
64 TargetSetType& target_set_out,
65 const Index index_offsets[],
66 const TargetSetHolderType& target_set_holder_in)
69 typedef typename Shape::FaceTraits<ShapeType, shape_dim_ - 1>::ShapeType FacetType;
70 Index offset = SimpleTargetRefineShapeWrapper<FacetType, cell_dim_>::refine(
73 target_set_holder_in);
76 const TargetSetType& target_set_in = target_set_holder_in.template get_target_set<shape_dim_>();
79 SimpleTargetRefiner<ShapeType, cell_dim_>::refine(
86 return offset + Intern::StandardRefinementTraits<ShapeType, cell_dim_>::count *
87 target_set_holder_in.get_num_entities(shape_dim_);
94 struct SimpleTargetRefineShapeWrapper<Shape_, cell_dim_, cell_dim_>
96 typedef Shape_ ShapeType;
97 typedef TargetSet TargetSetType;
98 typedef typename Shape::FaceTraits<Shape_, cell_dim_>::ShapeType CellType;
99 typedef TargetSetHolder<CellType> TargetSetHolderType;
102 TargetSetType& target_set_out,
103 const Index index_offsets[],
104 const TargetSetHolderType& target_set_holder_in)
107 const TargetSetType& target_set_in = target_set_holder_in.template get_target_set<cell_dim_>();
110 SimpleTargetRefiner<ShapeType, cell_dim_>::refine(
117 return StandardRefinementTraits<ShapeType, cell_dim_>::count *
118 target_set_holder_in.get_num_entities(cell_dim_);
124 int cell_dim_ = Shape_::dimension>
125 struct SimpleTargetRefineWrapper
127 typedef Shape_ ShapeType;
128 typedef TargetSet TargetSetType;
129 typedef typename Shape::FaceTraits<Shape_, cell_dim_>::ShapeType CellType;
130 typedef TargetSetHolder<CellType> TargetSetHolderTypeOut;
131 typedef TargetSetHolder<ShapeType> TargetSetHolderTypeIn;
134 TargetSetHolderTypeOut& target_set_holder_out,
135 const Index num_entities_trg[],
136 const TargetSetHolderTypeIn& target_set_holder_in)
139 SimpleTargetRefineWrapper<ShapeType, cell_dim_ - 1>::refine(
140 target_set_holder_out,
142 target_set_holder_in);
145 Index index_offsets[Shape_::dimension + 1];
146 EntityCounter<StandardRefinementTraits, ShapeType, cell_dim_>::offset(index_offsets, num_entities_trg);
149 TargetSet& target_set_out = target_set_holder_out.template get_target_set<cell_dim_>();
152 SimpleTargetRefineShapeWrapper<ShapeType, cell_dim_>::refine(
155 target_set_holder_in);
159 template<
typename Shape_>
160 struct SimpleTargetRefineWrapper<Shape_, 0>
162 typedef Shape_ ShapeType;
163 typedef TargetSet TargetSetType;
164 typedef typename Shape::FaceTraits<Shape_, 0>::ShapeType CellType;
165 typedef TargetSetHolder<CellType> TargetSetHolderTypeOut;
166 typedef TargetSetHolder<ShapeType> TargetSetHolderTypeIn;
169 TargetSetHolderTypeOut& target_set_holder_out,
170 const Index num_entities_trg[],
171 const TargetSetHolderTypeIn& target_set_holder_in)
174 Index index_offsets[Shape_::dimension + 1];
175 EntityCounter<StandardRefinementTraits, ShapeType, 0>::offset(index_offsets, num_entities_trg);
178 TargetSet& target_set_out = target_set_holder_out.template get_target_set<0>();
181 SimpleTargetRefineShapeWrapper<ShapeType, 0>::refine(
184 target_set_holder_in);
std::uint64_t Index
Index data type.