MLMGOptions Struct Reference

Kynema-SGF API: kynema_sgf::MLMGOptions Struct Reference
Kynema-SGF API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches

#include <MLMGOptions.H>

Collaboration diagram for kynema_sgf::MLMGOptions:
[legend]

Public Member Functions

 MLMGOptions (const std::string &prefix)
 MLMGOptions (const std::string &default_prefix, const std::string &custom_prefix)
void operator() (amrex::MLMG &)
void operator() (Hydro::NodalProjector &)
void operator() (Hydro::MacProjector &)
amrex::LPInfo & lpinfo ()
 Linear operator options during construction.

Public Attributes

int max_order {2}
amrex::Real rel_tol {std::numeric_limits<amrex::Real>::epsilon() * 1.0e5_rt}
 Relative tolerance for convergence of MLMG solvers.
amrex::Real abs_tol {std::numeric_limits<amrex::Real>::epsilon() * 1.0e2_rt}
 Absolute tolerance for convergence checks.

Private Member Functions

void parse_options (const std::string &)

Private Attributes

amrex::LPInfo m_lpinfo
 Linear operator info object.
std::string m_bottom_solver_type {"bicgstab"}
 Bottom solver type bicgstab, cg, hypre, etc.
std::string m_hypre_namespace {"hypre"}
 Options namespace for hypre solvers.
std::string m_hypre_interface {"ij"}
 Options of hypre interface.
amrex::Real m_bottom_rel_tol
 Relative tolerance for convergence of MLMG solvers.
amrex::Real m_bottom_abs_tol
 Absolute tolerance for convergence checks.
int m_verbose {0}
int m_max_iter {200}
int m_max_fmg_iters {0}
int m_num_pre_smooth {2}
int m_num_post_smooth {2}
int m_num_final_smooth {8}
int m_num_bottom_smooth {0}
int m_bottom_verbose {0}
int m_bottom_max_iter {200}
 Maximum iterations for the bottom solver.
bool m_do_fixed_iters {true}
 If set to true, AMReX won't abort if linear solver doesn't converge within max iterations.
bool m_do_nsolve {false}
 option to use the nsolve bottom solver added to help with overset masking
int m_nsolve_grid_size {16}
 set grid size for nsolve

Detailed Description

Interface to control the behavior of AMReX LinearSolvers

MLMGOptions provides a unified interface to set options to the linear operator object, MLMG solver, external solvers (e.g., hypre), as well as MacProjector and NodalProjector objects.

Constructor & Destructor Documentation

◆ MLMGOptions() [1/2]

kynema_sgf::MLMGOptions::MLMGOptions ( const std::string & prefix)
explicit

Parse user options with a given prefix

Parameters
prefixPrefix used to parse user inputs, e.g., mac_proj

◆ MLMGOptions() [2/2]

kynema_sgf::MLMGOptions::MLMGOptions ( const std::string & default_prefix,
const std::string & custom_prefix )

Parse options in two stages

This constructor parses the default options from default_prefix and then overrides certain options based on a custom prefix.

Parameters
default_prefixNamespace for default options
custom_prefixNamespace for override options

Member Function Documentation

◆ lpinfo()

amrex::LPInfo & kynema_sgf::MLMGOptions::lpinfo ( )
inline

Linear operator options during construction.

◆ operator()() [1/3]

void kynema_sgf::MLMGOptions::operator() ( amrex::MLMG & mlmg)

◆ operator()() [2/3]

void kynema_sgf::MLMGOptions::operator() ( Hydro::MacProjector & mac_proj)

◆ operator()() [3/3]

void kynema_sgf::MLMGOptions::operator() ( Hydro::NodalProjector & nodal_proj)

◆ parse_options()

void kynema_sgf::MLMGOptions::parse_options ( const std::string & prefix)
private

Member Data Documentation

◆ abs_tol

amrex::Real kynema_sgf::MLMGOptions::abs_tol {std::numeric_limits<amrex::Real>::epsilon() * 1.0e2_rt}

Absolute tolerance for convergence checks.

◆ m_bottom_abs_tol

amrex::Real kynema_sgf::MLMGOptions::m_bottom_abs_tol
private
Initial value:
{
std::numeric_limits<amrex::Real>::epsilon() * 1.0e4_rt}

Absolute tolerance for convergence checks.

◆ m_bottom_max_iter

int kynema_sgf::MLMGOptions::m_bottom_max_iter {200}
private

Maximum iterations for the bottom solver.

◆ m_bottom_rel_tol

amrex::Real kynema_sgf::MLMGOptions::m_bottom_rel_tol
private
Initial value:
{
std::numeric_limits<amrex::Real>::epsilon() * 1.0e12_rt}

Relative tolerance for convergence of MLMG solvers.

◆ m_bottom_solver_type

std::string kynema_sgf::MLMGOptions::m_bottom_solver_type {"bicgstab"}
private

Bottom solver type bicgstab, cg, hypre, etc.

◆ m_bottom_verbose

int kynema_sgf::MLMGOptions::m_bottom_verbose {0}
private

Set verbosity for AMReX bottom solvers

When using hypre as the bottom solver, this option is not passed to hypre. Instead user must set hypre.verbose to control the hypre solver verbosity and hypre.bamg_verbose to control BoomerAMG verbosity (when used as a preconditioner).

◆ m_do_fixed_iters

bool kynema_sgf::MLMGOptions::m_do_fixed_iters {true}
private

If set to true, AMReX won't abort if linear solver doesn't converge within max iterations.

◆ m_do_nsolve

bool kynema_sgf::MLMGOptions::m_do_nsolve {false}
private

option to use the nsolve bottom solver added to help with overset masking

◆ m_hypre_interface

std::string kynema_sgf::MLMGOptions::m_hypre_interface {"ij"}
private

Options of hypre interface.

◆ m_hypre_namespace

std::string kynema_sgf::MLMGOptions::m_hypre_namespace {"hypre"}
private

Options namespace for hypre solvers.

◆ m_lpinfo

amrex::LPInfo kynema_sgf::MLMGOptions::m_lpinfo
private

Linear operator info object.

◆ m_max_fmg_iters

int kynema_sgf::MLMGOptions::m_max_fmg_iters {0}
private

◆ m_max_iter

int kynema_sgf::MLMGOptions::m_max_iter {200}
private

◆ m_nsolve_grid_size

int kynema_sgf::MLMGOptions::m_nsolve_grid_size {16}
private

set grid size for nsolve

◆ m_num_bottom_smooth

int kynema_sgf::MLMGOptions::m_num_bottom_smooth {0}
private

◆ m_num_final_smooth

int kynema_sgf::MLMGOptions::m_num_final_smooth {8}
private

◆ m_num_post_smooth

int kynema_sgf::MLMGOptions::m_num_post_smooth {2}
private

◆ m_num_pre_smooth

int kynema_sgf::MLMGOptions::m_num_pre_smooth {2}
private

◆ m_verbose

int kynema_sgf::MLMGOptions::m_verbose {0}
private

Verbosity of the MLMG and Projector interfaces

◆ max_order

int kynema_sgf::MLMGOptions::max_order {2}

◆ rel_tol

amrex::Real kynema_sgf::MLMGOptions::rel_tol {std::numeric_limits<amrex::Real>::epsilon() * 1.0e5_rt}

Relative tolerance for convergence of MLMG solvers.


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