Skip to content
Snippets Groups Projects
Commit 1e30e207 authored by Christian Engwer's avatar Christian Engwer
Browse files

[amg] allocate coarse grid solver using a rebound vector allocator

this is necessary to ensure that the solver fulfills the alignement
requirements of the vector
parent 24e5fd17
No related branches found
No related tags found
1 merge request!87[multirhstest] Check with AlignedNumber.
......@@ -512,15 +512,32 @@ namespace Dune
{
if(matrices_->matrices().coarsest().getRedistributed().getmat().N()>0)
// We are still participating on this level
// we have to allocate these types using the rebound allocator
// in order to ensure that we fulfill the alignement requirements
#warning alignment
solver_.reset(new BiCGSTABSolver<X>(const_cast<M&>(matrices_->matrices().coarsest().getRedistributed()),
*scalarProduct_,
*coarseSmoother_, 1E-2, 1000, 0));
else
solver_.reset();
}else
solver_.reset(new BiCGSTABSolver<X>(const_cast<M&>(*matrices_->matrices().coarsest()),
*scalarProduct_,
*coarseSmoother_, 1E-2, 1000, 0));
{
// we have to allocate these types using the rebound allocator
// in order to ensure that we fulfill the alignement requirements
using Alloc = typename A::template rebind<BiCGSTABSolver<X>>::other;
Alloc alloc;
auto p = alloc.allocate(1);
alloc.construct(p,
const_cast<M&>(*matrices_->matrices().coarsest()),
*scalarProduct_,
*coarseSmoother_, 1E-2, 1000, 0);
solver_.reset(p,[](BiCGSTABSolver<X>* p){
Alloc alloc;
alloc.destroy(p);
alloc.deallocate(p,1);
});
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment