Skip to content
Snippets Groups Projects
Commit a5cf9a71 authored by Porrmann, Maik's avatar Porrmann, Maik
Browse files

hold directions as matrix

parent 1a4c24bf
No related branches found
No related tags found
No related merge requests found
......@@ -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(); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment