include/meltpooldg/compressible_flow/dg_operator_implicit_explicit.hpp Source File

Developer Documentation: include/meltpooldg/compressible_flow/dg_operator_implicit_explicit.hpp Source File
Developer Documentation
dg_operator_implicit_explicit.hpp
Go to the documentation of this file.
1#pragma once
2
10
12{
21 template <int dim, typename number, bool is_viscous = true>
22 class DGOperatorImplicitExplicit final : public DGOperatorBase<dim, number>
23 {
24 public:
25 using VectorType = dealii::LinearAlgebra::distributed::Vector<number>;
28
35
36 void
38 std::shared_ptr<ExternalFlowForce<dim, number>> external_force_residuum,
39 std::shared_ptr<ExternalFlowForceJacobian<dim, number>> external_force_jacobian) override;
40
46 void
48 dealii::TrilinosWrappers::SparseMatrix &sparse_matrix) const;
49
55 void
57
64 void
65 reinit() override;
66
78 void
79 advance_time_step(number time, number time_step) override;
80
90 void
93 unsigned int q_index) const;
94
106 void
111 unsigned q_index) const;
112
121 void
124 unsigned q_index) const;
125
140 void
141 set_stage_constants(number current_time,
142 number time_step,
143 const VectorType &intermediate_explicit_solution_in,
144 number rhs_scaling_factor = 1.) const;
145
155 void
156 perform_explicit_stage(number current_time,
157 number time_step,
158 VectorType &dst,
159 const VectorType &src,
160 bool zero_dst_vec,
161 const std::function<void(unsigned, unsigned)> &post) const;
162
175 void
176 apply_jacobian(number time, number time_step, VectorType &dst, const VectorType &src) const;
177
190 void
191 compute_residual(number current_time,
192 number time_step,
193 const VectorType &src,
194 VectorType &dst,
195 const VectorType &explicit_solution) const;
196
197 private:
200
204
208
211
214
217
220
223 std::vector<std::shared_ptr<ExternalFlowForce<dim, number>>> external_forces_explicit_rhs;
224
227 std::vector<std::shared_ptr<ExternalFlowForce<dim, number>>> external_forces_implicit_residual;
228
231 std::vector<std::shared_ptr<ExternalFlowForceJacobian<dim, number>>>
233
242 void
243 local_cell_explicit_stage(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_explicit_stage(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
272 const dealii::MatrixFree<dim, number> &matrix_free,
273 dealii::LinearAlgebra::distributed::Vector<number> &dst,
274 const dealii::LinearAlgebra::distributed::Vector<number> &src,
275 const std::pair<unsigned int, unsigned int> &face_range) const;
276
285 void
286 local_cell_residual(const dealii::MatrixFree<dim, number> &matrix_free,
287 dealii::LinearAlgebra::distributed::Vector<number> &dst,
288 const dealii::LinearAlgebra::distributed::Vector<number> &src,
289 const std::pair<unsigned int, unsigned int> &cell_range) const;
290
299 void
300 local_face_residual(const dealii::MatrixFree<dim, number> &matrix_free,
301 dealii::LinearAlgebra::distributed::Vector<number> &dst,
302 const dealii::LinearAlgebra::distributed::Vector<number> &src,
303 const std::pair<unsigned int, unsigned int> &face_range) const;
304
313 void
314 local_boundary_face_residual(const dealii::MatrixFree<dim, number> &matrix_free,
315 dealii::LinearAlgebra::distributed::Vector<number> &dst,
316 const dealii::LinearAlgebra::distributed::Vector<number> &src,
317 const std::pair<unsigned int, unsigned int> &face_range) const;
318
331 void
332 local_cell_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
333 VectorType &dst,
334 const VectorType &src,
335 const std::pair<unsigned int, unsigned int> &cell_range) const;
336
349 void
350 local_face_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
351 VectorType &dst,
352 const VectorType &src,
353 const std::pair<unsigned int, unsigned int> &face_range) const;
354
367 void
368 local_boundary_face_jacobian(const dealii::MatrixFree<dim, number> &matrix_free,
369 dealii::LinearAlgebra::distributed::Vector<number> &dst,
370 const dealii::LinearAlgebra::distributed::Vector<number> &src,
371 const std::pair<unsigned int, unsigned int> &face_range) const;
372 };
373} // 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_explicit.hpp:23
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.
Definition dg_operator_implicit_explicit.cpp:362
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.
Definition dg_operator_implicit_explicit.cpp:310
std::vector< std::shared_ptr< ExternalFlowForce< dim, number > > > external_forces_implicit_residual
Definition dg_operator_implicit_explicit.hpp:227
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.
Definition dg_operator_implicit_explicit.cpp:624
std::vector< std::shared_ptr< ExternalFlowForce< dim, number > > > external_forces_explicit_rhs
Definition dg_operator_implicit_explicit.hpp:223
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 v...
Definition dg_operator_implicit_explicit.cpp:465
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 ...
Definition dg_operator_implicit_explicit.cpp:429
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.
Definition dg_operator_implicit_explicit.cpp:232
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 sourc...
Definition dg_operator_implicit_explicit.cpp:518
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_explicit.cpp:171
void reinit() override
Reinitialize the internal data structures.
Definition dg_operator_implicit_explicit.cpp:108
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.
Definition dg_operator_implicit_explicit.cpp:674
ConvectiveKernels< dim, number > convective_terms
Object for the convective term evaluations.
Definition dg_operator_implicit_explicit.hpp:216
TimeIntegration::ImplicitExplicitIntegrator< dim, number > time_integrator
Time integrator class used for the time integration.
Definition dg_operator_implicit_explicit.hpp:213
const VectorType * intermediate_explicit_solution
Pointer to an intermediate explicit solution vector.
Definition dg_operator_implicit_explicit.hpp:199
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.
Definition dg_operator_implicit_explicit.cpp:135
OperationScratchData< dim, number > & flow_scratch_data
Scratch data for compressible flows.
Definition dg_operator_implicit_explicit.hpp:210
ViscousKernels< dim, number > viscous_terms
Object for the viscous term evaluations.
Definition dg_operator_implicit_explicit.hpp:219
void compute_inverse_diagonal_from_matrixfree(VectorType &diagonal) const
Compute the inverse elements of the diagonal of the Jacobian.
Definition dg_operator_implicit_explicit.cpp:86
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 var...
Definition dg_operator_implicit_explicit.cpp:555
void advance_time_step(number time, number time_step) override
Advances solver by a single time step.
Definition dg_operator_implicit_explicit.cpp:116
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.
Definition dg_operator_implicit_explicit.cpp:408
ConservedVariablesGradientType< dim, number > ConservedVariablesGradient
Definition dg_operator_implicit_explicit.hpp:27
void compute_system_matrix_from_matrixfree(dealii::TrilinosWrappers::SparseMatrix &sparse_matrix) const
Compute the matrix representation of the Jacobian.
Definition dg_operator_implicit_explicit.cpp:71
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.
Definition dg_operator_implicit_explicit.cpp:273
std::vector< std::shared_ptr< ExternalFlowForceJacobian< dim, number > > > external_forces_implicit_jacobian
Definition dg_operator_implicit_explicit.hpp:232
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_explicit.cpp:52
VectorType disturbed_residual
Definition dg_operator_implicit_explicit.hpp:203
number current_time_increment
Definition dg_operator_implicit_explicit.hpp:207
ConservedVariablesType< dim, number > ConservedVariables
Definition dg_operator_implicit_explicit.hpp:26
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....
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_explicit.cpp:578
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.
Definition dg_operator_implicit_explicit.cpp:203
dealii::LinearAlgebra::distributed::Vector< number > VectorType
Definition dg_operator_implicit_explicit.hpp:25
Definition implicit_explicit_integrator.hpp:23
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