5 #include <dune/geometry/referenceelements.hh> 6 #include <dune/localfunctions/common/localkey.hh> 8 #include <amdis/Output.hpp> 13 template <
class IdSet,
int dim>
16 using IdType =
typename IdSet::IdType;
18 using RefElements =
typename Dune::ReferenceElements<double,dim>;
19 using RefElement =
typename RefElements::ReferenceElement;
28 template <
class Element>
29 void bind(Element
const& element)
31 static_assert(dim == Element::mydimension,
"");
32 refElem_ = &RefElements::general(element.type());
34 ids_.resize(refElem_->size(dim));
35 for (
int i = 0; i < refElem_->size(dim); ++i)
36 ids_[i] = idSet_.subId(element, i, dim);
48 unsigned int get(Dune::LocalKey
const& localKey,
unsigned int size)
const 50 int subDim = dim - localKey.codim();
51 if (subDim == 1 && 1 < dim)
52 return id(localKey,0) < id(localKey,1) ? localKey.index() : size - localKey.index() - 1;
53 else if (subDim == 2 && 2 < dim) {
54 test_exit(size == 1,
"Bases with more then one DoF per subentity are not yet supported.");
55 return localKey.index();
58 return localKey.index();
62 IdType
const& id(Dune::LocalKey
const& localKey,
int ii)
const 64 return ids_[refElem_->subEntity(localKey.subEntity(), localKey.codim(), ii, dim)];
69 RefElement
const* refElem_ =
nullptr;
70 std::vector<IdType> ids_;
void bind(Element const &element)
Bind the twist to a codim-0 element. Calculates the global ids of all the element vertices...
Definition: Twist.hpp:29
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
Twist(IdSet const &idSet)
Constructor. Stores a reference to the passed idSet.
Definition: Twist.hpp:23
Permutate the dof indices w.r.t. a global entity orientation.
Definition: Twist.hpp:14
void test_exit(bool condition, std::string const &str, Args &&... args)
test for condition and in case of failure print message and exit
Definition: Output.hpp:163