Commit 0af0782e authored by Lukas Renelt's avatar Lukas Renelt

[vectorclass][test] change preconditioner to AMG

parent e2f347f2
Pipeline #10144 passed with stage
in 7 minutes and 5 seconds
......@@ -9,7 +9,7 @@ int main(int argc, char ** argv)
{
runInformation times;
times = runJacobiCGTest<Dune::LoopSIMD<double, LANES>>(RUNS);
times = runAMGCGTest<Dune::LoopSIMD<double, LANES>>(RUNS);
printRunInformation(times);
......
......@@ -6,7 +6,7 @@ int main(int argc, char ** argv)
{
runInformation times;
times = runJacobiCGTest<double>(RUNS);
times = runAMGCGTest<double>(RUNS);
printRunInformation(times);
......
......@@ -8,7 +8,7 @@ int main(int argc, char ** argv)
{
runInformation times;
times = runJacobiCGTest< TYPE >(RUNS);
times = runAMGCGTest< TYPE >(RUNS);
printRunInformation(times);
......
......@@ -20,7 +20,7 @@ struct runInformation {
};
template<class T>
runInformation runJacobiCGTest(unsigned int Runs) {
runInformation runAMGCGTest(unsigned int Runs) {
runInformation out;
out.className = Dune::className<T>();
......@@ -45,13 +45,35 @@ runInformation runJacobiCGTest(unsigned int Runs) {
typedef Dune::MatrixAdapter<Matrix,Vector,Vector> Operator;
Operator op(A); // make linear operator from A
Dune::SeqJac<Matrix,Vector,Vector> jac(A,1,0.1);
// AMG
typedef Dune::Amg::RowSum Norm;
typedef Dune::Amg::CoarsenCriterion<Dune::Amg::UnSymmetricCriterion<Matrix,Norm> >
Criterion;
typedef Dune::SeqSSOR<Matrix,Vector,Vector> Smoother;
typedef typename Dune::Amg::SmootherTraits<Smoother>::Arguments SmootherArgs;
SmootherArgs smootherArgs;
smootherArgs.iterations = 1;
smootherArgs.relaxationFactor = 1;
unsigned int coarsenTarget = 1000;
unsigned int maxLevel = 10;
Criterion criterion(15,coarsenTarget);
criterion.setDefaultValuesIsotropic(2);
criterion.setAlpha(.67);
criterion.setBeta(1.0e-4);
criterion.setMaxLevel(maxLevel);
criterion.setSkipIsolated(false);
criterion.setNoPreSmoothSteps(1);
criterion.setNoPostSmoothSteps(1);
Dune::SeqScalarProduct<Vector> sp;
typedef Dune::Amg::AMG<Operator,Vector,Smoother,Dune::Amg::SequentialInformation> AMG;
Smoother smoother(A,1,1);
AMG amg(op, criterion, smootherArgs);
//CG-Solver
using VectorType = decltype(detectVectorType(op));
double reduction = 1e-1;
int verb = 1;
Dune::CGSolver<VectorType> cg(op,jac,reduction,8000,verb);
Dune::CGSolver<VectorType> cg(op,amg,reduction,8000,verb);
std::vector<double> measuredTime = run_test("Jacobi","CG",op,cg,N,Runs);
out.timestamps = measuredTime;
......
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