20 const std::string & name,
22 :
SystemBase(subproblem, fe_problem, name, var_kind),
23 _current_solution(nullptr),
24 _pc_side(
Moose::PCS_DEFAULT),
25 _ksp_norm(
Moose::KSPN_UNPRECONDITIONED)
82 if (MooseUtils::absoluteFuzzyEqual(relaxation_factor, 1.0))
86 "Fixed point relaxation was requested but the old fixed point solution was not "
91 "Fixed point relaxation requires the previous fixed point solution state to have "
92 "the same parallel type as the system solution.");
95 sol.scale(relaxation_factor);
96 sol.add(1.0 - relaxation_factor,
solutionState(1, iteration_type));
106 else if (pcs ==
"right")
108 else if (pcs ==
"symmetric")
110 else if (pcs ==
"default")
119 if (kspnorm ==
"none")
121 else if (kspnorm ==
"preconditioned")
123 else if (kspnorm ==
"unpreconditioned")
125 else if (kspnorm ==
"natural")
127 else if (kspnorm ==
"default")
130 mooseError(
"Unknown ksp norm type specified.");
141 if (solution_invalidity.hasInvalidSolution())
145 solution_invalidity.print(
_console);
147 mooseWarning(
"The Solution Invalidity warnings are detected but silenced! "
148 "Use Problem/show_invalid_solution_console=true to show solution counts");
152 solution_invalidity.print(
_console);
160 bool compute_tds =
false;
182 ti->computeTimeDerivatives();
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_LINEAR
const ExecFlagType EXEC_NONLINEAR
const ExecFlagType EXEC_FINAL
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
bool acceptInvalidSolution() const
Whether or not to accept the solution based on its invalidity.
void computingScalingJacobian(bool computing_scaling_jacobian)
Setter for whether we're computing the scaling jacobian.
virtual Real & dt() const
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters.
bool showInvalidSolutionConsole() const
Whether or not to print out the invalid solutions summary table in console.
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
Class for containing MooseEnum item information.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void syncIteration()
Sync iteration counts to main processor Sum across all processors.
void setPCSide(MooseEnum pcs)
Set the side on which the preconditioner is applied to.
void setSolution(const NumericVector< Number > &soln)
Set the solution to a given vector.
virtual void compute(ExecFlagType type) override
Compute time derivatives, auxiliary variables, etc.
virtual void preInit() override
This is called prior to the libMesh system has been init'd.
void checkInvalidSolution()
SolverSystem(SubProblem &subproblem, FEProblemBase &fe_problem, const std::string &name, Moose::VarKindType var_kind)
virtual bool matrixFromColoring() const
Whether a system matrix is formed from coloring.
const NumericVector< Number > * _current_solution
solution vector from solver
void applyFixedPointRelaxation(const Real relaxation_factor, const Moose::SolutionIterationType iteration_type)
Apply solution under/over-relaxation for fixed point iterations.
void setMooseKSPNormType(MooseEnum kspnorm)
Set the norm in which the linear convergence will be measured.
Moose::PCSideType _pc_side
Preconditioning side.
virtual void restoreSolutions() override final
Restore current solutions (call after your solve failed)
Moose::MooseKSPNormType _ksp_norm
KSP norm type.
Generic class for solving transient nonlinear problems.
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Base class for a system (of equations)
std::unique_ptr< NumericVector< Number > > _serialized_solution
Serialized version of the solution vector, or nullptr if a serialized solution is not needed.
FEProblemBase & _fe_problem
the governing finite element/volume problem
std::vector< std::shared_ptr< TimeIntegrator > > _time_integrators
Time integrator.
unsigned int number() const
Gets the number of this system.
virtual void associateVectorToTag(NumericVector< Number > &vec, TagID tag)
Associate a vector for a given tag.
virtual void preInit()
This is called prior to the libMesh system has been init'd.
virtual void restoreSolutions()
Restore current solutions (call after your solve failed)
libMesh::ParallelType solutionStateParallelType(const unsigned int state, const Moose::SolutionIterationType iteration_type) const
Returns the parallel type of the given solution state.
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
virtual bool hasSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time) const
Whether or not the system has the solution state (0 = current, 1 = old, 2 = older,...
NumericVector< Number > & solution()
void update()
Update the system (doing libMesh magic)
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
virtual void localize(std::vector< T > &v_local) const=0
std::unique_ptr< NumericVector< Number > > current_local_solution
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
@ PCS_DEFAULT
Use whatever we have in PETSc.
@ ST_LINEAR
Solving a linear problem.
@ KSPN_DEFAULT
Use whatever we have in PETSc.
VarKindType
Framework-wide stuff.
const TagName SOLUTION_TAG
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real