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

simplify TreeContainer in DataTransfer

parent c1f9ea46
...@@ -94,7 +94,7 @@ namespace AMDiS ...@@ -94,7 +94,7 @@ namespace AMDiS
template <class Node> template <class Node>
using NodeElementData = typename NodeDataTransfer<Node, Container, Basis>::NodeElementData; using NodeElementData = typename NodeDataTransfer<Node, Container, Basis>::NodeElementData;
using ElementData = TYPEOF(makeTreeContainer<NodeElementData>(std::declval<const Tree&>())); using ElementData = TreeContainer<NodeElementData,Tree,true>;
using Interface = DataTransferInterface<Container>; using Interface = DataTransferInterface<Container>;
...@@ -138,7 +138,7 @@ namespace AMDiS ...@@ -138,7 +138,7 @@ namespace AMDiS
/// Data transfer on a single basis node /// Data transfer on a single basis node
template <class Node> template <class Node>
using NDT = NodeDataTransfer<Node, Container, Basis>; using NDT = NodeDataTransfer<Node, Container, Basis>;
using NodeDataTransferContainer = TYPEOF(makeTreeContainer<NDT>(std::declval<const Tree&>())); using NodeDataTransferContainer = TreeContainer<NDT,Tree,true>;
NodeDataTransferContainer nodeDataTransfer_; NodeDataTransferContainer nodeDataTransfer_;
}; };
......
...@@ -46,7 +46,7 @@ template <class C, class B> ...@@ -46,7 +46,7 @@ template <class C, class B>
DataTransfer<C,B>::DataTransfer(std::shared_ptr<B const> basis) DataTransfer<C,B>::DataTransfer(std::shared_ptr<B const> basis)
: basis_(std::move(basis)) : basis_(std::move(basis))
, mapper_(basis_->gridView().grid(), Dune::mcmgElementLayout()) , mapper_(basis_->gridView().grid(), Dune::mcmgElementLayout())
, nodeDataTransfer_(makeTreeContainer<NDT>(basis_->localView().tree())) , nodeDataTransfer_()
{} {}
...@@ -66,7 +66,7 @@ preAdapt(C const& coeff, bool mightCoarsen) ...@@ -66,7 +66,7 @@ preAdapt(C const& coeff, bool mightCoarsen)
persistentContainer_.clear(); // Redundant if postAdapt was correctly called last cycle persistentContainer_.clear(); // Redundant if postAdapt was correctly called last cycle
for (const auto& e : elements(gv)) for (const auto& e : elements(gv))
{ {
auto it = persistentContainer_.emplace(idSet.id(e), makeTreeContainer<NodeElementData>(lv.tree())); auto it = persistentContainer_.emplace(idSet.id(e), makeTreeContainer<NodeElementData,true>(lv.tree()));
lv.bind(e); lv.bind(e);
auto& treeContainer = it.first->second; auto& treeContainer = it.first->second;
...@@ -88,7 +88,7 @@ preAdapt(C const& coeff, bool mightCoarsen) ...@@ -88,7 +88,7 @@ preAdapt(C const& coeff, bool mightCoarsen)
while (father.mightVanish() && father.hasFather()) while (father.mightVanish() && father.hasFather())
{ {
father = father.father(); father = father.father();
auto it = persistentContainer_.emplace(idSet.id(father), makeTreeContainer<NodeElementData>(lv.tree())); auto it = persistentContainer_.emplace(idSet.id(father), makeTreeContainer<NodeElementData,true>(lv.tree()));
if (!it.second) if (!it.second)
continue; continue;
......
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