8#include <kernel/geometry/conformal_mesh.hpp>
9#include <kernel/geometry/vertex_set.hpp>
18 template<
typename Mesh_,
typename Shape_ =
typename Mesh_::ShapeType>
21 static void adapt(Mesh_&,
const Mesh_&)
27 template<
typename Mesh_>
28 struct DualAdaptor<Mesh_, Shape::Hypercube<1> >
30 static void adapt(Mesh_&,
const Mesh_&)
36 template<
typename Mesh_,
int shape_dim_>
37 struct DualAdaptor<Mesh_, Shape::Hypercube<shape_dim_> >
39 static_assert(shape_dim_ > 1,
"invalid shape dimension");
41 static void adapt(Mesh_& mesh_f,
const Mesh_& mesh_c)
43 typedef typename Mesh_::CoordType CoordType;
46 static constexpr int nfe = Shape::FaceTraits<Shape::Hypercube<shape_dim_>, shape_dim_-1>::count;
49 const CoordType scale = CoordType(1) / CoordType(nfe);
52 Index num_cells = mesh_c.get_num_entities(shape_dim_);
56 for(
int i(0); (i+1) < shape_dim_; ++i)
58 fvo += mesh_c.get_num_entities(i);
60 Index cvo = fvo + mesh_c.get_num_entities(shape_dim_ - 1);
63 auto& vtx = mesh_f.get_vertex_set();
66 const auto& facet = mesh_c.template get_index_set<shape_dim_, shape_dim_-1>();
69 for(Index i(0); i < num_cells; ++i)
72 auto& v = vtx[cvo + i];
76 for(
int j(0); j < nfe; ++j)
77 v += scale * vtx[fvo + facet(i,j)];
std::uint64_t Index
Index data type.