Commit 57d16f50 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

removed some forward declarations from GlobalIdSet

parent bb558927
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <amdis/Output.hpp> #include <amdis/Output.hpp>
#include <amdis/common/Apply.hpp> #include <amdis/common/Apply.hpp>
#include <amdis/common/ConceptsBase.hpp>
#include <amdis/common/ForEach.hpp> #include <amdis/common/ForEach.hpp>
#include <amdis/common/TupleUtility.hpp> #include <amdis/common/TupleUtility.hpp>
#include <amdis/functions/Nodes.hpp> #include <amdis/functions/Nodes.hpp>
...@@ -23,15 +24,6 @@ namespace Dune ...@@ -23,15 +24,6 @@ namespace Dune
namespace Functions namespace Functions
{ {
// forward declarations... // forward declarations...
template <class RB, class TP>
class SubspaceBasis;
template <class MI, class IMS, class... SPB>
class CompositePreBasis;
template <class MI, class IMS, class SPB, std::size_t C>
class PowerPreBasis;
template <class GV, int k, class MI> template <class GV, int k, class MI>
class LagrangeDGPreBasis; class LagrangeDGPreBasis;
...@@ -44,7 +36,7 @@ namespace Dune ...@@ -44,7 +36,7 @@ namespace Dune
namespace AMDiS namespace AMDiS
{ {
// forward declaration // forward declaration
template <class PreBasis, class TP> template <class PreBasis, class TP, class = void>
class NodeIdSet; class NodeIdSet;
/// \brief Provide global ids for all DOFs in a global basis /// \brief Provide global ids for all DOFs in a global basis
...@@ -68,7 +60,7 @@ namespace AMDiS ...@@ -68,7 +60,7 @@ namespace AMDiS
* ``` * ```
* *
**/ **/
template <class GB> template <class GB, class = void>
class GlobalBasisIdSet class GlobalBasisIdSet
{ {
public: public:
...@@ -180,18 +172,19 @@ namespace AMDiS ...@@ -180,18 +172,19 @@ namespace AMDiS
}; };
template <class RB, class TP> // Specialization for SubspaceBasis
class GlobalBasisIdSet<Dune::Functions::SubspaceBasis<RB,TP>> template <class Basis>
: public GlobalBasisIdSet<RB> class GlobalBasisIdSet<Basis, void_t<typename Basis::RootBasis>>
: public GlobalBasisIdSet<typename Basis::RootBasis>
{ {
public: public:
GlobalBasisIdSet(Dune::Functions::SubspaceBasis<RB,TP> const& basis) GlobalBasisIdSet(Basis const& basis)
: GlobalBasisIdSet<RB>(basis.rootBasis()) : GlobalBasisIdSet<typename Basis::RootBasis>(basis.rootBasis())
{} {}
}; };
template <class PB, class TP> template <class PB, class TP, class>
class NodeIdSet class NodeIdSet
{ {
public: public:
...@@ -240,10 +233,10 @@ namespace AMDiS ...@@ -240,10 +233,10 @@ namespace AMDiS
} }
/// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis /// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis
// [[expects: node_ != nullptr]]
template <class Twist, class It> template <class Twist, class It>
It fillIn(Twist const& twist, It it, size_type shift = 0) const It fillIn(Twist const& twist, It it, size_type shift = 0) const
{ {
assert(node_ != nullptr);
const auto& gridIdSet = gridView_.grid().globalIdSet(); const auto& gridIdSet = gridView_.grid().globalIdSet();
for (size_type i = 0; i < size_ ; ++i, ++it) { for (size_type i = 0; i < size_ ; ++i, ++it) {
...@@ -271,11 +264,11 @@ namespace AMDiS ...@@ -271,11 +264,11 @@ namespace AMDiS
}; };
template <class MI, class IMS, class SPB, std::size_t C, class TP> // Specialization for PowerBasis
class NodeIdSet<Dune::Functions::PowerPreBasis<MI,IMS,SPB,C>, TP> template <class PreBasis, class TP>
class NodeIdSet<PreBasis, TP, void_t<typename PreBasis::SubPreBasis>>
{ {
public: public:
using PreBasis = Dune::Functions::PowerPreBasis<MI,IMS,SPB,C>;
using Node = Node_t<PreBasis,TP>; using Node = Node_t<PreBasis,TP>;
using GridView = typename PreBasis::GridView; using GridView = typename PreBasis::GridView;
using size_type = std::size_t; using size_type = std::size_t;
...@@ -284,7 +277,7 @@ namespace AMDiS ...@@ -284,7 +277,7 @@ namespace AMDiS
using SubPreBasis = typename PreBasis::SubPreBasis; using SubPreBasis = typename PreBasis::SubPreBasis;
using SubTreePath = decltype(Dune::TypeTree::push_back(std::declval<TP>(), std::size_t(0))); using SubTreePath = decltype(Dune::TypeTree::push_back(std::declval<TP>(), std::size_t(0)));
using SubNodeIdSet = NodeIdSet<SubPreBasis, SubTreePath>; using SubNodeIdSet = NodeIdSet<SubPreBasis, SubTreePath>;
static const std::size_t children = C; static const std::size_t children = Node::CHILDREN;
public: public:
NodeIdSet(GridView const& gridView) NodeIdSet(GridView const& gridView)
...@@ -312,10 +305,10 @@ namespace AMDiS ...@@ -312,10 +305,10 @@ namespace AMDiS
} }
/// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis /// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis
// [[expects: node_ != nullptr]]
template <class Twist, class It> template <class Twist, class It>
It fillIn(Twist const& twist, It it, size_type shift = 0) const It fillIn(Twist const& twist, It it, size_type shift = 0) const
{ {
assert(node_ != nullptr);
for (std::size_t child = 0; child < children; ++child) for (std::size_t child = 0; child < children; ++child)
{ {
size_type subTreeSize = subIds_.size(); size_type subTreeSize = subIds_.size();
...@@ -331,17 +324,17 @@ namespace AMDiS ...@@ -331,17 +324,17 @@ namespace AMDiS
}; };
template <class MI, class IMS, class... SPB, class TP> // Specialization for CompositePreBasis
class NodeIdSet<Dune::Functions::CompositePreBasis<MI,IMS,SPB...>, TP> template <class PreBasis, class TP>
class NodeIdSet<PreBasis, TP, void_t<typename PreBasis::SubPreBases>>
{ {
public: public:
using PreBasis = Dune::Functions::CompositePreBasis<MI,IMS,SPB...>;
using Node = Node_t<PreBasis,TP>; using Node = Node_t<PreBasis,TP>;
using GridView = typename PreBasis::GridView; using GridView = typename PreBasis::GridView;
using size_type = std::size_t; using size_type = std::size_t;
protected: protected:
static const std::size_t children = sizeof...(SPB); static const std::size_t children = Node::CHILDREN;
using ChildIndices = std::make_index_sequence<children>; using ChildIndices = std::make_index_sequence<children>;
// The I'th SubPreBasis // The I'th SubPreBasis
...@@ -389,10 +382,10 @@ namespace AMDiS ...@@ -389,10 +382,10 @@ namespace AMDiS
} }
/// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis /// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis
// [[expects: node_ != nullptr]]
template <class Twist, class It> template <class Twist, class It>
It fillIn(Twist const& twist, It it, size_type shift = 0) const It fillIn(Twist const& twist, It it, size_type shift = 0) const
{ {
assert(node_ != nullptr);
Tools::for_each(idsTuple_, [&](auto const& ids) Tools::for_each(idsTuple_, [&](auto const& ids)
{ {
size_type subTreeSize = ids.size(); size_type subTreeSize = ids.size();
...@@ -462,10 +455,10 @@ namespace AMDiS ...@@ -462,10 +455,10 @@ namespace AMDiS
} }
/// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis /// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis
// [[expects: node_ != nullptr]]
template <class Twist, class It> template <class Twist, class It>
It fillIn(Twist const& twist, It it, size_type shift = 0) const It fillIn(Twist const& twist, It it, size_type shift = 0) const
{ {
assert(node_ != nullptr);
for (int child = 0; child < dow; ++child) { for (int child = 0; child < dow; ++child) {
size_type subTreeSize = pq2NodeIdSet_.size(); size_type subTreeSize = pq2NodeIdSet_.size();
it = pq2NodeIdSet_.fillIn(twist, it, shift); it = pq2NodeIdSet_.fillIn(twist, it, shift);
...@@ -515,10 +508,10 @@ namespace AMDiS ...@@ -515,10 +508,10 @@ namespace AMDiS
} }
/// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis /// \brief Maps from subtree index set [0..size-1] to a globally unique id in global basis
// [[expects: node_ != nullptr]]
template <class Twist, class It> template <class Twist, class It>
It fillIn(Twist const& /*twist*/, It it, size_type shift = 0) const It fillIn(Twist const& /*twist*/, It it, size_type shift = 0) const
{ {
assert(node_ != nullptr);
const auto& gridIdSet = gridView_.grid().globalIdSet(); const auto& gridIdSet = gridView_.grid().globalIdSet();
auto elementId = gridIdSet.id(node_->element()); auto elementId = gridIdSet.id(node_->element());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment