ImplicitExplicitIntegrator< dim, number > Class Template Reference
|
Developer Documentation
|
#include <implicit_explicit_integrator.hpp>
Public Member Functions | |
| ImplicitExplicitIntegrator (const TimeIntegratorData< number > &time_integrator_data) | |
| unsigned | required_solution_history_size () const override |
| void | reinit (const VectorType &vector_template) override |
| void | reinit (const SolutionHistory< VectorType > &solution_history) override |
| void | configure_explicit_step (ExplicitRhsFunctionType explicit_rhs) |
| Configure the function used to compute the explicit right-hand side. | |
| void | configure_implicit_step_wo_internal_nonlinear_solver (CustomSolverType custom_solver_in) |
| void | configure_implicit_step (JacobianType jacobian, ResidualType residual, DistributeConstraintsType constraints=[](VectorType &) {}) |
| Configure the functions used by the internal nonlinear solver to solve the implicit step. For details on the functions see the corresponding class member descriptions. | |
| void | set_preconditioner (Preconditioner< dim, VectorType, number > &&preconditioner_in) |
| void | perform_time_step (const number current_time, const number time_step, SolutionHistory< VectorType > &solution_history, const std::function< void(number, number, VectorType &, const VectorType &)> &stage_pre_processing, const std::function< void(number, number, VectorType &, const VectorType &)> &stage_post_processing) override |
Public Member Functions inherited from MeltPoolDG::TimeIntegration::TimeIntegratorBase< number > | |
| TimeIntegratorBase (const TimeIntegratorData< number > &time_integrator_data_in) | |
| virtual | ~TimeIntegratorBase ()=default |
| TimeIntegratorSchemes | get_integrator_type () const |
| void | set_monitoring_vector (VectorType &monitoring_vector_in) |
| void | reset_monitoring_vector () |
Private Types | |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| using | ExplicitRhsFunctionType = std::function< void(number, number, VectorType &, const VectorType &, const bool, const std::function< void(unsigned, unsigned)> &)> |
| using | JacobianType = std::function< void(number time, number time_step, VectorType &dst, const VectorType &src)> |
| using | ResidualType = std::function< void(number time, number time_step, const VectorType &src, VectorType &dst, const VectorType &explicit_solution)> |
| using | DistributeConstraintsType = std::function< void(VectorType &dst)> |
| using | CustomSolverType = std::function< void(number time, number time_step, const VectorType &explicit_step_solution, const VectorType &solution)> |
Private Member Functions | |
| void | apply_explicit_step (number time, number time_step, const VectorType &src, VectorType &dst) const |
| void | apply_implicit_step (number time, number time_step, VectorType &explicit_solution, VectorType &solution) |
Private Attributes | |
| ResidualType | compute_residual |
| Compute the negative residual for the implicit step of the time integrator. | |
| JacobianType | compute_jacobian |
| Apply the Jacobian of the residual operator to a given vector. | |
| DistributeConstraintsType | distribute_constraints |
| CustomSolverType | custom_solver |
| ExplicitRhsFunctionType | explicit_compute_rhs |
| VectorType | intermediate_explicit_solution |
| Vector to store the solution of the explicit step. | |
| std::optional< NewtonRaphsonSolver< number, VectorType > > | solver |
| Nonlinear solver used when no custom solver is provided. | |
| Preconditioner< dim, VectorType, number > | preconditioner |
| Preconditioner for the linear solver used within each nonlinear solver iteration. | |
| bool | preconditioner_update_flag = false |
| Boolean to indicate whether the preconditioner needs to be updated before the next solve. | |
| unsigned | n_steps_performed = 0 |
| Number of time steps already performed by the integrator. | |
Additional Inherited Members | |
Protected Attributes inherited from MeltPoolDG::TimeIntegration::TimeIntegratorBase< number > | |
| const TimeIntegratorData< number > | time_integrator_data |
| VectorType * | monitoring_vector = nullptr |
Member Typedef Documentation
◆ CustomSolverType
|
private |
◆ DistributeConstraintsType
|
private |
◆ ExplicitRhsFunctionType
|
private |
◆ JacobianType
|
private |
◆ ResidualType
|
private |
◆ VectorType
|
private |
Constructor & Destructor Documentation
◆ ImplicitExplicitIntegrator()
|
explicit |
Constructor. After construction it is still required to configure the explicit and implicit steps using configure_explicit_step() and configure_implicit_step() and make a call to reinit() before the integrator can be used.
- Parameters
-
time_integrator_data Time integrator data struct setting the scheme of the integrator.
Member Function Documentation
◆ apply_explicit_step()
|
private |
Apply the explicit and store the result in dst. The solution at \( t^n \) is given by the vector src.
◆ apply_implicit_step()
|
private |
Solve the implicit step of the implicit-explicit scheme. If the function custom_solver has been set this function is used, otherwise the default nonlinear solver of the class is used. The result, i.e., the solution at the new time step, is stored in solution. The solution after the explicit step is given by explicit_solution.
◆ configure_explicit_step()
| void MeltPoolDG::TimeIntegration::ImplicitExplicitIntegrator< dim, number >::configure_explicit_step | ( | ExplicitRhsFunctionType | explicit_rhs | ) |
Configure the function used to compute the explicit right-hand side.
Sets the class member explicit_compute_rhs to the provided function. For details on the expected function signature and behavior, see the documentation of the corresponding class member.
- Parameters
-
explicit_rhs Function to compute the right-hand side in the explicit step.
◆ configure_implicit_step()
| void MeltPoolDG::TimeIntegration::ImplicitExplicitIntegrator< dim, number >::configure_implicit_step | ( | JacobianType | jacobian, |
| ResidualType | residual, | ||
| DistributeConstraintsType | constraints = [](VectorType &) {} |
||
| ) |
Configure the functions used by the internal nonlinear solver to solve the implicit step. For details on the functions see the corresponding class member descriptions.
Sets the class member compute_jacobian, compute_residual and distribute_constraints to the provided functions. For details on the expected function signatures and behavior, see the documentation of the corresponding class member.
- Parameters
-
jacobian Function used to apply the Jacobian to a vector. residual Function used to compute the residual. constraints Function used to apply constraints to a vector.
- Note
- If a custom solver has already been set by calling configure_implicit_step(CustomSolverType) this function has no effect.
◆ configure_implicit_step_wo_internal_nonlinear_solver()
| void MeltPoolDG::TimeIntegration::ImplicitExplicitIntegrator< dim, number >::configure_implicit_step_wo_internal_nonlinear_solver | ( | CustomSolverType | custom_solver_in | ) |
Configure a custom solver function used to solve the implicit step.
If this function is called the integrator will not use its internal nonlinear solver. For details on the functions see the corresponding class member descriptions.
Sets the class member custom_solver to the provided function. For details on the expected function signature and behavior, see the documentation of the corresponding class member.
- Parameters
-
custom_solver_in Custom solver function to be used in the implicit step.
◆ perform_time_step()
|
overridevirtual |
Perform a single time step by first computing an intermediate explicit solution using an explicit Euler step for the part of the pde which is treated explicitly. The explicit step is followed by an implicit Euler step for the implicit part of the PDE resulting in the solution at the new time step.
- Parameters
-
current_time Current time. time_step Current time step size. solution_history Solution history object providing the current and all required previous solutions. stage_pre_processing Function which is executed before the explicit step. stage_post_processing Function which is executed after the solution at the new time step has been computed.
Implements MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >.
◆ reinit() [1/2]
|
overridevirtual |
Sets up the necessary internal data structures by internally calling reinit(solution_history.get_current_solution()).
Reimplemented from MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >.
◆ reinit() [2/2]
|
overridevirtual |
Allocate memory for the required vectors used during the integration. This function needs to be called once before the function perform_time_step() can be called.
- Parameters
-
vector_template Reference vector used to define the partitioning for all internal vectors.
Implements MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >.
◆ required_solution_history_size()
|
overridevirtual |
Returns the number of previous solutions, that is solutions at time step n - x, where x >= 0, required by the time integrator.
Implements MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >.
◆ set_preconditioner()
| void MeltPoolDG::TimeIntegration::ImplicitExplicitIntegrator< dim, number >::set_preconditioner | ( | Preconditioner< dim, VectorType, number > && | preconditioner_in | ) |
Set the preconditioner used in the linear solver of the implicit step. If this function is never called an identity preconditioner is used.
- Parameters
-
preconditioner_in Preconditioner to be used in the linear solver of the implicit step.
- Note
- The precondiitioner is only used for the default internal solver of the class. If a custom solver function is set it is not used at all.
Member Data Documentation
◆ compute_jacobian
|
private |
Apply the Jacobian of the residual operator to a given vector.
This function computes the action of the Jacobian, associated with the residual
\[ R = \frac{y^{n+1} - \tilde{y}}{\Delta t} - G(y^{n+1}), \]
on the input vector src and stores the result in dst.
Function Signature:
Parameters:
time: Current simulation time \(t^n\).time_step: Current time step size \(\Delta t\).dst: Destination vector to store the Jacobian–vector product.src: Input vector to which the Jacobian is applied.
- Note
- This function is only used if the internal nonlinear solver of the class is used.
◆ compute_residual
|
private |
Compute the negative residual for the implicit step of the time integrator.
Assuming that the explicit part of the update
\[ \tilde{y} = y^{n} + \Delta t F(y^{n}) \]
has already been computed and is provided as explicit_step_solution, this function evaluates the residual of the implicit equation
\[ R = \frac{y^{n+1} - \tilde{y}}{\Delta t} - G(y^{n+1}), \]
and returns its negative, i.e., \( -R \). The negative residual is required directly by the internal nonlinear solver.
Function Signature:
Parameters:
time: Current simulation time \(t^n\).time_step: Current time step size \(\Delta t\).dst: Destination vector to store the negative residual.src: Current solution vector, i.e., \( y^{n+1} \).explicit_step_solution: Result \(\tilde{y}\) from the explicit step. This vector may be modified safely, as it will be overwritten during the next integration step.
- Note
- This function is only used if the internal nonlinear solver of the class is used.
◆ custom_solver
|
private |
Solve the implicit step of the implicit–explicit scheme.
For an ODE of the form
\[ \dot{y} = F(y) + G(y), \]
where \(F\) is treated explicitly and \(G\) implicitly, this function advances the solution by one time step.
Having already computed the explicit part
\[ \tilde{y} = y^{n} + \Delta t F(y^{n}), \]
the function solves the implicit equation
\[ y^{n+1} = \tilde{y} + \Delta t G(y^{n+1}), \]
to obtain the new solution \(y^{n+1}\).
Function Signature:
Parameters:
time: Current simulation time at \(t^{n+1}\).time_step: Current step size \(\Delta t\).explicit_step_solution: Result \(\tilde{y}\) from the explicit step. May be safely modified since it will be overwritten in the next step.solution: Solution vector \(y^{n+1}\) at the new time step. On input, contains the previous solution \(y^n\); on output, the updated solution \(y^{n+1}\).
◆ distribute_constraints
|
private |
Apply constraints to a given vector.
This function enforces problem-specific constraints (e.g., boundary conditions or degrees of freedom restrictions) directly on the input vector dst.
Function Signature:
Parameters:
dst: Vector to which the constraints are applied (modified in place).
- Note
- This function is only used if the internal nonlinear solver of the class is used.
◆ explicit_compute_rhs
|
private |
Explicit right-hand side function for the ODE system
\[ y' = F(y) + G(y), \]
where \(F\) is treated explicitly and \(G\) implicitly. This function computes the explicit part \(F(y)\).
Function Signature:
Parameters:
time: Current simulation time at \(t^n\).time_step: Current step size \(\Delta t\).dst: Destination vector for the explicit RHS contribution.src: Source solution vector \(y^n\).zero_dst_vec: Iftrue, zero outdstbefore adding contributions. This allows efficient accumulation while computing values.post: Post-processing function applied after computing the RHS. Receives a range of global indices[begin, end)to process, ensuring all indices are handled. Designed for efficient integration with deal.II’s matrix-free framework.
◆ intermediate_explicit_solution
|
private |
Vector to store the solution of the explicit step.
◆ n_steps_performed
|
private |
Number of time steps already performed by the integrator.
◆ preconditioner
|
private |
Preconditioner for the linear solver used within each nonlinear solver iteration.
◆ preconditioner_update_flag
|
private |
Boolean to indicate whether the preconditioner needs to be updated before the next solve.
◆ solver
|
private |
Nonlinear solver used when no custom solver is provided.
The documentation for this class was generated from the following files:
- include/meltpooldg/time_integration/implicit_explicit_integrator.hpp
- source/time_integration/implicit_explicit_integrator.cpp
Generated by
Public Member Functions inherited from