![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <physics_solver.h>
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 |
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.
| [in] | non_linear_solver_parameters | Set of parameters that will be used to construct the non-linear solver. |
Definition at line 27 of file physics_solver.h.
| PhysicsSolver< VectorType >::PhysicsSolver | ( | const Parameters::NonLinearSolver | non_linear_solver_parameters | ) |
Constructor for the non-linear physics.
| [in] | non_linear_solver_parameters | Non-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< 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.
|
inlinevirtual |
|
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.
Reimplemented in FluidDynamicsSharp< dim >.
Definition at line 158 of file physics_solver.h.
|
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().
|
pure virtual |
Assemble the matrix.
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, FluidDynamicsMatrixFree< dim >, FluidDynamicsNitsche< dim, spacedim >, FluidDynamicsSharp< dim >, FluidDynamicsVANS< dim, PropertiesIndex >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Assemble the right-hand side (rhs).
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, FluidDynamicsMatrixFree< dim >, FluidDynamicsNitsche< dim, spacedim >, FluidDynamicsSharp< dim >, FluidDynamicsVANS< dim, PropertiesIndex >, FluidDynamicsVANSMatrixFree< dim, PropertiesIndex >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
inline |
Return the current newton iteration of this physics solver.
Definition at line 167 of file physics_solver.h.
References physics_solving_strategy.
|
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.
Reimplemented in FluidDynamicsSharp< dim >.
Definition at line 140 of file physics_solver.h.
References get_system_rhs().
|
pure virtual |
Getter methods that give access to the private attributes of the physics being solved. These methods must be provided by the physics as they are the key to solve a problem using Lethe.
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, NavierStokesBase< dim, VectorType, DofsType >, NavierStokesBase< dim, GlobalBlockVectorType, std::vector< IndexSet > >, NavierStokesBase< dim, GlobalVectorType, IndexSet >, NavierStokesBase< dim, LinearAlgebra::distributed::Vector< double >, IndexSet >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, NavierStokesBase< dim, VectorType, DofsType >, NavierStokesBase< dim, GlobalBlockVectorType, std::vector< IndexSet > >, NavierStokesBase< dim, GlobalVectorType, IndexSet >, NavierStokesBase< dim, LinearAlgebra::distributed::Vector< double >, IndexSet >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, NavierStokesBase< dim, VectorType, DofsType >, NavierStokesBase< dim, GlobalBlockVectorType, std::vector< IndexSet > >, NavierStokesBase< dim, GlobalVectorType, IndexSet >, NavierStokesBase< dim, LinearAlgebra::distributed::Vector< double >, IndexSet >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, NavierStokesBase< dim, VectorType, DofsType >, NavierStokesBase< dim, GlobalBlockVectorType, std::vector< IndexSet > >, NavierStokesBase< dim, GlobalVectorType, IndexSet >, NavierStokesBase< dim, LinearAlgebra::distributed::Vector< double >, IndexSet >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, NavierStokesBase< dim, VectorType, DofsType >, NavierStokesBase< dim, GlobalBlockVectorType, std::vector< IndexSet > >, NavierStokesBase< dim, GlobalVectorType, IndexSet >, NavierStokesBase< dim, LinearAlgebra::distributed::Vector< double >, IndexSet >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Return the metric for residual rescaling. By default, should return 1. If the rescale_residual_by_volume is set to true, the method returns the square root of the global volume of the triangulation.
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, NavierStokesBase< dim, VectorType, DofsType >, NavierStokesBase< dim, GlobalBlockVectorType, std::vector< IndexSet > >, NavierStokesBase< dim, GlobalVectorType, IndexSet >, NavierStokesBase< dim, LinearAlgebra::distributed::Vector< double >, IndexSet >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, NavierStokesBase< dim, VectorType, DofsType >, NavierStokesBase< dim, GlobalBlockVectorType, std::vector< IndexSet > >, NavierStokesBase< dim, GlobalVectorType, IndexSet >, NavierStokesBase< dim, LinearAlgebra::distributed::Vector< double >, IndexSet >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Output the L2 and Linfty norms of the correction vector.
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, NavierStokesBase< dim, VectorType, DofsType >, NavierStokesBase< dim, GlobalBlockVectorType, std::vector< IndexSet > >, NavierStokesBase< dim, GlobalVectorType, IndexSet >, NavierStokesBase< dim, LinearAlgebra::distributed::Vector< double >, IndexSet >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
|
pure virtual |
Set up the preconditioner.
Implemented in AuxiliaryPhysics< dim, VectorType >, AuxiliaryPhysics< dim, GlobalVectorType >, FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, FluidDynamicsMatrixFree< dim >, PhysicsNonlinearSubequationsSolver< dim, VectorType >, PhysicsNonlinearSubequationsSolver< dim, GlobalVectorType >, and TimeHarmonicMaxwell< dim >.
| 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.
|
pure virtual |
Solve the linear system of equations.
Implemented in CahnHilliard< dim >, CLSPDEBasedInterfaceReinitialization< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, FluidDynamicsMatrixFree< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.
| ConditionalOStream PhysicsSolver< VectorType >::pcout |
Definition at line 172 of file physics_solver.h.
|
private |
Definition at line 176 of file physics_solver.h.
| Parameters::SimulationControl::TimeSteppingMethod PhysicsSolver< VectorType >::time_stepping_method |
Definition at line 173 of file physics_solver.h.