DGOperatorImplicit< 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 time integration. More...
#include <dg_operator_implicit.hpp>
Public Types | |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| using | ConservedVariables = ConservedVariablesType< dim, number > |
| using | ConservedVariablesGradient = ConservedVariablesGradientType< dim, number > |
Public Member Functions | |
| DGOperatorImplicit (OperationScratchData< dim, number > &flow_scratch_data) | |
| Constructor. | |
| 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 | 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 | apply_jacobian (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 &old_solution) const |
| Compute the negative residual. | |
| 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 int 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 int q_index) const |
| Local boundary face operations at the given quadrature point for computing the Jacobian. | |
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 | apply_jacobian_analytic (const VectorType &src, VectorType &dst) const |
| Compute the result of J*x, where J is the Jacobian computed analytically. | |
| void | apply_jacobian_finite_differences (const VectorType &src, VectorType &dst) const |
| Compute the result of J*x, where J is the Jacobian approximated by finite differences. | |
| 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 cell 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 applier 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 cell contribution of the Jacobian. | |
| 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 inner face contribution of the Jacobian. | |
| 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 boundary face contribution of the Jacobian. | |
Private Attributes | |
| const VectorType * | time_integrator_old_solution = nullptr |
| VectorType | disturbed_residual |
| number | current_time_step |
| OperationScratchData< dim, number > & | flow_scratch_data |
| Scratch data for compressible flows. | |
| TimeIntegration::BDFIntegrator< 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_residual |
| std::vector< std::shared_ptr< ExternalFlowForceJacobian< dim, number > > > | external_forces_jacobian |
Detailed Description
class MeltPoolDG::CompressibleFlow::DGOperatorImplicit< dim, number, is_viscous >
Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation for implicit 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::DGOperatorImplicit< dim, number, is_viscous >::ConservedVariables = ConservedVariablesType<dim, number> |
◆ ConservedVariablesGradient
| using MeltPoolDG::CompressibleFlow::DGOperatorImplicit< dim, number, is_viscous >::ConservedVariablesGradient = ConservedVariablesGradientType<dim, number> |
◆ VectorType
| using MeltPoolDG::CompressibleFlow::DGOperatorImplicit< dim, number, is_viscous >::VectorType = dealii::LinearAlgebra::distributed::Vector<number> |
Constructor & Destructor Documentation
◆ DGOperatorImplicit()
|
explicit |
Constructor.
- Parameters
-
flow_scratch_data Reference to the flow scratch data object (usually owned by the corresponding operation class).
Member Function Documentation
◆ add_external_force()
|
override |
◆ advance_time_step()
|
overridevirtual |
Advances solver by a single time step.
This function performs a single implicit 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::DGOperatorImplicit< dim, number, is_viscous >::apply_jacobian | ( | 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.
◆ apply_jacobian_analytic()
|
private |
Compute the result of J*x, where J is the Jacobian computed analytically.
- 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.
◆ apply_jacobian_finite_differences()
|
private |
Compute the result of J*x, where J is the Jacobian approximated by finite differences.
- 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.
◆ compute_inverse_diagonal_from_matrixfree()
| void MeltPoolDG::CompressibleFlow::DGOperatorImplicit< 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::DGOperatorImplicit< dim, number, is_viscous >::compute_residual | ( | number | current_time, |
| number | time_step, | ||
| const VectorType & | src, | ||
| VectorType & | dst, | ||
| const VectorType & | old_solution | ||
| ) | const |
Compute the negative residual.
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 occuring 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::DGOperatorImplicit< 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 Spars matrix in which the resulting matrix representation is stored.
◆ local_boundary_face_jacobian()
|
private |
Computes the boundary face contribution of the Jacobian.
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::DGOperatorImplicit< 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 int | 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 varibales on the inner face. q_index Quadrature point index.
◆ local_boundary_face_residual()
|
private |
The local cell applier 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_jacobian()
|
private |
Computes the cell contribution of the Jacobian.
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::DGOperatorImplicit< 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_jacobian()
|
private |
Computes the inner face contribution of the Jacobian.
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::DGOperatorImplicit< 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 int | 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 varibales on the inner face. phi_p Cell integrator for the primary varibales on the outer face. q_index Quadrature point index.
◆ local_face_residual()
|
private |
The local cell 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.
◆ 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 >.
Member Data Documentation
◆ convective_terms
|
private |
Object for the convective term evaluations.
◆ current_time_step
|
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_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_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.
◆ time_integrator
|
private |
Time integrator class used for the time integration.
◆ time_integrator_old_solution
|
mutableprivate |
This vector is used to compute the temporal derivative y' in the residual computation by y'=(current_solution-old_solution)/dt. We do not take the old_solution directly from solution_history as providing the option to pass a (fictional) old solution can have performance advantages, e.g. in the bdf time integration. It can be set by the function set_stage_constants().
◆ 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.hpp
- source/compressible_flow/dg_operator_implicit.cpp
Generated by
Public Member Functions inherited from