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

typedef orientation type

parent 591ea295
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,8 @@ namespace Dune
using MBasisFactory = MonomialBasisProvider<dim, D>;
// Number of edges of the reference simplex(triangle)
constexpr static std::size_t numberOfEdges = 3;
// TODO test with int or short
using OrientationType = double;
public:
static constexpr unsigned int coeffSize = 21;
......@@ -60,7 +62,7 @@ namespace Dune
*/
ArgyrisLocalBasis()
: Base(*MBasisFactory::template create<GeometryTypes::simplex(dim)>(
5)) // Use monomials up to order 5!
5)) // Use monomials up to order 5!
{
assert(coeffSize == this->basis().size());
this->fill(PolynomialBasisCoefficients::getArgyrisCoefficients<double>());
......@@ -124,11 +126,14 @@ namespace Dune
for (std::size_t i = 0; i < numberOfEdges; i++)
out[18 + i] *= edgeOrientation_[i];
}
std::array<R, numberOfEdges> const &edgeOrientation() const { return edgeOrientation_; }
std::array<OrientationType, numberOfEdges> const &edgeOrientation() const
{
return edgeOrientation_;
}
private:
// Orientations of the simplex edges
std::array<R, numberOfEdges> edgeOrientation_;
std::array<OrientationType, numberOfEdges> edgeOrientation_;
};
/** \brief Associations of the Argyris degrees of freedom to
......
......@@ -47,6 +47,8 @@ namespace Dune
using MBasisFactory = MonomialBasisProvider<2, D>;
// Number of edges of the reference simplex(triangle)
constexpr static std::size_t numberOfEdges = 3;
// TODO test with int or short
using OrientationType = double;
public:
static constexpr unsigned int coeffSize = 6;
......@@ -67,8 +69,7 @@ namespace Dune
/**
* \brief Constructor with given edge orientation
*/
MorleyLocalBasis(std::bitset<numberOfEdges> edgeOrientation)
: MorleyLocalBasis()
MorleyLocalBasis(std::bitset<numberOfEdges> edgeOrientation) : MorleyLocalBasis()
{
for (std::size_t i = 0; i < edgeOrientation_.size(); i++)
edgeOrientation_[i] = edgeOrientation[i] ? -1.0 : 1.0;
......@@ -93,8 +94,9 @@ namespace Dune
void evaluateFunction(const typename Traits::DomainType &in,
std::vector<typename Traits::RangeType> &out) const
{
// First we evaluate the basis with default edge orientation, then we adapt the result accordingly
// This works because the edge orientation only changes the "wrong" derivative nodes which are multiplied by -1, and the very same happens to the nodal basis
// First we evaluate the basis with default edge orientation, then we adapt the result
// accordingly This works because the edge orientation only changes the "wrong" derivative
// nodes which are multiplied by -1, and the very same happens to the nodal basis
out.resize(size());
Base::evaluateFunction(in, out);
for (std::size_t i = 0; i < numberOfEdges; i++)
......@@ -130,11 +132,14 @@ namespace Dune
for (std::size_t i = 0; i < numberOfEdges; i++)
out[3 + i] *= edgeOrientation_[i];
}
std::array<R, numberOfEdges> const &edgeOrientation() const { return edgeOrientation_; }
std::array<OrientationType, numberOfEdges> const &edgeOrientation() const
{
return edgeOrientation_;
}
private:
// Orientations of the simplex edges
std::array<R, numberOfEdges> edgeOrientation_;
std::array<OrientationType, numberOfEdges> edgeOrientation_;
};
/** \brief Associations of the Morley degrees of freedom to subentities of the
......
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