Skip to content
Snippets Groups Projects
Commit 08aa8ee5 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Merge branch 'feature/amg' into 'develop'

Plug PETSc's AMG preconditioner

See merge request !57
parents e23149c9 78eb2388
Branches
Tags
1 merge request!57Plug PETSc's AMG preconditioner
...@@ -88,6 +88,7 @@ struct LinearSolver::Internals ...@@ -88,6 +88,7 @@ struct LinearSolver::Internals
{ {
switch (precond) { switch (precond) {
case LSPrecond::none: case LSPrecond::none:
case LSPrecond::amg:
case LSPrecond::diagonal: case LSPrecond::diagonal:
case LSPrecond::incomplete_choleski: case LSPrecond::incomplete_choleski:
case LSPrecond::incomplete_LU: { case LSPrecond::incomplete_LU: {
...@@ -244,6 +245,10 @@ struct LinearSolver::Internals ...@@ -244,6 +245,10 @@ struct LinearSolver::Internals
if (not direct_solver) { if (not direct_solver) {
switch (options.precond()) { switch (options.precond()) {
case LSPrecond::amg: {
PCSetType(pc, PCGAMG);
break;
}
case LSPrecond::diagonal: { case LSPrecond::diagonal: {
PCSetType(pc, PCJACOBI); PCSetType(pc, PCJACOBI);
break; break;
......
...@@ -37,6 +37,7 @@ enum class LSPrecond : int8_t ...@@ -37,6 +37,7 @@ enum class LSPrecond : int8_t
diagonal, diagonal,
incomplete_choleski, incomplete_choleski,
incomplete_LU, incomplete_LU,
amg,
// //
LS__end LS__end
}; };
...@@ -101,6 +102,9 @@ name(const LSPrecond precond) ...@@ -101,6 +102,9 @@ name(const LSPrecond precond)
case LSPrecond::incomplete_LU: { case LSPrecond::incomplete_LU: {
return "ILU"; return "ILU";
} }
case LSPrecond::amg: {
return "AMG";
}
case LSPrecond::LS__end: { case LSPrecond::LS__end: {
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment