SpECTRE  v2024.09.29
elliptic::Solver< Metavariables > 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 = typename Metavariables::system
 
using background_tag = elliptic::Tags::Background< elliptic::analytic_data::Background >
 
using initial_guess_tag = elliptic::Tags::InitialGuess< elliptic::analytic_data::InitialGuess >
 
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 = tmpl::conditional_t< is_linear, db::add_tag_prefix< LinearSolver::Tags::OperatorAppliedTo, fields_tag >, db::add_tag_prefix< NonlinearSolver::Tags::OperatorAppliedTo, fields_tag > >
 
using amr_iteration_id = Convergence::Tags::IterationId<::amr::OptionTags::AmrGroup >
 
using nonlinear_solver = NonlinearSolver::newton_raphson::NewtonRaphson< Metavariables, fields_tag, OptionTags::NewtonRaphsonGroup, fixed_sources_tag, LinearSolver::multigrid::Tags::IsFinestGrid >
 The nonlinear solver algorithm.
 
using nonlinear_solver_iteration_id = Convergence::Tags::IterationId< typename nonlinear_solver::options_group >
 
using linear_solver = 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 >, LinearSolver::multigrid::Tags::IsFinestGrid >
 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 = Convergence::Tags::IterationId< typename linear_solver::options_group >
 
using multigrid = LinearSolver::multigrid::Multigrid< Metavariables, typename linear_solver::operand_tag, OptionTags::MultigridGroup, elliptic::dg::Tags::Massive, typename linear_solver::preconditioner_source_tag >
 Precondition each linear solver iteration with a multigrid V-cycle.
 
using subdomain_operator = elliptic::dg::subdomain_operator::SubdomainOperator< system, OptionTags::SchwarzSmootherGroup >
 Smooth each multigrid level with a number of Schwarz smoothing steps.
 
using subdomain_preconditioners = tmpl::list< elliptic::subdomain_preconditioners::Registrars::MinusLaplacian< volume_dim, OptionTags::SchwarzSmootherGroup > >
 
using schwarz_smoother = LinearSolver::Schwarz::Schwarz< typename multigrid::smooth_fields_tag, OptionTags::SchwarzSmootherGroup, subdomain_operator, subdomain_preconditioners, typename multigrid::smooth_source_tag, LinearSolver::multigrid::Tags::MultigridLevel >
 
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 = db::add_tag_prefix< LinearSolver::Tags::OperatorAppliedTo, vars_tag >
 
using fluxes_vars_tag = db::add_tag_prefix< NonlinearSolver::Tags::Correction, fluxes_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 = tmpl::conditional_t< is_linear, tmpl::append< typename fixed_sources_tag::tags_list, typename db::add_tag_prefix< LinearSolver::Tags::Operand, fields_tag >::tags_list, typename db::add_tag_prefix< LinearSolver::Tags::OperatorAppliedTo, fields_tag >::tags_list >, tmpl::append< typename nonlinear_solver::linear_solver_fields_tag::tags_list, typename nonlinear_solver::linear_solver_source_tag::tags_list > >
 Fields that may be observed to monitor the state of the solver.
 
using observed_reduction_data_tags = observers::collect_reduction_data_tags< tmpl::flatten< tmpl::list< tmpl::conditional_t< is_linear, tmpl::list<>, nonlinear_solver >, linear_solver, multigrid, schwarz_smoother > > >
 Collect all reduction tags for observers.
 
template<bool Linearized>
using dg_operator = elliptic::dg::Actions::DgOperator< system, Linearized, tmpl::conditional_t< Linearized, linear_solver_iteration_id, nonlinear_solver_iteration_id >, 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 > >
 
using build_matrix = LinearSolver::Actions::BuildMatrix< linear_solver_iteration_id, vars_tag, operator_applied_to_vars_tag, domain::Tags::Coordinates< volume_dim, Frame::Inertial >, LinearSolver::multigrid::Tags::IsFinestGrid >
 
using build_matrix_actions = typename build_matrix::template actions< typename dg_operator< true >::apply_actions >
 
using init_analytic_solution_action = elliptic::Actions::InitializeOptionalAnalyticSolution< volume_dim, background_tag, tmpl::append< typename system::primal_fields, typename system::primal_fluxes >, elliptic::analytic_data::AnalyticSolution >
 
using initialization_actions = tmpl::list< elliptic::dg::Actions::InitializeDomain< volume_dim >, 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, Initialization::Actions::InitializeItems< ::amr::Initialization::Initialize< volume_dim >, elliptic::amr::Actions::Initialize >, elliptic::Actions::InitializeFields< system, initial_guess_tag >, ::Actions::RandomizeVariables< fields_tag, RandomizeInitialGuess >, elliptic::Actions::InitializeFixedSources< system, background_tag >, init_analytic_solution_action, elliptic::dg::Actions::initialize_operator< system, background_tag >, tmpl::conditional_t< is_linear, tmpl::list<>, ::Initialization::Actions::AddComputeTags< tmpl::list< elliptic::Tags::BoundaryFieldsCompute< volume_dim, fields_tag >, elliptic::Tags::BoundaryFluxesCompute< volume_dim, fields_tag, fluxes_tag > > > > >
 
using register_actions = tmpl::flatten< tmpl::list< tmpl::conditional_t< is_linear, typename build_matrix::register_actions, typename nonlinear_solver::register_element >, typename multigrid::register_element, typename schwarz_smoother::register_element > >
 
template<typename Label >
using smooth_actions = typename schwarz_smoother::template solve< typename dg_operator< true >::apply_actions, Label >
 
using subdomain_init_tags = tmpl::list< domain::Tags::Mesh< volume_dim >, domain::Tags::Element< volume_dim >, domain::Tags::NeighborMesh< volume_dim > >
 
using communicated_overlap_tags = 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 > > > >
 This data needs to be communicated on subdomain overlap regions.
 
using init_subdomain_action = elliptic::dg::subdomain_operator::Actions::InitializeSubdomain< system, background_tag, typename schwarz_smoother::options_group, false >
 
template<typename StepActions >
using linear_solve_actions = 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 > >, ::LinearSolver::Actions::make_identity_if_skipped< multigrid, typename dg_operator< true >::apply_actions > >, StepActions >
 
template<typename StepActions >
using nonlinear_solve_actions = typename nonlinear_solver::template solve< typename dg_operator< false >::apply_actions, tmpl::list< LinearSolver::multigrid::Actions::ReceiveFieldsFromFinerGrid< volume_dim, tmpl::list< fields_tag, fluxes_tag >, typename multigrid::options_group >, LinearSolver::multigrid::Actions::SendFieldsToCoarserGrid< tmpl::list< fields_tag, fluxes_tag >, typename multigrid::options_group, void >, LinearSolver::Schwarz::Actions::SendOverlapFields< communicated_overlap_tags, typename schwarz_smoother::options_group, false, nonlinear_solver_iteration_id >, LinearSolver::Schwarz::Actions::ReceiveOverlapFields< volume_dim, communicated_overlap_tags, typename schwarz_smoother::options_group, false, nonlinear_solver_iteration_id >, LinearSolver::Schwarz::Actions::ResetSubdomainSolver< typename schwarz_smoother::options_group >, linear_solve_actions< tmpl::list<> > >, StepActions >
 
template<typename StepActions >
using solve_actions = tmpl::flatten< tmpl::list< elliptic::Actions::RunEventsAndTriggers< amr_iteration_id >, elliptic::amr::Actions::StopAmr, PhaseControl::Actions::ExecutePhaseChange, StepActions, elliptic::amr::Actions::IncrementIterationId, LinearSolver::Schwarz::Actions::SendOverlapFields< subdomain_init_tags, typename schwarz_smoother::options_group, false, amr_iteration_id >, LinearSolver::Schwarz::Actions::ReceiveOverlapFields< volume_dim, subdomain_init_tags, typename schwarz_smoother::options_group, false, amr_iteration_id >, init_subdomain_action, tmpl::conditional_t< is_linear, tmpl::list< typename elliptic::dg::Actions::DgOperator< system, true, linear_solver_iteration_id, fields_tag, fluxes_vars_tag, operator_applied_to_fields_tag, vars_tag, fluxes_vars_tag >::apply_actions, elliptic::dg::Actions::ImposeInhomogeneousBoundaryConditionsOnSource< system, fixed_sources_tag >, linear_solve_actions< tmpl::list<> > >, nonlinear_solve_actions< tmpl::list<> > > > >
 
template<typename Tag >
using overlaps_tag = LinearSolver::Schwarz::Tags::Overlaps< Tag, volume_dim, OptionTags::SchwarzSmootherGroup >
 
using amr_projectors = tmpl::flatten< tmpl::list< elliptic::dg::ProjectGeometry< volume_dim >, tmpl::conditional_t< is_linear, tmpl::list<>, typename nonlinear_solver::amr_projectors >, typename linear_solver::amr_projectors, typename multigrid::amr_projectors, typename schwarz_smoother::amr_projectors, ::amr::projectors::DefaultInitialize< tmpl::append< tmpl::list< domain::Tags::InitialExtents< volume_dim >, domain::Tags::InitialRefinementLevels< volume_dim > >, db::wrap_tags_in< overlaps_tag, tmpl::append< subdomain_init_tags, tmpl::conditional_t< is_linear, tmpl::list<>, communicated_overlap_tags > > >, typename init_subdomain_action::simple_tags > >, ::amr::projectors::ProjectVariables< volume_dim, fields_tag >, elliptic::Actions::InitializeFixedSources< system, background_tag >, init_analytic_solution_action, elliptic::dg::Actions::amr_projectors< system, background_tag >, typename dg_operator< true >::amr_projectors, tmpl::conditional_t< is_linear, typename build_matrix::amr_projectors, typename dg_operator< false >::amr_projectors >, elliptic::amr::Actions::Initialize > >
 
using component_list = tmpl::flatten< tmpl::list< tmpl::conditional_t< is_linear, tmpl::list<>, typename nonlinear_solver::component_list >, typename linear_solver::component_list, typename multigrid::component_list, typename schwarz_smoother::component_list, ::amr::Component< Metavariables > > >
 

Static Public Attributes

static constexpr size_t volume_dim = Metavariables::volume_dim
 
static constexpr bool is_linear
 

Detailed Description

template<typename Metavariables>
struct elliptic::Solver< Metavariables >

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

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

Uses Metavariables::volume_dim and Metavariables::system. Also uses Metavariables to instantiate parallel components.

Member Data Documentation

◆ is_linear

template<typename Metavariables >
constexpr bool elliptic::Solver< Metavariables >::is_linear
staticconstexpr
Initial value:
=
std::is_same_v<elliptic::get_sources_computer<system, true>,
typename system::sources_computer>

The documentation for this struct was generated from the following file: