Skip to content

Commit

Permalink
corrections to the solver settings
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoRossi committed Sep 5, 2017
1 parent a9eb953 commit 6615d27
Showing 1 changed file with 66 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AmgclMPISchurComplementSolver : public LinearSolver< TSparseSpaceType,
},
"pressure_block_preconditioner" :
{
"krylov_type" : "lgmres",
"krylov_type" : "fgmres",
"tolerance" : 1e-2,
"preconditioner_type" : "spai0",
"max_iteration": 20
Expand Down Expand Up @@ -123,6 +123,35 @@ class AmgclMPISchurComplementSolver : public LinearSolver< TSparseSpaceType,
}

mCoarseEnough = rParameters["coarse_enough"].GetInt();

// {
// "solver": {
// "type" : "fgmres",
// "M": 50
// },
// "precond": {
// "usolver": {
// "solver": {
// "type" : "gmres",
// "tol": 0.001,
// "maxiter": 5
// }
// },
// "psolver": {
// "solver": {
// "type" : "gmres",
// "tol": 0.01,
// "maxiter": 20
// },
// "precond" : {
// "isolver" : {
// "type" : "gmres",
// "maxiter" : 2
// }
// }
// }
// }
// }

mTolerance = rParameters["tolerance"].GetDouble();
mMaxIterations = rParameters["max_iteration"].GetInt();
Expand Down Expand Up @@ -185,13 +214,33 @@ class AmgclMPISchurComplementSolver : public LinearSolver< TSparseSpaceType,

typedef amgcl::backend::builtin<double> Backend;

typedef amgcl::mpi::make_solver<
amgcl::mpi::schur_pressure_correction<
amgcl::mpi::make_solver<
amgcl::mpi::block_preconditioner<
amgcl::runtime::relaxation::as_preconditioner<Backend>
>,
amgcl::runtime::iterative_solver
>,
amgcl::mpi::make_solver<
amgcl::mpi::subdomain_deflation<
amgcl::runtime::amg<Backend>,
amgcl::runtime::iterative_solver,
amgcl::runtime::mpi::direct_solver<double>
>,
amgcl::runtime::iterative_solver
>
>,
amgcl::runtime::iterative_solver
> SDD;

// typedef amgcl::mpi::make_solver<
// amgcl::mpi::schur_pressure_correction<
// amgcl::mpi::make_solver<
// amgcl::mpi::block_preconditioner<
// amgcl::runtime::relaxation::as_preconditioner<Backend>
// >,
// amgcl::runtime::iterative_solver
// amgcl::solver::bicgstab
// >,
// amgcl::mpi::make_solver<
// amgcl::mpi::subdomain_deflation<
Expand All @@ -204,46 +253,26 @@ class AmgclMPISchurComplementSolver : public LinearSolver< TSparseSpaceType,
// >,
// amgcl::runtime::iterative_solver
// > SDD;

// typedef amgcl::mpi::make_solver<
// amgcl::mpi::schur_pressure_correction<
// amgcl::mpi::make_solver<
// amgcl::mpi::block_preconditioner<
// amgcl::runtime::relaxation::as_preconditioner<Backend>
// typedef amgcl::mpi::make_solver<
// amgcl::mpi::schur_pressure_correction<
// amgcl::mpi::make_solver<
// amgcl::mpi::block_preconditioner<
// amgcl::runtime::relaxation::as_preconditioner<Backend>
// >,
// amgcl::solver::bicgstab
// amgcl::solver::gmres //amgcl::solver::bicgstab
// >,
// amgcl::mpi::make_solver<
// amgcl::mpi::subdomain_deflation<
// amgcl::runtime::amg<Backend>,
// amgcl::runtime::iterative_solver,
// amgcl::runtime::mpi::direct_solver<double>
// amgcl::mpi::make_solver<
// amgcl::mpi::subdomain_deflation<
// amgcl::runtime::amg<Backend>,
// amgcl::solver::gmres, //amgcl::solver::bicgstab,
// amgcl::mpi::skyline_lu<double>
// >,
// amgcl::runtime::iterative_solver
// amgcl::solver::fgmres
// >
// >,
// amgcl::runtime::iterative_solver
// > SDD;

typedef amgcl::mpi::make_solver<
amgcl::mpi::schur_pressure_correction<
amgcl::mpi::make_solver<
amgcl::mpi::block_preconditioner<
amgcl::runtime::relaxation::as_preconditioner<Backend>
>,
amgcl::runtime::iterative_solver //amgcl::solver::bicgstab
>,
amgcl::mpi::make_solver<
amgcl::mpi::subdomain_deflation<
amgcl::runtime::amg<Backend>,
amgcl::runtime::iterative_solver, //amgcl::solver::bicgstab,
amgcl::mpi::skyline_lu<double>
>,
amgcl::solver::fgmres
>
>,
amgcl::solver::fgmres
> SDD;
// amgcl::solver::fgmres
// > SDD;

boost::function<double(ptrdiff_t,unsigned)> dv = amgcl::mpi::constant_deflation(1);
mprm.put("precond.psolver.precond.num_def_vec", 1);
Expand Down

0 comments on commit 6615d27

Please sign in to comment.