SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
elliptic::Solver< Metavariables, Dim, System > Struct Template Reference

A complete nonlinear elliptic solver stack. Use to compose an executable. More...

#include <Solver.hpp>

Classes

struct  RandomizeInitialGuess

Public Types

using system = System
using background_tag
using initial_guess_tag
using fields_tag = ::Tags::Variables<typename system::primal_fields>
 These are the fields we solve for.
using fluxes_tag = ::Tags::Variables<typename system::primal_fluxes>
 These are the fluxes corresponding to the fields, i.e. essentially their first derivatives. These are background fields for the linearized sources.
using fixed_sources_tag = db::add_tag_prefix<::Tags::FixedSource, fields_tag>
 These are the fixed sources, i.e. the RHS of the equations.
using operator_applied_to_fields_tag
using amr_iteration_id
using nonlinear_solver
 The nonlinear solver algorithm.
using nonlinear_solver_iteration_id
using linear_solver
 The linear solver algorithm. We use GMRES since the operator is not necessarily symmetric. Using CG here would be an optimization for symmetric problems.
using linear_solver_iteration_id
using multigrid
 Precondition each linear solver iteration with a multigrid V-cycle.
using subdomain_operator
 Smooth each multigrid level with a number of Schwarz smoothing steps.
using subdomain_preconditioners
using schwarz_smoother
using vars_tag = typename linear_solver::operand_tag
 For the GMRES linear solver we need to apply the DG operator to its internal "operand" in every iteration of the algorithm.
using operator_applied_to_vars_tag
using fluxes_vars_tag
 The correction fluxes can be stored in an arbitrary tag. We don't need to access them anywhere, they're just a memory buffer for the linearized operator.
using observe_fields
 Fields that may be observed to monitor the state of the solver.
using observed_reduction_data_tags
 Collect all reduction tags for observers.
template<bool Linearized>
using dg_operator
using build_matrix
using build_matrix_actions
using init_analytic_solution_action
using initialization_actions
using register_actions
template<typename Label>
using smooth_actions
using subdomain_init_tags
using communicated_overlap_tags
 This data needs to be communicated on subdomain overlap regions.
using init_subdomain_action
template<typename StepActions>
using linear_solve_actions
template<typename StepActions>
using nonlinear_solve_actions
template<typename StepActions>
using solve_actions
template<typename Tag>
using overlaps_tag
using amr_projectors
using component_list

Static Public Attributes

static constexpr size_t volume_dim = Dim
static constexpr bool is_linear

Detailed Description

template<typename Metavariables, size_t Dim, typename System>
struct elliptic::Solver< Metavariables, Dim, System >

A complete nonlinear elliptic solver stack. Use to compose an executable.

The elliptic solver stack is described in detail in [210].

Uses Metavariables to instantiate parallel components.

Member Typedef Documentation

◆ amr_iteration_id

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::amr_iteration_id
Initial value:
Identifies a step in an iterative algorithm.
Definition Tags.hpp:74

◆ background_tag

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::background_tag
Initial value:
The variable-independent part of the elliptic equations, e.g. the fixed-sources in a Poisson equatio...
Definition Tags.hpp:44

◆ build_matrix

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::build_matrix
Initial value:
typename multigrid::smooth_fields_tag,
typename multigrid::smooth_source_tag, vars_tag,
operator_applied_to_vars_tag,
Build the explicit matrix representation of the linear operator and optionally invert it directly to ...
Definition BuildMatrix.hpp:784
The AMR level of the element. This is used to tag a Parallel::Tags::Section that contains all element...
Definition Tags.hpp:117
The coordinates in a given frame.
Definition Tags.hpp:85
typename linear_solver::operand_tag vars_tag
For the GMRES linear solver we need to apply the DG operator to its internal "operand" in every itera...
Definition Solver.hpp:182

◆ build_matrix_actions

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::build_matrix_actions
Initial value:
typename build_matrix::template actions<
typename dg_operator<true>::apply_actions>

◆ communicated_overlap_tags

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::communicated_overlap_tags
Initial value:
tmpl::flatten<tmpl::list<
typename system::primal_fields>>>>
tmpl::transform< TagList, tmpl::bind< Wrapper, tmpl::_1, tmpl::pin< Args >... > > wrap_tags_in
Create a new tmpl::list of tags by wrapping each tag in TagList in Wrapper<_, Args....
Definition PrefixHelpers.hpp:29
tmpl::transform< TagsList, make_faces_tag< tmpl::pin< tmpl::size_t< Dim > >, tmpl::_1, tmpl::pin< VolumeTags > > > make_faces_tags
Wrap all tags in TagsList in domain::Tags::Faces, except those in the VolumeTags list.
Definition Faces.hpp:42
Prefix indicating a boundary unit normal vector dotted into the flux.
Definition Prefixes.hpp:168
::Tags::Variables< typename system::primal_fields > fields_tag
These are the fields we solve for.
Definition Solver.hpp:122
::Tags::Variables< typename system::primal_fluxes > fluxes_tag
These are the fluxes corresponding to the fields, i.e. essentially their first derivatives....
Definition Solver.hpp:125

This data needs to be communicated on subdomain overlap regions.

◆ component_list

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::component_list
Initial value:
tmpl::flatten<
tmpl::list<tmpl::conditional_t<is_linear, tmpl::list<>,
typename nonlinear_solver::component_list>,
typename multigrid::component_list,
typename schwarz_smoother::component_list,
typename build_matrix::template component_list<Metavariables>,
tmpl::list< detail::ResidualMonitor< Metavariables, tmpl::conditional_t< is_linear, fields_tag, typename nonlinear_solver::linear_solver_fields_tag >, OptionTags::GmresGroup > > component_list
Definition Gmres.hpp:122
A singleton parallel component to manage adaptive mesh refinement.
Definition Component.hpp:33

◆ dg_operator

template<typename Metavariables, size_t Dim, typename System>
template<bool Linearized>
using elliptic::Solver< Metavariables, Dim, System >::dg_operator
Initial value:
system, Linearized, tmpl::conditional_t<Linearized, vars_tag, fields_tag>,
tmpl::conditional_t<Linearized, fluxes_vars_tag, fluxes_tag>,
tmpl::conditional_t<Linearized, operator_applied_to_vars_tag,
operator_applied_to_fields_tag>>
Apply the DG operator to the PrimalFieldsTag and write the result to the OperatorAppliedToFieldsTag
Definition ApplyOperator.hpp:514

◆ fluxes_vars_tag

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::fluxes_vars_tag
Initial value:
typename detail::add_tag_prefix_impl< Prefix, Tag, Args... >::type add_tag_prefix
Wrap Tag in Prefix<_, Args...>, unless Tag is a Tags::Variables, in which case this creates a new Tag...
Definition PrefixHelpers.hpp:50

The correction fluxes can be stored in an arbitrary tag. We don't need to access them anywhere, they're just a memory buffer for the linearized operator.

◆ init_analytic_solution_action

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::init_analytic_solution_action
Initial value:
volume_dim, background_tag,
tmpl::append<typename system::primal_fields,
typename system::primal_fluxes>,
Subclasses represent analytic solutions of elliptic systems.
Definition AnalyticSolution.hpp:27
Place the analytic solution of the system fields in the DataBox.
Definition InitializeAnalyticSolution.hpp:57

◆ init_subdomain_action

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::init_subdomain_action
Initial value:
system, background_tag, typename schwarz_smoother::options_group,
false>
Initialize the geometry for the DG subdomain operator.
Definition InitializeSubdomain.hpp:139

◆ initial_guess_tag

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::initial_guess_tag
Initial value:
The initial guess for the elliptic solve.
Definition Tags.hpp:56

◆ initialization_actions

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::initialization_actions
Initial value:
tmpl::list<
tmpl::conditional_t<is_linear, tmpl::list<>,
typename nonlinear_solver::initialize_element>,
typename linear_solver::initialize_element,
typename multigrid::initialize_element,
typename schwarz_smoother::initialize_element,
init_analytic_solution_action,
tmpl::conditional_t<is_linear,
elliptic::dg::Actions::
ImposeInhomogeneousBoundaryConditionsOnSource<
system, fixed_sources_tag>>>,
tmpl::list<>>,
tmpl::conditional_t<
is_linear, tmpl::list<>,
tmpl::list< detail::InitializeFacesMortarsAndBackground< System, BackgroundTag > > initialize_operator
Initialize geometric and background quantities for the elliptic DG operator.
Definition ApplyOperator.hpp:467
Apply the function Mutator::apply to the DataBox.
Definition MutateApply.hpp:49
Optionally add random noise to the initial guess.
Definition RandomizeVariables.hpp:49
Initialize the list of compute tags in ComputeTagsList
Definition AddComputeTags.hpp:39
Mutate DataBox items by calling db::mutate_apply on each Mutator in the order they are specified.
Definition InitializeItems.hpp:35
Initialize items related to adaptive mesh refinement.
Definition Initialize.hpp:28
Initialize the dynamic fields of the elliptic system, i.e. those we solve for.
Definition InitializeFields.hpp:42
Initialize the "fixed sources" of the elliptic equations, i.e. their variable-independent source term...
Definition InitializeFixedSources.hpp:56
db::add_tag_prefix<::Tags::FixedSource, fields_tag > fixed_sources_tag
These are the fixed sources, i.e. the RHS of the equations.
Definition Solver.hpp:127
The FieldsTag on external boundaries.
Definition BoundaryFields.hpp:30
The Tags::NormalDotFlux<FieldsTag> on external boundaries.
Definition BoundaryFields.hpp:55
Initializes items for the elliptic AMR algorithm projector.
Definition Actions.hpp:34
Initialize items related to the basic structure of the element.
Definition InitializeDomain.hpp:58

◆ linear_solve_actions

template<typename Metavariables, size_t Dim, typename System>
template<typename StepActions>
using elliptic::Solver< Metavariables, Dim, System >::linear_solve_actions
Initial value:
typename linear_solver::template solve<
tmpl::list<
typename multigrid::template solve<
typename dg_operator<true>::apply_actions,
smooth_actions<LinearSolver::multigrid::VcycleDownLabel>,
smooth_actions<LinearSolver::multigrid::VcycleUpLabel>,
build_matrix_actions>,
multigrid, typename dg_operator<true>::apply_actions>>,
StepActions>
tmpl::conditional_t< std::is_same_v< BuildOperatorActions, tmpl::list<> >, MakeIdentityIfSkipped< LinearSolverType >, tmpl::list< MakeIdentityIfSkipped< LinearSolverType, detail::ProceedLabel< Label > >, BuildOperatorActions, ::Actions::Label< detail::ProceedLabel< Label > > > > make_identity_if_skipped
Run MakeIdentityIfSkipped, and also run the BuildOperatorActions if the linear solver is skipped....
Definition MakeIdentityIfSkipped.hpp:120
LinearSolver::multigrid::Multigrid< Metavariables, volume_dim, typename linear_solver::operand_tag, OptionTags::MultigridGroup, elliptic::dg::Tags::Massive, typename linear_solver::preconditioner_source_tag > multigrid
Precondition each linear solver iteration with a multigrid V-cycle.
Definition Solver.hpp:163

◆ linear_solver

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::linear_solver
Initial value:
Metavariables,
tmpl::conditional_t<is_linear, fields_tag,
typename nonlinear_solver::linear_solver_fields_tag>,
tmpl::conditional_t<is_linear, fixed_sources_tag,
typename nonlinear_solver::linear_solver_source_tag>,
A GMRES solver for nonsymmetric linear systems of equations .
Definition Gmres.hpp:100
True on the finest AMR grid (the one with the highest grid index), false on all other grids....
Definition Tags.hpp:125
Definition Solver.hpp:80

The linear solver algorithm. We use GMRES since the operator is not necessarily symmetric. Using CG here would be an optimization for symmetric problems.

◆ linear_solver_iteration_id

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::linear_solver_iteration_id

◆ multigrid

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::multigrid
Initial value:
Metavariables, volume_dim, typename linear_solver::operand_tag,
std::conditional_t< Preconditioned, db::add_tag_prefix< LinearSolver::Tags::Preconditioned, db::add_tag_prefix< LinearSolver::Tags::Operand, fields_tag > >, db::add_tag_prefix< LinearSolver::Tags::Operand, fields_tag > > operand_tag
Definition Gmres.hpp:107
A V-cycle geometric multgrid solver for linear equations .
Definition Multigrid.hpp:128
Definition Solver.hpp:90
Whether or not to multiply the DG operator with the mass matrix. Massive DG operators can be easier t...
Definition Tags.hpp:94

Precondition each linear solver iteration with a multigrid V-cycle.

◆ nonlinear_solve_actions

template<typename Metavariables, size_t Dim, typename System>
template<typename StepActions>
using elliptic::Solver< Metavariables, Dim, System >::nonlinear_solve_actions
Initial value:
typename nonlinear_solver::template solve<
typename dg_operator<false>::apply_actions,
tmpl::list<
volume_dim, tmpl::list<fields_tag, fluxes_tag>,
typename multigrid::options_group>,
tmpl::list<fields_tag, fluxes_tag>,
typename multigrid::options_group, void>,
typename schwarz_smoother::options_group, false,
nonlinear_solver_iteration_id>,
typename schwarz_smoother::options_group, false,
nonlinear_solver_iteration_id>,
typename schwarz_smoother::subdomain_solver,
typename schwarz_smoother::options_group>,
linear_solve_actions<tmpl::list<>>>,
StepActions>
Receive data from regions of this element's subdomain that overlap with other elements.
Definition CommunicateOverlapFields.hpp:180
Reset the subdomain solver, clearing its caches related to the linear operator it has solved so far.
Definition ResetSubdomainSolver.hpp:61
Send data on regions that overlap with other subdomains to their corresponding elements.
Definition CommunicateOverlapFields.hpp:75
Receive the FieldsTags communicated from the finer grid in the multigrid hierarchy.
Definition RestrictFields.hpp:168
Communicate and project the FieldsTags to the next-coarser grid in the multigrid hierarchy.
Definition RestrictFields.hpp:81
tmpl::flatten< tmpl::list< fields_tag, fluxes_tag, domain::make_faces_tags< volume_dim, typename system::primal_fields >, domain::make_faces_tags< volume_dim, db::wrap_tags_in<::Tags::NormalDotFlux, typename system::primal_fields > > > > communicated_overlap_tags
This data needs to be communicated on subdomain overlap regions.
Definition Solver.hpp:289

◆ nonlinear_solver

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::nonlinear_solver
Initial value:
A Newton-Raphson correction scheme for nonlinear systems of equations .
Definition NewtonRaphson.hpp:83

The nonlinear solver algorithm.

◆ nonlinear_solver_iteration_id

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::nonlinear_solver_iteration_id

◆ observe_fields

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::observe_fields
Initial value:
tmpl::conditional_t<
is_linear,
tmpl::append<
typename fixed_sources_tag::tags_list,
fields_tag>::tags_list,
fields_tag>::tags_list>,
tmpl::append<
typename fixed_sources_tag::tags_list,
typename nonlinear_solver::linear_solver_fields_tag::tags_list,
typename nonlinear_solver::linear_solver_source_tag::tags_list>>
The operand that the local linear operator is applied to.
Definition Tags.hpp:56
The linear operator applied to the data in Tag
Definition Tags.hpp:69

Fields that may be observed to monitor the state of the solver.

◆ observed_reduction_data_tags

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::observed_reduction_data_tags
Initial value:
observers::collect_reduction_data_tags<tmpl::flatten<tmpl::list<
tmpl::conditional_t<is_linear, tmpl::list<>, nonlinear_solver>,
linear_solver, multigrid, schwarz_smoother>>>
LinearSolver::gmres::Gmres< Metavariables, tmpl::conditional_t< is_linear, fields_tag, typename nonlinear_solver::linear_solver_fields_tag >, OptionTags::GmresGroup, true, tmpl::conditional_t< is_linear, fixed_sources_tag, typename nonlinear_solver::linear_solver_source_tag >, ::amr::Tags::IsFinestGrid > linear_solver
The linear solver algorithm. We use GMRES since the operator is not necessarily symmetric....
Definition Solver.hpp:151
NonlinearSolver::newton_raphson::NewtonRaphson< Metavariables, fields_tag, OptionTags::NewtonRaphsonGroup, fixed_sources_tag, ::amr::Tags::IsFinestGrid > nonlinear_solver
The nonlinear solver algorithm.
Definition Solver.hpp:142

Collect all reduction tags for observers.

◆ operator_applied_to_fields_tag

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::operator_applied_to_fields_tag

◆ operator_applied_to_vars_tag

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::operator_applied_to_vars_tag

◆ overlaps_tag

template<typename Metavariables, size_t Dim, typename System>
template<typename Tag>
using elliptic::Solver< Metavariables, Dim, System >::overlaps_tag
Initial value:
The Tag on the overlap region with each neighbor, i.e. on a region extruding from the central element...
Definition Tags.hpp:131

◆ register_actions

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::register_actions
Initial value:
tmpl::flatten<tmpl::list<
tmpl::conditional_t<is_linear, tmpl::list<>,
typename nonlinear_solver::register_element>,
typename multigrid::register_element,
typename schwarz_smoother::register_element,
Definition ElementsRegistration.hpp:79

◆ schwarz_smoother

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::schwarz_smoother
Initial value:
typename multigrid::smooth_fields_tag, OptionTags::SchwarzSmootherGroup,
subdomain_operator, subdomain_preconditioners,
typename multigrid::smooth_source_tag, ::amr::Tags::GridIndex>
An additive Schwarz subdomain solver for linear systems of equations .
Definition Schwarz.hpp:158
elliptic::dg::subdomain_operator::SubdomainOperator< system, OptionTags::SchwarzSmootherGroup > subdomain_operator
Smooth each multigrid level with a number of Schwarz smoothing steps.
Definition Solver.hpp:169

◆ smooth_actions

template<typename Metavariables, size_t Dim, typename System>
template<typename Label>
using elliptic::Solver< Metavariables, Dim, System >::smooth_actions
Initial value:
typename schwarz_smoother::template solve<
typename dg_operator<true>::apply_actions, Label>

◆ subdomain_init_tags

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::subdomain_init_tags
Initial value:
tmpl::list<domain::Tags::Mesh<volume_dim>,
The Element associated with the DataBox.
Definition Tags.hpp:52
Holds the mesh of each neighboring element, oriented to the host's logical frame.
Definition NeighborMesh.hpp:29

◆ subdomain_operator

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::subdomain_operator
Initial value:
The elliptic DG operator on an element-centered subdomain.
Definition SubdomainOperator.hpp:130

Smooth each multigrid level with a number of Schwarz smoothing steps.

◆ subdomain_preconditioners

template<typename Metavariables, size_t Dim, typename System>
using elliptic::Solver< Metavariables, Dim, System >::subdomain_preconditioners

Member Data Documentation

◆ is_linear

template<typename Metavariables, size_t Dim, typename System>
bool elliptic::Solver< Metavariables, Dim, System >::is_linear
staticconstexpr
Initial value:
=
typename system::sources_computer>
T is_same_v

The documentation for this struct was generated from the following file:
  • src/Elliptic/Executables/Solver.hpp