19 params.
addParam<std::vector<SolverSystemName>>(
21 "Names of the solver systems (both linear and nonlinear) that will be solved");
26 "multi_system_fixed_point",
28 "Whether to perform fixed point (Picard) iterations between the nonlinear systems.");
30 "multi_system_fixed_point_relaxation_factor",
32 "multi_system_fixed_point_relaxation_factor>0 & multi_system_fixed_point_relaxation_factor<2",
33 "Relaxation factor(s) applied to system solution updates during multi-system fixed point " 34 "iterations; 1 disables relaxation. If one value is provided it is applied to every system; " 35 "otherwise the vector must match the number/order of systems being solved.");
37 "multi_system_fixed_point_convergence",
38 "Convergence object to determine the convergence of the multi-system fixed point iteration.");
41 "system_names multi_system_fixed_point multi_system_fixed_point_convergence " 42 "multi_system_fixed_point_relaxation_factor",
43 "Multiple solver system");
49 _using_multi_sys_fp_iterations(getParam<bool>(
"multi_system_fixed_point")),
50 _multi_sys_fp_convergence(nullptr)
58 for (
const auto & sys_name : nl_sys_names)
60 for (
const auto & sys_name : linear_sys_names)
68 for (
const auto & sys_name :
getParam<std::vector<SolverSystemName>>(
"system_names"))
70 if (
std::find(nl_sys_names.begin(), nl_sys_names.end(), sys_name) != nl_sys_names.end())
75 else if (
std::find(linear_sys_names.begin(), linear_sys_names.end(), sys_name) !=
76 linear_sys_names.end())
80 "System '" + sys_name +
81 "' was not found in the Problem. Did you forget to declare it in the " 88 paramError(
"Can't use relaxation factors because multisystem fixed point iteration hasn't been " 98 getParam<std::vector<Real>>(
"multi_system_fixed_point_relaxation_factor");
102 paramError(
"multi_system_fixed_point_relaxation_factor",
104 " values (one per system in the solve order).");
static InputParameters validParams()
const std::vector< NonlinearSystemName > & getNonlinearSystemNames() const
FEProblemBase & _problem
Reference to FEProblem.
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
const InputParameters & _pars
The object's parameters.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
const bool _using_multi_sys_fp_iterations
Whether we are using fixed point iterations for multi-system.
Executioners are objects that do the actual work of solving your problem.
std::string stringify(const T &t)
conversion to string
const std::vector< LinearSystemName > & getLinearSystemNames() const
unsigned int solverSysNum(const SolverSystemName &solver_sys_name) const override
unsigned int _num_nl_systems
Number of nonlinear systems.
SolverSystem & getSolverSystem(unsigned int sys_num)
Get non-constant reference to a solver system.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
MultiSystemSolveObject(Executioner &ex)
void setupMultiSystemFixedPointRelaxationFactors()
Initializes/expands the multi-system fixed point relaxation factors.
std::vector< SolverSystem * > _systems
Vector of pointers to the systems.
std::vector< Real > _multi_sys_fp_relax_factors
Per-system relaxation factors for multi-system fixed point iterations (expanded to match the number/o...