|
SpECTRE
2021.08.02
|
A V-cycle geometric multgrid solver for linear equations \(Ax = b\). More...
#include <Multigrid.hpp>
Public Types | |
| using | fields_tag = FieldsTag |
| using | options_group = OptionsGroup |
| using | source_tag = SourceTag |
| using | operand_tag = FieldsTag |
| using | smooth_source_tag = source_tag |
| using | smooth_fields_tag = fields_tag |
| using | component_list = tmpl::list<> |
| using | observed_reduction_data_tags = observers::make_reduction_data_tags< tmpl::list< async_solvers::reduction_data > > |
| using | initialize_element = tmpl::list< async_solvers::InitializeElement< FieldsTag, OptionsGroup, SourceTag >, detail::InitializeElement< Dim, FieldsTag, OptionsGroup, SourceTag > > |
| using | register_element = tmpl::list< async_solvers::RegisterElement< FieldsTag, OptionsGroup, SourceTag, Tags::IsFinestGrid >, observers::Actions::RegisterWithObservers< detail::RegisterWithVolumeObserver< OptionsGroup > > > |
| template<typename PreSmootherActions , typename PostSmootherActions , typename Label = OptionsGroup> | |
| using | solve = tmpl::list< async_solvers::PrepareSolve< FieldsTag, OptionsGroup, SourceTag, Label, Tags::IsFinestGrid, false >, detail::ReceiveResidualFromFinerGrid< Dim, FieldsTag, OptionsGroup, SourceTag >, detail::PreparePreSmoothing< FieldsTag, OptionsGroup, SourceTag >, PreSmootherActions, detail::SkipPostsmoothingAtBottom< FieldsTag, OptionsGroup, SourceTag >, detail::SendResidualToCoarserGrid< FieldsTag, OptionsGroup, ResidualIsMassiveTag, SourceTag >, detail::ReceiveCorrectionFromCoarserGrid< Dim, FieldsTag, OptionsGroup, SourceTag >, PostSmootherActions, detail::SendCorrectionToFinerGrid< FieldsTag, OptionsGroup, SourceTag >, detail::ObserveVolumeData< FieldsTag, OptionsGroup, SourceTag >, async_solvers::CompleteStep< FieldsTag, OptionsGroup, SourceTag, Label, Tags::IsFinestGrid, false > > |
A V-cycle geometric multgrid solver for linear equations \(Ax = b\).
This linear solver iteratively corrects an initial guess \(x_0\) by restricting the residual \(b - Ax\) to a series of coarser grids, solving for a correction on the coarser grids, and then prolongating (interpolating) the correction back to the finer grids. The solves on grids with different scales can very effectively solve large-scale modes in the solution, which Krylov-type linear solvers such as GMRES or Conjugate Gradients typically struggle with. Therefore, a multigrid solver can be an effective preconditioner for Krylov-type linear solvers (see LinearSolver::gmres::Gmres and LinearSolver::cg::ConjugateGradient). See [19] for an introduction to multigrid methods.
LinearSolver::multigrid::ElementsAllocator and LinearSolver::multigrid::coarsen for the code that creates the multigrid hierarchy.Spectral::projection_matrix_child_to_parent and Spectral::projection_matrix_parent_to_child, where "child" means the finer grid and "parent" means the coarser grid. Note that the residuals \(b - Ax\) may or may not already include a mass matrix and Jacobian factors, depending on the implementation of the linear operator \(A\). To account for this, provide a tag as the ResidualIsMassiveTag that holds a bool. See section 3 in [44] for details on the inter-mesh operators.smooth_fields_tag for the source in the smooth_source_tag. Useful smoothers are asynchronous linear solvers that parallelize well, such as LinearSolver::Schwarz::Schwarz. The multigrid algorithm doesn't assume anything about the smoother, but requires only that the PreSmootherActions and the PostSmootherActions passed to solve leave the smooth_fields_tag in a state that represents an approximate solution to the smooth_source_tag, and that db::add_tag_prefix<LinearSolver::Tags::OperatorAppliedTo, smooth_fields_tag> is left up-to-date as well. Here's an example of setting up a smoother for the multigrid solver:The smoother can be used to construct an action list like this: