Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
PhysicsSolver< VectorType > Class Template Referenceabstract

#include <physics_solver.h>

Inheritance diagram for PhysicsSolver< VectorType >:
[legend]

Public Member Functions

 PhysicsSolver (const Parameters::NonLinearSolver non_linear_solver_parameters)
 PhysicsSolver ()
virtual ~PhysicsSolver ()
virtual void assemble_system_matrix ()=0
virtual void assemble_system_rhs ()=0
virtual void setup_preconditioner ()=0
virtual void solve_linear_system ()=0
void solve_governing_system ()
virtual void apply_constraints ()
virtual VectorType & get_evaluation_point ()=0
virtual VectorType & get_local_evaluation_point ()=0
virtual VectorType & get_newton_update ()=0
virtual VectorType & get_present_solution ()=0
virtual VectorType & get_system_rhs ()=0
virtual AffineConstraints< double > & get_nonzero_constraints ()=0
virtual void output_newton_update_norms ()=0
virtual double get_residual_rescale_metric () const =0
virtual double get_current_residual ()
virtual bool allow_skip_linear_solve_when_residual_is_below_tolerance () const
unsigned int get_current_newton_iteration () const

Public Attributes

ConditionalOStream pcout
Parameters::SimulationControl::TimeSteppingMethod time_stepping_method

Private Attributes

PhysicsSolverStrategy< VectorType > * physics_solving_strategy

Detailed Description

template<typename VectorType>
class PhysicsSolver< VectorType >

Contain all the common elements of a physics solver. It creates the non-linear solver as specified by the user using the parameters file and provides all the necessary elements needed by the solver to solve a physics problem.

Parameters
[in]non_linear_solver_parametersSet of parameters that will be used to construct the non-linear solver.

Definition at line 27 of file physics_solver.h.

Constructor & Destructor Documentation

◆ PhysicsSolver() [1/2]

template<typename VectorType>
PhysicsSolver< VectorType >::PhysicsSolver ( const Parameters::NonLinearSolver non_linear_solver_parameters)

Constructor for the non-linear physics.

Parameters
[in]non_linear_solver_parametersNon-linear solver parameters as specified in the simulation parameter file.

Definition at line 180 of file physics_solver.h.

References pcout, and Parameters::NonLinearSolver::solver.

◆ PhysicsSolver() [2/2]

template<typename VectorType>
PhysicsSolver< VectorType >::PhysicsSolver ( )

Constructor for the linear physics. Since the Physics is linear, a LinearSolutionStrategy is automatically generated as a PhysicsSolverStrategy.

Definition at line 207 of file physics_solver.h.

References pcout, and physics_solving_strategy.

◆ ~PhysicsSolver()

template<typename VectorType>
virtual PhysicsSolver< VectorType >::~PhysicsSolver ( )
inlinevirtual

Destructor.

Definition at line 51 of file physics_solver.h.

References physics_solving_strategy.

Member Function Documentation

◆ allow_skip_linear_solve_when_residual_is_below_tolerance()

template<typename VectorType>
virtual bool PhysicsSolver< VectorType >::allow_skip_linear_solve_when_residual_is_below_tolerance ( ) const
inlinevirtual

Return whether this solver may skip the inner linear solve when the freshly assembled residual is already below the nonlinear tolerance.

The default behavior is conservative and keeps the linear solve enabled. Solvers whose outer nonlinear residual may remain active for reasons other than the assembled linear-system residual can override this hook.

Returns
true if the solver allows skipping the linear solve once the assembled residual is already below the nonlinear tolerance.

Reimplemented in FluidDynamicsSharp< dim >.

Definition at line 158 of file physics_solver.h.

◆ apply_constraints()

template<typename VectorType>
virtual void PhysicsSolver< VectorType >::apply_constraints ( )
inlinevirtual

Applies constraints to a local_evaluation_point.

Definition at line 91 of file physics_solver.h.

References get_local_evaluation_point(), and get_nonzero_constraints().

◆ assemble_system_matrix()

◆ assemble_system_rhs()

◆ get_current_newton_iteration()

template<typename VectorType>
unsigned int PhysicsSolver< VectorType >::get_current_newton_iteration ( ) const
inline

Return the current newton iteration of this physics solver.

Definition at line 167 of file physics_solver.h.

References physics_solving_strategy.

◆ get_current_residual()

template<typename VectorType>
virtual double PhysicsSolver< VectorType >::get_current_residual ( )
inlinevirtual

Default way to evaluate the residual for the nonlinear solver, which is simply the norm of the RHS vector. Some application may use more complex evaluation of the residual and override this method.

Returns
l2 norm of the RHS vector.

Reimplemented in FluidDynamicsSharp< dim >.

Definition at line 140 of file physics_solver.h.

References get_system_rhs().

◆ get_evaluation_point()

◆ get_local_evaluation_point()

◆ get_newton_update()

◆ get_nonzero_constraints()

◆ get_present_solution()

◆ get_residual_rescale_metric()

template<typename VectorType>
virtual double PhysicsSolver< VectorType >::get_residual_rescale_metric ( ) const
pure virtual

◆ get_system_rhs()

◆ output_newton_update_norms()

◆ setup_preconditioner()

◆ solve_governing_system()

template<typename VectorType>
void PhysicsSolver< VectorType >::solve_governing_system ( )

Solve the global system of equations according to a given strategy, either linear or not.

Definition at line 216 of file physics_solver.h.

References physics_solving_strategy.

◆ solve_linear_system()

Member Data Documentation

◆ pcout

template<typename VectorType>
ConditionalOStream PhysicsSolver< VectorType >::pcout

Definition at line 172 of file physics_solver.h.

◆ physics_solving_strategy

template<typename VectorType>
PhysicsSolverStrategy<VectorType>* PhysicsSolver< VectorType >::physics_solving_strategy
private

Definition at line 176 of file physics_solver.h.

◆ time_stepping_method

Definition at line 173 of file physics_solver.h.


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