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
10
11
13{
22 template <int dim, typename number>
24 {
25 public:
26 using VectorType = dealii::LinearAlgebra::distributed::Vector<number>;
29
37
44 void
45 reinit();
46
55 void
57 std::shared_ptr<ExternalFlowForce<dim, number>> external_force_residuum,
58 std::shared_ptr<ExternalFlowForceJacobian<dim, number>> external_force_jacobian);
59
65 void
67 dealii::TrilinosWrappers::SparseMatrix &sparse_matrix) const;
68
74 void
76
83 void
84 set_preconditioner_time_step(const number time_step)
85 {
86 current_time_step = time_step;
87 }
88
103 void
104 apply_jacobian(number time_step, VectorType &dst, const VectorType &src) const;
105
123 void
124 compute_residual(number current_time,
125 number time_step,
126 const VectorType &src,
127 VectorType &dst,
128 const VectorType &old_solution) const;
129
130
139 void
142 unsigned int q_index) const;
143
155 void
160 unsigned int q_index) const;
161
170 void
173 unsigned int q_index) const;
174
175 private:
181 mutable const VectorType *time_integrator_old_solution = nullptr;
182
186
189 mutable number current_time_step;
190
193
196
199
202 std::vector<std::shared_ptr<ExternalFlowForce<dim, number>>> external_forces_residual;
203
206 std::vector<std::shared_ptr<ExternalFlowForceJacobian<dim, number>>> external_forces_jacobian;
207
210 const bool is_viscous;
211
220 void
221 apply_jacobian_analytic(const VectorType &src, VectorType &dst) const;
222
231 void
233
242 void
243 local_cell_residual(const dealii::MatrixFree<dim, number> &matrix_free,
244 dealii::LinearAlgebra::distributed::Vector<number> &dst,
245 const dealii::LinearAlgebra::distributed::Vector<number> &src,
246 const std::pair<unsigned int, unsigned int> &cell_range) const;
247
256 void
257 local_face_residual(const dealii::MatrixFree<dim, number> &matrix_free,
258 dealii::LinearAlgebra::distributed::Vector<number> &dst,
259 const dealii::LinearAlgebra::distributed::Vector<number> &src,
260 const std::pair<unsigned int, unsigned int> &face_range) const;
261
270 void
271 local_boundary_face_residual(const dealii::MatrixFree<dim, number> &matrix_free,
272 dealii::LinearAlgebra::distributed::Vector<number> &dst,
273 const dealii::LinearAlgebra::distributed::Vector<number> &src,
274 const std::pair<unsigned int, unsigned int> &face_range) const;
275
288 void
289 local_cell_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
290 VectorType &dst,
291 const VectorType &src,
292 const std::pair<unsigned int, unsigned int> &cell_range) const;
293
306 void
307 local_face_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
308 VectorType &dst,
309 const VectorType &src,
310 const std::pair<unsigned int, unsigned int> &face_range) const;
311
325 void
326 local_boundary_face_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
327 dealii::LinearAlgebra::distributed::Vector<number> &dst,
328 const dealii::LinearAlgebra::distributed::Vector<number> &src,
329 const std::pair<unsigned int, unsigned int> &face_range) const;
330 };
331} // namespace MeltPoolDG::CompressibleFlow
Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation for imp...
Definition dg_operator_implicit.hpp:24
ConservedVariablesType< dim, number > ConservedVariables
Definition dg_operator_implicit.hpp:27
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:409
void reinit()
Reinitialize the internal data structures.
Definition dg_operator_implicit.cpp:25
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:623
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:197
OperationScratchData< dim, number > & flow_scratch_data
Scratch data for compressible flows.
Definition dg_operator_implicit.hpp:192
ConservedVariablesGradientType< dim, number > ConservedVariablesGradient
Definition dg_operator_implicit.hpp:28
number current_time_step
Definition dg_operator_implicit.hpp:189
void add_external_force(std::shared_ptr< ExternalFlowForce< dim, number > > external_force_residuum, std::shared_ptr< ExternalFlowForceJacobian< dim, number > > external_force_jacobian)
Definition dg_operator_implicit.cpp:34
const VectorType * time_integrator_old_solution
Definition dg_operator_implicit.hpp:181
void set_preconditioner_time_step(const number time_step)
Definition dg_operator_implicit.hpp:84
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:518
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:477
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:150
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:84
VectorType disturbed_residual
Definition dg_operator_implicit.hpp:185
ConvectiveKernels< dim, number > convective_terms
Object for the convective term evaluations.
Definition dg_operator_implicit.hpp:195
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:255
void compute_system_matrix_from_matrixfree(dealii::TrilinosWrappers::SparseMatrix &sparse_matrix) const
Compute the matrix representation of the Jacobian.
Definition dg_operator_implicit.cpp:47
void compute_inverse_diagonal_from_matrixfree(VectorType &diagonal) const
Compute the inverse elements of the diagonal of the Jacobian.
Definition dg_operator_implicit.cpp:62
const bool is_viscous
Definition dg_operator_implicit.hpp:210
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:320
std::vector< std::shared_ptr< ExternalFlowForce< dim, number > > > external_forces_residual
Definition dg_operator_implicit.hpp:202
std::vector< std::shared_ptr< ExternalFlowForceJacobian< dim, number > > > external_forces_jacobian
Definition dg_operator_implicit.hpp:206
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:133
dealii::LinearAlgebra::distributed::Vector< number > VectorType
Definition dg_operator_implicit.hpp:26
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:564
ViscousKernels< dim, number > viscous_terms
Object for the viscous term evaluations.
Definition dg_operator_implicit.hpp:198
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:366
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:108
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:131
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