include/meltpooldg/compressible_flow/dg_operator_implicit.hpp Source File

Developer Documentation: include/meltpooldg/compressible_flow/dg_operator_implicit.hpp Source File
Developer Documentation
dg_operator_implicit.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/lac/la_parallel_vector.h>
4
12
13
15{
24 template <int dim, typename number, bool is_viscous = true>
25 class DGOperatorImplicit final : public DGOperatorBase<dim, number>
26 {
27 public:
28 using VectorType = dealii::LinearAlgebra::distributed::Vector<number>;
31
39
46 void
47 reinit() override;
48
60 void
61 advance_time_step(number time, number time_step) override;
62
63 void
65 std::shared_ptr<ExternalFlowForce<dim, number>> external_force_residuum,
66 std::shared_ptr<ExternalFlowForceJacobian<dim, number>> external_force_jacobian) override;
67
73 void
75 dealii::TrilinosWrappers::SparseMatrix &sparse_matrix) const;
76
82 void
84
98 void
99 apply_jacobian(number time_step,
100 VectorType &dst,
101 const VectorType &src) const; // TODO
102
118 void
119 compute_residual(number current_time,
120 number time_step,
121 const VectorType &src,
122 VectorType &dst,
123 const VectorType &old_solution) const; // TODO
124
125
135 void
138 unsigned int q_index) const;
139
151 void
156 unsigned int q_index) const;
157
166 void
169 unsigned int q_index) const;
170
171 private:
177 mutable const VectorType *time_integrator_old_solution = nullptr;
178
182
185 mutable number current_time_step;
186
189
192
195
198
201 std::vector<std::shared_ptr<ExternalFlowForce<dim, number>>> external_forces_residual;
202
205 std::vector<std::shared_ptr<ExternalFlowForceJacobian<dim, number>>> external_forces_jacobian;
206
215 void
216 apply_jacobian_analytic(const VectorType &src, VectorType &dst) const;
217
226 void
228
237 void
238 local_cell_residual(const dealii::MatrixFree<dim, number> &matrix_free,
239 dealii::LinearAlgebra::distributed::Vector<number> &dst,
240 const dealii::LinearAlgebra::distributed::Vector<number> &src,
241 const std::pair<unsigned int, unsigned int> &cell_range) const;
242
251 void
252 local_face_residual(const dealii::MatrixFree<dim, number> &matrix_free,
253 dealii::LinearAlgebra::distributed::Vector<number> &dst,
254 const dealii::LinearAlgebra::distributed::Vector<number> &src,
255 const std::pair<unsigned int, unsigned int> &face_range) const;
256
265 void
266 local_boundary_face_residual(const dealii::MatrixFree<dim, number> &matrix_free,
267 dealii::LinearAlgebra::distributed::Vector<number> &dst,
268 const dealii::LinearAlgebra::distributed::Vector<number> &src,
269 const std::pair<unsigned int, unsigned int> &face_range) const;
270
283 void
284 local_cell_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
285 VectorType &dst,
286 const VectorType &src,
287 const std::pair<unsigned int, unsigned int> &cell_range) const;
288
301 void
302 local_face_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
303 VectorType &dst,
304 const VectorType &src,
305 const std::pair<unsigned int, unsigned int> &face_range) const;
306
320 void
321 local_boundary_face_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
322 dealii::LinearAlgebra::distributed::Vector<number> &dst,
323 const dealii::LinearAlgebra::distributed::Vector<number> &src,
324 const std::pair<unsigned int, unsigned int> &face_range) const;
325 };
326} // namespace MeltPoolDG::CompressibleFlow
Interface of the compressible flow operator interacting with the compressible flow operation.
Definition dg_operator_base.hpp:15
Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation for imp...
Definition dg_operator_implicit.hpp:26
void advance_time_step(number time, number time_step) override
Advances solver by a single time step.
Definition dg_operator_implicit.cpp:48
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.
Definition dg_operator_implicit.cpp:598
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.
Definition dg_operator_implicit.cpp:657
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.
Definition dg_operator_implicit.cpp:184
OperationScratchData< dim, number > & flow_scratch_data
Scratch data for compressible flows.
Definition dg_operator_implicit.hpp:188
void compute_inverse_diagonal_from_matrixfree(VectorType &diagonal) const
Compute the inverse elements of the diagonal of the Jacobian.
Definition dg_operator_implicit.cpp:94
void add_external_force(std::shared_ptr< ExternalFlowForce< dim, number > > external_force_residuum, std::shared_ptr< ExternalFlowForceJacobian< dim, number > > external_force_jacobian) override
Definition dg_operator_implicit.cpp:66
std::vector< std::shared_ptr< ExternalFlowForceJacobian< dim, number > > > external_forces_jacobian
Definition dg_operator_implicit.hpp:205
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.
Definition dg_operator_implicit.cpp:232
std::vector< std::shared_ptr< ExternalFlowForce< dim, number > > > external_forces_residual
Definition dg_operator_implicit.hpp:201
void apply_jacobian_analytic(const VectorType &src, VectorType &dst) const
Compute the result of J*x, where J is the Jacobian computed analytically.
Definition dg_operator_implicit.cpp:167
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.
Definition dg_operator_implicit.cpp:552
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.
Definition dg_operator_implicit.cpp:511
ViscousKernels< dim, number > viscous_terms
Object for the viscous term evaluations.
Definition dg_operator_implicit.hpp:197
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.
Definition dg_operator_implicit.cpp:354
VectorType disturbed_residual
Definition dg_operator_implicit.hpp:181
ConservedVariablesGradientType< dim, number > ConservedVariablesGradient
Definition dg_operator_implicit.hpp:30
ConvectiveKernels< dim, number > convective_terms
Object for the convective term evaluations.
Definition dg_operator_implicit.hpp:194
number current_time_step
Definition dg_operator_implicit.hpp:185
TimeIntegration::BDFIntegrator< dim, number > time_integrator
Time integrator class used for the time integration.
Definition dg_operator_implicit.hpp:191
const VectorType * time_integrator_old_solution
Definition dg_operator_implicit.hpp:177
void reinit() override
Reinitialize the internal data structures.
Definition dg_operator_implicit.cpp:37
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.
Definition dg_operator_implicit.cpp:442
void compute_system_matrix_from_matrixfree(dealii::TrilinosWrappers::SparseMatrix &sparse_matrix) const
Compute the matrix representation of the Jacobian.
Definition dg_operator_implicit.cpp:79
void apply_jacobian(number time_step, VectorType &dst, const VectorType &src) const
Compute the result of J*x, where J is the Jacobian.
Definition dg_operator_implicit.cpp:141
void compute_residual(number current_time, number time_step, const VectorType &src, VectorType &dst, const VectorType &old_solution) const
Compute the negative residual.
Definition dg_operator_implicit.cpp:116
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.
Definition dg_operator_implicit.cpp:292
dealii::LinearAlgebra::distributed::Vector< number > VectorType
Definition dg_operator_implicit.hpp:28
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.
Definition dg_operator_implicit.cpp:399
ConservedVariablesType< dim, number > ConservedVariables
Definition dg_operator_implicit.hpp:29
Definition bdf_time_integration.hpp:30
This file contains various functions that can be used to set and evaluate boundary conditions for the...
Definition boundary_condition_functions.hpp:17
dealii::Tensor< 1, n_conserved_variables< dim, n_species >, dealii::Tensor< 1, dim, VectorizedArrayType > > ConservedVariablesGradientType
Definition data_types.hpp:44
dealii::Tensor< 1, n_conserved_variables< dim, n_species >, VectorizedArrayType > ConservedVariablesType
Definition data_types.hpp:35
dealii::FEFaceEvaluation< dim, -1, 0, n_components, number, VectorizedArrayType > FEFaceIntegrator
Definition fe_integrator.hpp:22
dealii::FEEvaluation< dim, -1, 0, n_components, number, VectorizedArrayType > FECellIntegrator
Definition fe_integrator.hpp:14
Convective kernel operations for compressible flow solvers.
Definition convective_kernels.hpp:39
An abstract interface for defining external forces acting on the fluid that must be evaluated and inc...
Definition utils.hpp:117
Scratch data structure for compressible single-phase flow solvers.
Definition operation_scratch_data.hpp:33
Viscous kernel operations for compressible flow solvers.
Definition viscous_kernels.hpp:31