Commit c1f0b965 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Put TreeContainer in a separate namespace TypeTree and rename makeTreeContainer into treeContainer

parent 29c3c685
......@@ -94,7 +94,7 @@ namespace AMDiS
template <class Node>
using NodeElementData = typename NodeDataTransfer<Node, Container, Basis>::NodeElementData;
using ElementData = TreeContainer<NodeElementData,Tree,true>;
using ElementData = TypeTree::TreeContainer<NodeElementData,Tree,true>;
using Interface = DataTransferInterface<Container>;
......@@ -138,7 +138,7 @@ namespace AMDiS
/// Data transfer on a single basis node
template <class Node>
using NDT = NodeDataTransfer<Node, Container, Basis>;
using NodeDataTransferContainer = TreeContainer<NDT,Tree,true>;
using NodeDataTransferContainer = TypeTree::TreeContainer<NDT,Tree,true>;
NodeDataTransferContainer nodeDataTransfer_;
};
......
......@@ -66,7 +66,7 @@ preAdapt(C const& coeff, bool mightCoarsen)
persistentContainer_.clear(); // Redundant if postAdapt was correctly called last cycle
for (const auto& e : elements(gv))
{
auto it = persistentContainer_.emplace(idSet.id(e), makeTreeContainer<NodeElementData,true>(lv.tree()));
auto it = persistentContainer_.emplace(idSet.id(e), TypeTree::treeContainer<NodeElementData,true>(lv.tree()));
lv.bind(e);
auto& treeContainer = it.first->second;
......@@ -88,7 +88,7 @@ preAdapt(C const& coeff, bool mightCoarsen)
while (father.mightVanish() && father.hasFather())
{
father = father.father();
auto it = persistentContainer_.emplace(idSet.id(father), makeTreeContainer<NodeElementData,true>(lv.tree()));
auto it = persistentContainer_.emplace(idSet.id(father), TypeTree::treeContainer<NodeElementData,true>(lv.tree()));
if (!it.second)
continue;
......
......@@ -141,14 +141,14 @@ namespace AMDiS
template <class RowBasis, class ColBasis, class ElementMatrix>
using MatrixOperators
= TreeMatrix<
= TypeTree::TreeMatrix<
OperatorLists<typename RowBasis::GridView,ElementMatrix>::template MatData,
typename RowBasis::LocalView::TreeCache,
typename ColBasis::LocalView::TreeCache>;
template <class Basis, class ElementVector>
using VectorOperators
= TreeContainer<
= TypeTree::TreeContainer<
OperatorLists<typename Basis::GridView,ElementVector>::template VecData,
typename Basis::LocalView::TreeCache>;
......
......@@ -6,6 +6,6 @@ install(FILES
Traits.hpp
Traversal.hpp
TreeContainer.hpp
TreeContainerTransformation.hpp
TreeContainerTrafo.hpp
TreePath.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis/typetree)
This diff is collapsed.
#pragma once
#include <amdis/common/RecursiveForEach.hpp>
#include <amdis/common/RecursiveMap.hpp>
#include <amdis/typetree/TreeContainer.hpp>
namespace AMDiS {
namespace Recursive {
// specializations of recursive utilities for TreeContainer entries
template <class Value>
struct Apply<TypeTree::LeafNodeStorage<Value>>
{
template <class F, class VC>
static auto impl(F&& f, VC const& vc)
{
return TypeTree::LeafNodeStorage{
Recursive::apply(f,vc.value())};
}
};
template <class Value, class Container>
struct Apply<TypeTree::InnerNodeStorage<Value,Container>>
{
template <class F, class VC>
static auto impl(F&& f, VC const& vc)
{
return TypeTree::InnerNodeStorage{
Recursive::apply(f,vc.value()),
Recursive::apply(f,vc.container())};
}
};
template <class Container>
struct Apply<TypeTree::TreeContainerStorage<Container>>
{
template <class F, class TC>
static auto impl(F&& f, TC const& c)
{
return TypeTree::TreeContainerStorage{Recursive::apply(f,c.data())};
}
};
// -------------------------------------------------------------------------
template <class Value>
struct ForEach<TypeTree::LeafNodeStorage<Value>>
{
template <class VC, class F>
static void impl(VC&& vc, F&& f)
{
Recursive::forEach(vc.value(),f);
}
};
template <class Value, class Container>
struct ForEach<TypeTree::InnerNodeStorage<Value,Container>>
{
template <class VC, class F>
static void impl(VC&& vc, F&& f)
{
Recursive::forEach(vc.value(),f);
Recursive::forEach(vc.container(),f);
}
};
template <class Container>
struct ForEach<TypeTree::TreeContainerStorage<Container>>
{
template <class F, class TC>
static void impl(TC&& c, F&& f)
{
Recursive::forEach(c.data(),f);
}
};
}} // end namespace AMDiS::Recursive
#pragma once
#include <amdis/common/RecursiveForEach.hpp>
#include <amdis/common/RecursiveMap.hpp>
#include <amdis/typetree/TreeContainer.hpp>
namespace AMDiS
{
namespace Recursive
{
// specializations of recursive utilities for TreeContainer entries
template <>
struct Apply<Impl::Ignore>
{
template <class F>
static auto impl(F&& /*f*/, Impl::Ignore)
{
return Impl::Ignore{};
}
};
template <class Value, class Container>
struct Apply<Impl::ValueAndContainer<Value,Container>>
{
template <class F, class VC>
static auto impl(F&& f, VC const& vc)
{
return Impl::ValueAndContainer{
Recursive::apply(f,vc.value()),
Recursive::apply(f,vc.container())};
}
};
template <class Value>
struct Apply<Impl::ValueAndContainer<Value,void>>
{
template <class F, class VC>
static auto impl(F&& f, VC const& vc)
{
return Impl::ValueAndContainer{Recursive::apply(f,vc.value())};
}
};
template <class Container>
struct Apply<TreeContainerStorage<Container>>
{
template <class F, class TC>
static auto impl(F&& f, TC const& c)
{
return TreeContainerStorage{Recursive::apply(f,c.data())};
}
};
// -------------------------------------------------------------------------
template <>
struct ForEach<Impl::Ignore>
{
template <class F>
static void impl(Impl::Ignore, F&& /*f*/) {}
};
template <class Value, class Container>
struct ForEach<Impl::ValueAndContainer<Value,Container>>
{
template <class VC, class F>
static void impl(VC&& vc, F&& f)
{
Recursive::forEach(vc.value(),f);
Recursive::forEach(vc.container(),f);
}
};
template <class Value>
struct ForEach<Impl::ValueAndContainer<Value,void>>
{
template <class VC, class F>
static void impl(VC&& vc, F&& f)
{
Recursive::forEach(vc.value(),f);
}
};
template <class Container>
struct ForEach<TreeContainerStorage<Container>>
{
template <class F, class TC>
static void impl(TC&& c, F&& f)
{
Recursive::forEach(c.data(),f);
}
};
} // end namespace Tools
} // end namespace AMDiS
......@@ -25,7 +25,7 @@ int main(int argc, char** argv)
auto localView = basis1.localView();
auto container = makeTreeContainer<double>(localView.tree());
auto container2 = makeTreeContainer(localView.tree(),
[&](auto const& node) { return makeTreeContainer<double>(localView.tree()); });
auto container = TypeTree::treeContainer<double>(localView.tree());
auto container2 = TypeTree::treeContainer(localView.tree(),
[&](auto const& node) { return TypeTree::treeContainer<double>(localView.tree()); });
}
......@@ -31,9 +31,9 @@ int main (int argc, char** argv)
auto localView = basis.localView();
auto const& tree = localView.tree();
auto c1 = makeTreeContainer<double>(tree);
auto c2 = makeTreeContainer<decltype(c1)>(tree);
auto c3 = makeTreeContainer(tree, [&](auto const&) { return makeTreeContainer<double>(tree); });
auto c1 = TypeTree::treeContainer<double>(tree);
auto c2 = TypeTree::treeContainer<decltype(c1)>(tree);
auto c3 = TypeTree::treeContainer(tree, [&](auto const&) { return TypeTree::treeContainer<double>(tree); });
// fill 1d treeContainer with data
for_each_leaf_node(tree, [&](auto const& node, auto tp) {
......
Markdown is supported
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