diff --git a/dune/functions/functionspacebases/argyrisbasis.hh b/dune/functions/functionspacebases/argyrisbasis.hh index 9242e666cde7516a0d6f6c2e57ed0df0bff4a825..6b115e6ec5dd78db0aa31ea61ebf6a972b658e1b 100644 --- a/dune/functions/functionspacebases/argyrisbasis.hh +++ b/dune/functions/functionspacebases/argyrisbasis.hh @@ -35,28 +35,34 @@ namespace Dune class ElementInformation { using GlobalCoordinate = typename Element::Geometry::GlobalCoordinate; - + using ctype = typename Element::Geometry::ctype; + static constexpr int dim = Element::Geometry::coorddimension; + static_assert(dim == 2); + static_assert(std::is_same<GlobalCoordinate, FieldVector<ctype, dim>>:: + value); // not sure my code works for other types of global coordinates public: ElementInformation() : ElementInformation((unsigned short)0){}; ElementInformation(std::bitset<3> orientationBitset) { - for (std::size_t i = 0; i < 3; ++i) + for (std::size_t i = 0; i < dim + 1; ++i) { edgeOrientation_[i] = orientationBitset[i] ? -1. : 1.; // default directions are global coordinates - derivativeDirections[i][0] = GlobalCoordinate{1., 0.}; - derivativeDirections[i][1] = GlobalCoordinate{0., 1.}; + derivativeDirections[i] = 0; + for (std::size_t j = 0; j < dim; ++j) + derivativeDirections[i][j][j] = 1.; } } - std::array<R, 3> const &getEdgeOrientation() const { return edgeOrientation_; } - std::array<std::array<GlobalCoordinate, 2>, 3> getDerivativeDirections() const + std::array<R, dim + 1> const &getEdgeOrientation() const { return edgeOrientation_; } + std::array<FieldMatrix<ctype, dim, dim>, dim + 1> getDerivativeDirections() const { return derivativeDirections; } private: - std::array<R, 3> edgeOrientation_; - std::array<std::array<GlobalCoordinate, 2>, 3> derivativeDirections; + std::array<R, dim + 1> edgeOrientation_; + // For every corner of Element, dim directions as rows(!) of a fieldmatrix + std::array<FieldMatrix<ctype, dim, dim>, dim + 1> derivativeDirections; }; ArgyrisTransformator() : mat_(21, 21, BCRSMatrix<R>::random) { setupMatrix(); }