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

#include <auxiliary_physics.h>

Inheritance diagram for AuxiliaryPhysics< dim, VectorType >:
[legend]

Public Member Functions

 AuxiliaryPhysics (const Parameters::NonLinearSolver non_linear_solver_parameters)
 AuxiliaryPhysics ()
virtual ~AuxiliaryPhysics ()=default
virtual std::vector< OutputStruct< dim, VectorType > > gather_output_hook ()
virtual void finish_simulation ()=0
virtual void percolate_time_vectors ()=0
virtual void modify_solution ()
virtual void update_boundary_conditions ()
virtual const DoFHandler< dim > & get_dof_handler ()=0
virtual void postprocess (bool first_iteration)=0
virtual void output_per_iteration_timer ()=0
virtual void pre_mesh_adaptation ()=0
virtual void post_mesh_adaptation ()=0
virtual void write_checkpoint ()=0
virtual void read_checkpoint ()=0
virtual std::vector< OutputStructTableHandler > gather_tables ()=0
virtual void compute_error_estimate (const std::pair< const Variable, Parameters::MultipleAdaptationParameters > &ivar, dealii::Vector< float > &estimated_error_per_cell)=0
virtual void setup_dofs ()=0
virtual void set_initial_conditions ()=0
void setup_preconditioner () override
virtual bool should_solve_auxiliary_physics ()
Public Member Functions inherited from PhysicsSolver< VectorType >
 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 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

Additional Inherited Members

Public Attributes inherited from PhysicsSolver< VectorType >
ConditionalOStream pcout
Parameters::SimulationControl::TimeSteppingMethod time_stepping_method

Detailed Description

template<int dim, typename VectorType>
class AuxiliaryPhysics< dim, VectorType >

Au auxiliary physics is defined as a physics that is solved on top of a core physics, the latter being the Navier-Stokes equations. Auxiliary physics are simpler physics around which the entire simulation process does not need to be tailored. Examples of auxiliary physics are temperature and concentration. Generally, the auxiliary physics does not affect the core physics. For example, temperature is advected by the fluid flow, but buoyancy effects are not taken into account.

The auxiliary physics are managed by the multiphysics interface of Lethe.

This base class is used to establish all of the routines that an auxiliary physics must be able to provide to the Multiphysics interface. These elements are then called at specific moments of a simulation.

Auxiliary physics are templated by the dimension of the problem and the vector type that is used to manage their data.

Current limitations:

  • Auxiliary physics are currently expected to be used in conjunction with a flow solver which can provide a velocity field.
  • Support for feedback from the auxiliary physics to the core physics is there but presently not used anywhere
  • Support for interaction between auxiliary physics is supported but has not been tested

Definition at line 44 of file auxiliary_physics.h.

Constructor & Destructor Documentation

◆ AuxiliaryPhysics() [1/2]

template<int dim, typename VectorType>
AuxiliaryPhysics< dim, VectorType >::AuxiliaryPhysics ( const Parameters::NonLinearSolver non_linear_solver_parameters)
inline

AuxiliaryPhysics - Base constructor for Auxiliary physics. This constructor builds an auxiliary physics which solves a non-linear problem. Consequently, the auxiliary physics must assemble its right-hand-side and matrix in the residual form. This means that the solution is reached when |R(u)|=0 where R is the residual vector and u the solution.

Parameters
[in]non_linear_solver_parametersParameters for the non-linear solvers that drives the solution of the non-linear physics.

Definition at line 58 of file auxiliary_physics.h.

References PhysicsSolver< VectorType >::PhysicsSolver().

◆ AuxiliaryPhysics() [2/2]

template<int dim, typename VectorType>
AuxiliaryPhysics< dim, VectorType >::AuxiliaryPhysics ( )
inline

AuxiliaryPhysics - Base constructor for Auxiliary physics. This constructor builds an auxiliary physics which solves a linear problem. Consequently, the auxiliary physics must assemble its right-hand-side and matrix in the form Au=b.

Definition at line 69 of file auxiliary_physics.h.

References PhysicsSolver< VectorType >::PhysicsSolver().

◆ ~AuxiliaryPhysics()

template<int dim, typename VectorType>
virtual AuxiliaryPhysics< dim, VectorType >::~AuxiliaryPhysics ( )
virtualdefault

AuxiliaryPhysics - Base destructor. At the present moment this is an interface with nothing.

Member Function Documentation

◆ compute_error_estimate()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::compute_error_estimate ( const std::pair< const Variable, Parameters::MultipleAdaptationParameters > & ivar,
dealii::Vector< float > & estimated_error_per_cell )
pure virtual

Compute the Kelly error estimator used to refine mesh on a auxiliary physic parameter.

Parameters
[in]ivarThe current element of the map simulation_parameters.mesh_adaptation.variables
[in,out]estimated_error_per_cellThe deal.II vector of estimated_error_per_cell

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ finish_simulation()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::finish_simulation ( )
pure virtual

Carry out the operations required to finish a simulation correctly.

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ gather_output_hook()

template<int dim, typename VectorType>
virtual std::vector< OutputStruct< dim, VectorType > > AuxiliaryPhysics< dim, VectorType >::gather_output_hook ( )
inlinevirtual

Gather and return vector of output structs that are particular to some applications.

Returns
Vector of OutputStructs that will be used to write the output results as VTU files.

Reimplemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

Definition at line 85 of file auxiliary_physics.h.

◆ gather_tables()

template<int dim, typename VectorType>
virtual std::vector< OutputStructTableHandler > AuxiliaryPhysics< dim, VectorType >::gather_tables ( )
pure virtual

Returns a vector of references to TableHandler objects that needs to be serialized/deserialized for a given AuxiliaryPhysics solver.

Returns
Structure containing the TableHandler objects and their corresponding file names.

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ get_dof_handler()

template<int dim, typename VectorType>
virtual const DoFHandler< dim > & AuxiliaryPhysics< dim, VectorType >::get_dof_handler ( )
pure virtual

Provide the dof handler associated with an auxiliary physics TODO : delete as the auxiliary physics are supposed to pass their dof_handler to the multiphysics_interface directly.

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ modify_solution()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::modify_solution ( )
inlinevirtual

Carry out modifications on the auxiliary physic solution. To be defined for some physics only (eg. free surface, see cls.h).

Reimplemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

Definition at line 108 of file auxiliary_physics.h.

◆ output_per_iteration_timer()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::output_per_iteration_timer ( )
pure virtual

◆ percolate_time_vectors()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::percolate_time_vectors ( )
pure virtual

Carry out the operations required to rearrange the values of the previous solution at the end of a time step.

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ post_mesh_adaptation()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::post_mesh_adaptation ( )
pure virtual

post_mesh_adaption Interpolates the auxiliary physics variables to the new mesh

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ postprocess()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::postprocess ( bool first_iteration)
pure virtual

Postprocess the auxiliary physics results. Post-processing this case implies the calculation of all derived quantities using the solution vector of the physics. It does not concern the output of the solution using the DataOutObject, which is accomplished through the attach_solution_to_output function.

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ pre_mesh_adaptation()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::pre_mesh_adaptation ( )
pure virtual

pre_mesh_adaption Prepares the auxiliary physics variables for a mesh refinement/coarsening

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ read_checkpoint()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::read_checkpoint ( )
pure virtual

Set solution vector of Auxiliary Physics using checkpoint.

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ set_initial_conditions()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::set_initial_conditions ( )
pure virtual

Sets-up the initial conditions associated with the physics. Generally, physics only support imposing nodal values, but some physics additionally support the use of L2 projection or steady-state solutions.

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ setup_dofs()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::setup_dofs ( )
pure virtual

Sets-up the DofHandler and the degree of freedom associated with the physics.

Implemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, ContinuumSolidDynamics< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

◆ setup_preconditioner()

template<int dim, typename VectorType>
void AuxiliaryPhysics< dim, VectorType >::setup_preconditioner ( )
inlineoverridevirtual

Set up preconditioner. Not used for the auxiliary physics but needed for the compilation of the non-linear solver.

Implements PhysicsSolver< VectorType >.

Reimplemented in TimeHarmonicMaxwell< dim >.

Definition at line 209 of file auxiliary_physics.h.

◆ should_solve_auxiliary_physics()

template<int dim, typename VectorType>
virtual bool AuxiliaryPhysics< dim, VectorType >::should_solve_auxiliary_physics ( )
inlinevirtual

Manage if this auxiliary physics should be solved at the current iteration. By default, auxiliary physics are solved at every iteration.

Reimplemented in ContinuumSolidDynamics< dim >, and TimeHarmonicMaxwell< dim >.

Definition at line 215 of file auxiliary_physics.h.

◆ update_boundary_conditions()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::update_boundary_conditions ( )
inlinevirtual

Update non zero constraints if the boundary is time-dependent.

Reimplemented in CahnHilliard< dim >, ConservativeLevelSet< dim >, HeatTransfer< dim >, TimeHarmonicMaxwell< dim >, and Tracer< dim >.

Definition at line 114 of file auxiliary_physics.h.

◆ write_checkpoint()

template<int dim, typename VectorType>
virtual void AuxiliaryPhysics< dim, VectorType >::write_checkpoint ( )
pure virtual

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