DGOperatorImplicitExplicit< dim, number, is_viscous > Class Template Reference
|
Developer Documentation
|
Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation for implicit-explicit time integration. More...
#include <dg_operator_implicit_explicit.hpp>
Public Types | |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| using | ConservedVariables = ConservedVariablesType< dim, number > |
| using | ConservedVariablesGradient = ConservedVariablesGradientType< dim, number > |
Public Member Functions | |
| DGOperatorImplicitExplicit (OperationScratchData< dim, number > &flow_scratch_data) | |
| Constructor. | |
| void | add_external_force (std::shared_ptr< ExternalFlowForce< dim, number > > external_force_residuum, std::shared_ptr< ExternalFlowForceJacobian< dim, number > > external_force_jacobian) override |
| void | compute_system_matrix_from_matrixfree (dealii::TrilinosWrappers::SparseMatrix &sparse_matrix) const |
| Compute the matrix representation of the Jacobian. | |
| void | compute_inverse_diagonal_from_matrixfree (VectorType &diagonal) const |
| Compute the inverse elements of the diagonal of the Jacobian. | |
| void | reinit () override |
| Reinitialize the internal data structures. | |
| void | advance_time_step (number time, number time_step) override |
| Advances solver by a single time step. | |
| void | local_cell_jacobian_kernel (FECellIntegrator< dim, dim+2, number > &delta_phi, const FECellIntegrator< dim, dim+2, number > &phi, unsigned int q_index) const |
| Local cell operations at the given quadrature point for computing the Jacobian. | |
| void | local_face_jacobian_kernel (FEFaceIntegrator< dim, dim+2, number > &delta_phi_m, FEFaceIntegrator< dim, dim+2, number > &delta_phi_p, const FEFaceIntegrator< dim, dim+2, number > &phi_m, const FEFaceIntegrator< dim, dim+2, number > &phi_p, unsigned q_index) const |
| Local face operations at the given quadrature point for computing the Jacobian. | |
| void | local_boundary_face_jacobian_kernel (FEFaceIntegrator< dim, dim+2, number > &delta_phi_m, const FEFaceIntegrator< dim, dim+2, number > &phi_m, unsigned q_index) const |
| Local boundary face operations at the given quadrature point for computing the Jacobian. | |
| void | set_stage_constants (number current_time, number time_step, const VectorType &intermediate_explicit_solution_in, number rhs_scaling_factor=1.) const |
| This function sets class member variables which are constant within a single time stage (e.g. boundary conditions) and used in both the residual and jacobian calculation. | |
| void | perform_explicit_stage (number current_time, number time_step, VectorType &dst, const VectorType &src, bool zero_dst_vec, const std::function< void(unsigned, unsigned)> &post) const |
| Perform the explicit step to get an intermediate solution. | |
| void | apply_jacobian (number time, number time_step, VectorType &dst, const VectorType &src) const |
| Compute the result of J*x, where J is the Jacobian. | |
| void | compute_residual (number current_time, number time_step, const VectorType &src, VectorType &dst, const VectorType &explicit_solution) const |
| Compute the negative residual, i.e. -(y'-F(y)) where y' is the temporal derivative of the primary variables and F is the sum of all fluxes occurring in the compressible Navier-Stokes equations (right-hand side). | |
Public Member Functions inherited from MeltPoolDG::CompressibleFlow::DGOperatorBase< dim, number, n_species > | |
| virtual | ~DGOperatorBase ()=default |
| virtual void | add_external_force (std::shared_ptr< ExternalFlowForce< dim, number, n_species > > external_force_residuum, std::shared_ptr< ExternalFlowForceJacobian< dim, number, n_species > > external_force_jacobian)=0 |
Private Member Functions | |
| void | local_cell_explicit_stage (const dealii::MatrixFree< dim, number > &matrix_free, dealii::LinearAlgebra::distributed::Vector< number > &dst, const dealii::LinearAlgebra::distributed::Vector< number > &src, const std::pair< unsigned int, unsigned int > &cell_range) const |
| The local cell applier for computing the intermediate explicit stage. | |
| void | local_face_explicit_stage (const dealii::MatrixFree< dim, number > &matrix_free, dealii::LinearAlgebra::distributed::Vector< number > &dst, const dealii::LinearAlgebra::distributed::Vector< number > &src, const std::pair< unsigned int, unsigned int > &face_range) const |
| The local face applier for computing the intermediate explicit stage. | |
| void | local_boundary_face_explicit_stage (const dealii::MatrixFree< dim, number > &matrix_free, dealii::LinearAlgebra::distributed::Vector< number > &dst, const dealii::LinearAlgebra::distributed::Vector< number > &src, const std::pair< unsigned int, unsigned int > &face_range) const |
| The local boundary face applier for computing the intermediate explicit stage. | |
| void | local_cell_residual (const dealii::MatrixFree< dim, number > &matrix_free, dealii::LinearAlgebra::distributed::Vector< number > &dst, const dealii::LinearAlgebra::distributed::Vector< number > &src, const std::pair< unsigned int, unsigned int > &cell_range) const |
| The local cell applier computing the residual contribution of the cell. | |
| void | local_face_residual (const dealii::MatrixFree< dim, number > &matrix_free, dealii::LinearAlgebra::distributed::Vector< number > &dst, const dealii::LinearAlgebra::distributed::Vector< number > &src, const std::pair< unsigned int, unsigned int > &face_range) const |
| The local face applier computing the residual contribution of the inner faces. | |
| void | local_boundary_face_residual (const dealii::MatrixFree< dim, number > &matrix_free, dealii::LinearAlgebra::distributed::Vector< number > &dst, const dealii::LinearAlgebra::distributed::Vector< number > &src, const std::pair< unsigned int, unsigned int > &face_range) const |
| The local cell boundary face computing the residual contribution of the boundary faces. | |
| void | local_cell_jacobian (const dealii::MatrixFree< dim, number > &matrix_free, VectorType &dst, const VectorType &src, const std::pair< unsigned int, unsigned int > &cell_range) const |
| Computes the contribution of the cells to the product of the Jacobian and the provided source vector for a specified cell range. | |
| void | local_face_jacobian (const dealii::MatrixFree< dim, number > &matrix_free, VectorType &dst, const VectorType &src, const std::pair< unsigned int, unsigned int > &face_range) const |
| Computes the contribution of the inner faces to the product of the Jacobian and the provided source vector for a specified face range. | |
| void | local_boundary_face_jacobian (const dealii::MatrixFree< dim, number > &matrix_free, dealii::LinearAlgebra::distributed::Vector< number > &dst, const dealii::LinearAlgebra::distributed::Vector< number > &src, const std::pair< unsigned int, unsigned int > &face_range) const |
| Computes the contribution of the boundary faces to the product of the Jacobian and the provided source vector for a specified face range. | |
Private Attributes | |
| const VectorType * | intermediate_explicit_solution = nullptr |
| Pointer to an intermediate explicit solution vector. | |
| VectorType | disturbed_residual |
| number | current_time_increment |
| OperationScratchData< dim, number > & | flow_scratch_data |
| Scratch data for compressible flows. | |
| TimeIntegration::ImplicitExplicitIntegrator< dim, number > | time_integrator |
| Time integrator class used for the time integration. | |
| ConvectiveKernels< dim, number > | convective_terms |
| Object for the convective term evaluations. | |
| ViscousKernels< dim, number > | viscous_terms |
| Object for the viscous term evaluations. | |
| std::vector< std::shared_ptr< ExternalFlowForce< dim, number > > > | external_forces_explicit_rhs |
| std::vector< std::shared_ptr< ExternalFlowForce< dim, number > > > | external_forces_implicit_residual |
| std::vector< std::shared_ptr< ExternalFlowForceJacobian< dim, number > > > | external_forces_implicit_jacobian |
Detailed Description
class MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >
Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation for implicit-explicit time integration.
- Template Parameters
-
dim Dimension of the considered simulation case. number Floating point format type. is_viscous Indicates whether the flow is viscous.
Member Typedef Documentation
◆ ConservedVariables
| using MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::ConservedVariables = ConservedVariablesType<dim, number> |
◆ ConservedVariablesGradient
| using MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::ConservedVariablesGradient = ConservedVariablesGradientType<dim, number> |
◆ VectorType
| using MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::VectorType = dealii::LinearAlgebra::distributed::Vector<number> |
Constructor & Destructor Documentation
◆ DGOperatorImplicitExplicit()
|
explicit |
Constructor.
- Parameters
-
flow_scratch_data Reference to flow scratch data object.
Member Function Documentation
◆ add_external_force()
|
override |
◆ advance_time_step()
|
overridevirtual |
Advances solver by a single time step.
This function performs a single implicit-explicit time step of size time_step starting from the solution at time time.
- Note
- The function does not take care about updating the solution history object or similar operations which are not directly related to the integration. It only advances the solution by a single time step starting from the current solution in the solution history object of the flow_scratch_data object.
Implements MeltPoolDG::CompressibleFlow::DGOperatorBase< dim, number, n_species >.
◆ apply_jacobian()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::apply_jacobian | ( | number | time, |
| number | time_step, | ||
| VectorType & | dst, | ||
| const VectorType & | src | ||
| ) | const |
Compute the result of J*x, where J is the Jacobian.
The method on how to compute/approximate the jacobian is defined by the user in the compressible flow data.
- Parameters
-
src Source vector x with which the jacobian gets multiplied. dst Location at which the result of J*x is stored.
- Exceptions
-
Exception if the layout of the two given vectors srcanddstare not identical.
- Note
- This function assumes that the function set_stage_constants() has been called in advance.
◆ compute_inverse_diagonal_from_matrixfree()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::compute_inverse_diagonal_from_matrixfree | ( | VectorType & | diagonal | ) | const |
Compute the inverse elements of the diagonal of the Jacobian.
- Parameters
-
diagonal Vector in which the inverse elements of the diagonal are stored.
◆ compute_residual()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::compute_residual | ( | number | current_time, |
| number | time_step, | ||
| const VectorType & | src, | ||
| VectorType & | dst, | ||
| const VectorType & | explicit_solution | ||
| ) | const |
Compute the negative residual, i.e. -(y'-F(y)) where y' is the temporal derivative of the primary variables and F is the sum of all fluxes occurring in the compressible Navier-Stokes equations (right-hand side).
- Parameters
-
current_time Current physical time. src Current solution vector used to compute the residual. dst Vector in which the residual is stored.
- Exceptions
-
Assert if the layout of the two given vectors srcanddstare not identical.
- Note
- This function assumes that the function set_stage_constants() has been called in advance.
◆ compute_system_matrix_from_matrixfree()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::compute_system_matrix_from_matrixfree | ( | dealii::TrilinosWrappers::SparseMatrix & | sparse_matrix | ) | const |
Compute the matrix representation of the Jacobian.
- Parameters
-
sparse_matrix Sparse matrix in which the resulting matrix representation is stored.
◆ local_boundary_face_explicit_stage()
|
private |
The local boundary face applier for computing the intermediate explicit stage.
- Parameters
-
matrix_free Matrix free object on which the applier works on. dst Destination vector to which the result is added. src Current solution. face_range Face range which is considered in the applier.
◆ local_boundary_face_jacobian()
|
private |
Computes the contribution of the boundary faces to the product of the Jacobian and the provided source vector for a specified face range.
The current solution of the primary variables, required for the Jacobian computation, is retrieved from the solution_history object.
- Parameters
-
matrix_free The matrix-free object utilized by the applier. dst The destination vector to which the computed result is added. src The source vector to be multiplied with the Jacobian. face_range The range of faces considered by the applier.
◆ local_boundary_face_jacobian_kernel()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::local_boundary_face_jacobian_kernel | ( | FEFaceIntegrator< dim, dim+2, number > & | delta_phi_m, |
| const FEFaceIntegrator< dim, dim+2, number > & | phi_m, | ||
| unsigned | q_index | ||
| ) | const |
Local boundary face operations at the given quadrature point for computing the Jacobian.
- Parameters
-
delta_phi_m Face integrator for the change in the primary variables on the inner face. Quadrature point distributions are added to this integrator. phi_m Cell integrator for the primary variables on the inner face. q_index Quadrature point index.
◆ local_boundary_face_residual()
|
private |
The local cell boundary face computing the residual contribution of the boundary faces.
- Parameters
-
matrix_free Matrix free object on which the applier works on. dst Destination vector to which the result is added. src Current solution. face_range Face range which is considered in the applier.
◆ local_cell_explicit_stage()
|
private |
The local cell applier for computing the intermediate explicit stage.
- Parameters
-
matrix_free Matrix free object on which the applier works on. dst Destination vector to which the result is added. src Current solution. cell_range Cell range which is considered in the applier.
◆ local_cell_jacobian()
|
private |
Computes the contribution of the cells to the product of the Jacobian and the provided source vector for a specified cell range.
The current solution of the primary variables, required for the Jacobian computation, is retrieved from the solution_history object.
- Parameters
-
matrix_free The matrix-free object utilized by the applier. dst The destination vector to which the computed result is added. src The source vector to be multiplied with the Jacobian. cell_range The range of cells considered by the applier.
◆ local_cell_jacobian_kernel()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::local_cell_jacobian_kernel | ( | FECellIntegrator< dim, dim+2, number > & | delta_phi, |
| const FECellIntegrator< dim, dim+2, number > & | phi, | ||
| unsigned int | q_index | ||
| ) | const |
Local cell operations at the given quadrature point for computing the Jacobian.
- Parameters
-
delta_phi Cell integrator for the change in the primary variables. Quadrature point distributions are added to this integrator. phi Cell integrator for the primary variables. q_index Quadrature point index. cell_batch_id ID of the current cell batch.
◆ local_cell_residual()
|
private |
The local cell applier computing the residual contribution of the cell.
- Parameters
-
matrix_free Matrix free object on which the applier works on. dst Destination vector to which the result is added. src Current solution. cell_range Cell range which is considered in the applier.
◆ local_face_explicit_stage()
|
private |
The local face applier for computing the intermediate explicit stage.
- Parameters
-
matrix_free Matrix free object on which the applier works on. dst Destination vector to which the result is added. src Current solution. face_range Face range which is considered in the applier.
◆ local_face_jacobian()
|
private |
Computes the contribution of the inner faces to the product of the Jacobian and the provided source vector for a specified face range.
The current solution of the primary variables, required for the Jacobian computation, is retrieved from the solution_history object.
- Parameters
-
matrix_free The matrix-free object utilized by the applier. dst The destination vector to which the computed result is added. src The source vector to be multiplied with the Jacobian. face_range The range of faces considered by the applier.
◆ local_face_jacobian_kernel()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::local_face_jacobian_kernel | ( | FEFaceIntegrator< dim, dim+2, number > & | delta_phi_m, |
| FEFaceIntegrator< dim, dim+2, number > & | delta_phi_p, | ||
| const FEFaceIntegrator< dim, dim+2, number > & | phi_m, | ||
| const FEFaceIntegrator< dim, dim+2, number > & | phi_p, | ||
| unsigned | q_index | ||
| ) | const |
Local face operations at the given quadrature point for computing the Jacobian.
- Parameters
-
delta_phi_m Face integrator for the change in the primary variables on the inner face. Quadrature point distributions are added to this integrator. delta_phi_p Face integrator for the change in the primary variables on the outer face. Quadrature point distributions are added to this integrator. phi_m Cell integrator for the primary variables on the inner face. phi_p Cell integrator for the primary variables on the outer face. q_index Quadrature point index.
◆ local_face_residual()
|
private |
The local face applier computing the residual contribution of the inner faces.
- Parameters
-
matrix_free Matrix free object on which the applier works on. dst Destination vector to which the result is added. src Current solution. face_range Face range which is considered in the applier.
◆ perform_explicit_stage()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::perform_explicit_stage | ( | number | current_time, |
| number | time_step, | ||
| VectorType & | dst, | ||
| const VectorType & | src, | ||
| bool | zero_dst_vec, | ||
| const std::function< void(unsigned, unsigned)> & | post | ||
| ) | const |
Perform the explicit step to get an intermediate solution.
- Parameters
-
current_time Current physical time. time_step Current time step size. dst Destination vector. src Current solution vector used for the computations. zero_dst_vec Flag whether the vector dst will be set to zero inside the loop.
◆ reinit()
|
overridevirtual |
Reinitialize the internal data structures.
The reinitialization includes setting a new required size for the solution history object according to the demands of the used time integrator.
Implements MeltPoolDG::CompressibleFlow::DGOperatorBase< dim, number, n_species >.
◆ set_stage_constants()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicitExplicit< dim, number, is_viscous >::set_stage_constants | ( | number | current_time, |
| number | time_step, | ||
| const VectorType & | intermediate_explicit_solution_in, | ||
| number | rhs_scaling_factor = 1. |
||
| ) | const |
This function sets class member variables which are constant within a single time stage (e.g. boundary conditions) and used in both the residual and jacobian calculation.
A suitable time integrator class is expected to call this functions before a call to compute_residual() and compute_jacobian().
- Parameters
-
current_time Current physical time. time_step Current time step size. intermediate_explicit_solution_in Intermediate solution obtained by the explicit time step. rhs_scaling_factor Factor used to scale the rhs, i.e. the final residual is given by R=y'-a*f(y), where the variable 'a' is the passed factor.
Member Data Documentation
◆ convective_terms
|
private |
Object for the convective term evaluations.
◆ current_time_increment
|
mutableprivate |
Current time step size. This needs to be stored as this value is required by the local cell appliers.
◆ disturbed_residual
|
mutableprivate |
This vector is used in the approximation of the Jacobian by finite differences. Here the vector stores the residual with a disturbed input.
◆ external_forces_explicit_rhs
|
private |
This set of pointers may hold a list of external fluid force contributions to the explicitly treated part of the PDE (e.g., gravity or user-defined source terms)
◆ external_forces_implicit_jacobian
|
private |
This set of pointers may hold a list of external fluid force contributions to the jacobian (e.g., gravity or user-defined source terms)
◆ external_forces_implicit_residual
|
private |
This set of pointers may hold a list of external fluid force contributions to the residuum (e.g., gravity or user-defined source terms)
◆ flow_scratch_data
|
private |
Scratch data for compressible flows.
◆ intermediate_explicit_solution
|
mutableprivate |
Pointer to an intermediate explicit solution vector.
◆ time_integrator
|
private |
Time integrator class used for the time integration.
◆ viscous_terms
|
private |
Object for the viscous term evaluations.
The documentation for this class was generated from the following files:
- include/meltpooldg/compressible_flow/dg_operator_implicit_explicit.hpp
- source/compressible_flow/dg_operator_implicit_explicit.cpp
Generated by
Public Member Functions inherited from