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 ...@@ -49,6 +49,8 @@ namespace Dune
using MBasisFactory = MonomialBasisProvider<dim, D>; using MBasisFactory = MonomialBasisProvider<dim, D>;
// Number of edges of the reference simplex(triangle) // Number of edges of the reference simplex(triangle)
constexpr static std::size_t numberOfEdges = 3; constexpr static std::size_t numberOfEdges = 3;
// TODO test with int or short
using OrientationType = double;
public: public:
static constexpr unsigned int coeffSize = 21; static constexpr unsigned int coeffSize = 21;
...@@ -60,7 +62,7 @@ namespace Dune ...@@ -60,7 +62,7 @@ namespace Dune
*/ */
ArgyrisLocalBasis() ArgyrisLocalBasis()
: Base(*MBasisFactory::template create<GeometryTypes::simplex(dim)>( : 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()); assert(coeffSize == this->basis().size());
this->fill(PolynomialBasisCoefficients::getArgyrisCoefficients<double>()); this->fill(PolynomialBasisCoefficients::getArgyrisCoefficients<double>());
...@@ -124,11 +126,14 @@ namespace Dune ...@@ -124,11 +126,14 @@ namespace Dune
for (std::size_t i = 0; i < numberOfEdges; i++) for (std::size_t i = 0; i < numberOfEdges; i++)
out[18 + i] *= edgeOrientation_[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: private:
// Orientations of the simplex edges // Orientations of the simplex edges
std::array<R, numberOfEdges> edgeOrientation_; std::array<OrientationType, numberOfEdges> edgeOrientation_;
}; };
/** \brief Associations of the Argyris degrees of freedom to /** \brief Associations of the Argyris degrees of freedom to
......
...@@ -47,6 +47,8 @@ namespace Dune ...@@ -47,6 +47,8 @@ namespace Dune
using MBasisFactory = MonomialBasisProvider<2, D>; using MBasisFactory = MonomialBasisProvider<2, D>;
// Number of edges of the reference simplex(triangle) // Number of edges of the reference simplex(triangle)
constexpr static std::size_t numberOfEdges = 3; constexpr static std::size_t numberOfEdges = 3;
// TODO test with int or short
using OrientationType = double;
public: public:
static constexpr unsigned int coeffSize = 6; static constexpr unsigned int coeffSize = 6;
...@@ -67,8 +69,7 @@ namespace Dune ...@@ -67,8 +69,7 @@ namespace Dune
/** /**
* \brief Constructor with given edge orientation * \brief Constructor with given edge orientation
*/ */
MorleyLocalBasis(std::bitset<numberOfEdges> edgeOrientation) MorleyLocalBasis(std::bitset<numberOfEdges> edgeOrientation) : MorleyLocalBasis()
: MorleyLocalBasis()
{ {
for (std::size_t i = 0; i < edgeOrientation_.size(); i++) for (std::size_t i = 0; i < edgeOrientation_.size(); i++)
edgeOrientation_[i] = edgeOrientation[i] ? -1.0 : 1.0; edgeOrientation_[i] = edgeOrientation[i] ? -1.0 : 1.0;
...@@ -93,8 +94,9 @@ namespace Dune ...@@ -93,8 +94,9 @@ namespace Dune
void evaluateFunction(const typename Traits::DomainType &in, void evaluateFunction(const typename Traits::DomainType &in,
std::vector<typename Traits::RangeType> &out) const std::vector<typename Traits::RangeType> &out) const
{ {
// First we evaluate the basis with default edge orientation, then we adapt the result accordingly // First we evaluate the basis with default edge orientation, then we adapt the result
// 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 // 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()); out.resize(size());
Base::evaluateFunction(in, out); Base::evaluateFunction(in, out);
for (std::size_t i = 0; i < numberOfEdges; i++) for (std::size_t i = 0; i < numberOfEdges; i++)
...@@ -130,11 +132,14 @@ namespace Dune ...@@ -130,11 +132,14 @@ namespace Dune
for (std::size_t i = 0; i < numberOfEdges; i++) for (std::size_t i = 0; i < numberOfEdges; i++)
out[3 + i] *= edgeOrientation_[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: private:
// Orientations of the simplex edges // 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 /** \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