Skip to content

Gmg preconditioner#15

Merged
tjhei merged 4 commits into
tjhei:mainfrom
quangx:gmg_preconditioner
Oct 24, 2025
Merged

Gmg preconditioner#15
tjhei merged 4 commits into
tjhei:mainfrom
quangx:gmg_preconditioner

Conversation

@tjhei
Copy link
Copy Markdown
Owner

@tjhei tjhei commented Sep 13, 2025

Pull Request Checklist. Please read and check each box with an X. Delete any part not applicable. Ask on the forum if you need help with any step.

Describe what you did in this PR and why you did it.

Before your first pull request:

For all pull requests:

For new features/models or changes of existing features:

  • I have tested my new feature locally to ensure it is correct.
  • I have created a testcase for the new feature/benchmark in the tests/ directory.
  • I have added a changelog entry in the doc/modules/changes directory that will inform other users of my change.

Comment thread source/simulator/solver.cc Outdated
*/
template <class PreconditionerA>
template <class PreconditionerA, class VectorType, class StokesMatrixType>
class InverseVelocityBlock
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only exists in solver.cc and won't be visible to GMG unless you move it to the header...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a first PR would only make this change and introduce the template arguments.

Comment thread source/simulator/solver.cc Outdated
*Implements the vmult for InverseVelocityBlock.
*/
template <class PreconditionerA, class VectorType, class StokesMatrixType>
void InverseVelocityBlock<PreconditionerA,VectorType,StokesMatrixType>::vmult(VectorType &dst,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also needs to be in the header

* @param A_block_tolerance The tolerance for the CG solver which computes
* the inverse of the A block.
*/
InverseVelocityBlock(const StokesMatrixType &matrix,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name StokesMatrixType is misleading. Shouldn't it be ABlockType, VelocityBlockType or AMatrixType or something?

* @param do_solve_A A flag indicating whether we should actually solve with
* the matrix $A$, or only apply one preconditioner step with it.
* @param A_block_is_symmetric A flag indicating whether the matrix $A$ is symmetric.
* @param A_block_tolerance The tolerance for the CG solver which computes
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you will need to fix these comments

@tjhei
Copy link
Copy Markdown
Owner Author

tjhei commented Sep 21, 2025

Missing include:
�[K/home/runner/work/aspect/aspect/include/aspect/simulator/solver/block_stokes_preconditioner.h:118:19:�[m�[K �[Kerror: �[m�[K‘�[KSolverBicgstab�[m�[K’ was not declared in this scope

@tjhei
Copy link
Copy Markdown
Owner Author

tjhei commented Oct 9, 2025

you need to update test output:

diff --git a/tests/stokes_solver_fail/screen-output b/tests/stokes_solver_fail/screen-output
index 8a89c33..d672755 100644
--- a/tests/stokes_solver_fail/screen-output
+++ b/tests/stokes_solver_fail/screen-output
@@ -30,7 +30,9 @@ Additional information:
     void dealii::SolverFGMRES<VectorType>::solve(const MatrixType&,
     VectorType&, const VectorType&, const PreconditionerType&) [with
     MatrixType = aspect::internal::StokesBlock; PreconditionerType =
-    aspect::internal::BlockSchurPreconditioner<aspect::internal::InverseVelocityBlock<dealii::TrilinosWrappers::PreconditionAMG>,
+    aspect::internal::BlockSchurPreconditioner<aspect::internal::InverseVelocityBlock<dealii::TrilinosWrappers::PreconditionAMG,
+    dealii::TrilinosWrappers::MPI::Vector,
+    dealii::TrilinosWrappers::SparseMatrix>,
     aspect::internal::SchurComplementOperator,
     dealii::TrilinosWrappers::SparseMatrix,
     dealii::TrilinosWrappers::MPI::BlockVector>; VectorType =

@quangx quangx force-pushed the gmg_preconditioner branch from 4cb9ca7 to 4f98075 Compare October 13, 2025 04:15
@quangx quangx force-pushed the gmg_preconditioner branch from c893790 to 0a35ab6 Compare October 13, 2025 21:52
@tjhei tjhei merged commit a68f0c3 into tjhei:main Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants