Serac  0.1
Serac is an implicit thermal strucural mechanics simulation code.
solver_config.hpp
Go to the documentation of this file.
1 // Copyright (c) 2019-2024, Lawrence Livermore National Security, LLC and
2 // other Serac Project Developers. See the top-level LICENSE file for
3 // details.
4 //
5 // SPDX-License-Identifier: (BSD-3-Clause)
6 
13 #pragma once
14 
15 #include <variant>
16 
17 #include "mfem.hpp"
18 
19 namespace serac {
20 
24 enum class TimestepMethod
25 {
26  QuasiStatic,
28  // options for first order ODEs
30  SDIRK33,
31  ForwardEuler,
32  RK2,
33  RK3SSP,
34  RK4,
37  SDIRK23,
38  SDIRK34,
40  // options for second order ODEs
41  //
42  // note: we don't have a way to communicate
43  // parameters to the TimestepMethod,
44  // right now, so Newmark implies
45  // (beta = 0.25, gamma = 0.5)
46  Newmark,
47  HHTAlpha,
48  WBZAlpha,
52  FoxGoodwin
53 };
54 
60 {
68 
77 
88 };
89 
94 
97 };
98 
99 // _linear_solvers_start
101 enum class LinearSolver
102 {
103  CG,
104  GMRES,
105  SuperLU,
106  Strumpack
107 };
108 // _linear_solvers_end
109 
110 // Add a custom list of strings? conduit node?
111 // Arbitrary string (e.g. json) to define parameters?
112 
113 // _nonlinear_solvers_start
115 enum class NonlinearSolver
116 {
117  Newton,
118  LBFGS,
119  KINFullStep,
121  KINPicard
122 };
123 // _nonlinear_solvers_end
124 
128 enum class AMGXSolver
129 {
130  AMG,
131  PCGF,
132  CG,
133  PCG,
134  PBICGSTAB,
135  BICGSTAB,
136  FGMRES,
137  JACOBI_L1,
138  GS,
139  POLYNOMIAL,
141  BLOCK_JACOBI,
142  MULTICOLOR_GS,
144 };
145 
149 struct AMGXOptions {
161  bool verbose = false;
162 };
163 
164 // _preconditioners_start
166 enum class Preconditioner
167 {
168  HypreJacobi,
169  HypreL1Jacobi,
171  HypreAMG,
172  HypreILU,
173  AMGX,
174  None
175 };
176 // _preconditioners_end
177 
178 // _linear_options_start
183 
186 
188  double relative_tol = 1.0e-8;
189 
191  double absolute_tol = 1.0e-12;
192 
194  int max_iterations = 300;
195 
197  int print_level = 0;
198 
201 };
202 // _linear_options_end
203 
204 // _nonlinear_options_start
209 
211  double relative_tol = 1.0e-8;
212 
214  double absolute_tol = 1.0e-12;
215 
217  int max_iterations = 20;
218 
220  int print_level = 0;
221 };
222 // _nonlinear_options_end
223 
224 } // namespace serac
Accelerator functionality.
Definition: serac.cpp:38
LinearSolver
Linear solution method indicator.
DirichletEnforcementMethod
this enum describes which way to enforce the time-varying constraint u(t) == U(t)
NonlinearSolver
Nonlinear solver method indicator.
AMGXSolver
Solver types supported by AMGX.
Preconditioner
The type of preconditioner to be used.
TimestepMethod
Timestep method of a solver.
Stores the information required to configure a NVIDIA AMGX preconditioner.
AMGXSolver smoother
The smoother algorithm.
AMGXSolver solver
The solver algorithm.
bool verbose
Whether to display statistics from AMGX.
Parameters for an iterative linear solution scheme.
Preconditioner preconditioner
PreconditionerOptions selection.
LinearSolver linear_solver
Linear solver selection.
double relative_tol
Relative tolerance.
int preconditioner_print_level
Debugging print level for the preconditioner.
int max_iterations
Maximum number of iterations.
int print_level
Debugging print level for the linear solver.
double absolute_tol
Absolute tolerance.
Nonlinear solution scheme parameters.
int print_level
Debug print level.
double relative_tol
Relative tolerance.
NonlinearSolver nonlin_solver
Nonlinear solver selection.
double absolute_tol
Absolute tolerance.
int max_iterations
Maximum number of iterations.
A timestep and boundary condition enforcement method for a dynamic solver.
TimestepMethod timestepper
The timestepping method to be applied.
DirichletEnforcementMethod enforcement_method
The essential boundary enforcement method to use.