include/meltpooldg/level_set/reinitialization_elliptic_operator_CG_newton.hpp Source File

Developer Documentation: include/meltpooldg/level_set/reinitialization_elliptic_operator_CG_newton.hpp Source File
Developer Documentation
reinitialization_elliptic_operator_CG_newton.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/fe/fe_dgq.h>
4#include <deal.II/fe/fe_system.h>
5
6#include <deal.II/lac/generic_linear_algebra.h>
7
8#include <deal.II/matrix_free/fe_evaluation.h>
9#include <deal.II/matrix_free/fe_point_evaluation.h>
10#include <deal.II/matrix_free/matrix_free.h>
11#include <deal.II/matrix_free/operators.h>
12
18
19
21{
36 template <int dim, typename number>
38 {
39 using OperatorMatrixFree<dim, number>::vmult;
40 using OperatorMatrixFree<dim, number>::create_rhs;
42
43 public:
44 using VectorType = dealii::LinearAlgebra::distributed::Vector<number>;
45 using VectorizedArrayType = dealii::VectorizedArray<number>;
47 using PointEvaluationType = dealii::FEPointEvaluation<1, dim, dim, VectorizedArrayType>;
48
49
63 const MeltPoolDG::ScratchData<dim, dim, number> &scratch_data_in,
64 const ReinitializationData<number> &reinit_data_in,
65 const unsigned int reinit_dof_idx_in,
66 const unsigned int reinit_quad_idx_in,
67 const MappingInfoType &mapping_info_surface_in,
68 const unsigned int ls_dof_idx_in);
69
77 void
78 vmult(VectorType &dst, const VectorType &src) const final;
79
87 void
88 create_residual(VectorType &rhs, const VectorType &level_set) const;
89
93 void
94 reinit() final;
95
98
105 void
107 dealii::TrilinosWrappers::SparseMatrix &system_matrix) const final;
108
115 void
117
118 private:
126 template <int n_components>
128 evaluate_coefficient(const FECellIntegrator<dim, n_components, number> &phi_old,
129 const unsigned int q_index) const;
130
138 template <int n_components>
140 evaluate_coefficient_derivative(const FECellIntegrator<dim, n_components, number> &phi_old,
141 const unsigned int q_index) const;
142
143 template <int n_components>
145 evaluate_coefficient_derivative(const FEFaceIntegrator<dim, n_components, number> &phi_old,
146 const unsigned int q_index) const;
147
153 void
154 residual_laplace_operation(FECellIntegrator<dim, 1, number> &cell_eval) const;
155
161 void
162 tangent_laplace_operation(FECellIntegrator<dim, 1, number> &cell_eval,
163 FECellIntegrator<dim, 1, number> &phi_old) const;
164
173 void
174 cell_operation(FECellIntegrator<dim, 1, number> &interface_penalty,
175 FECellIntegrator<dim, 1, number> &cell_eval,
176 PointEvaluationType &interface_penalty_surface) const;
187 void
188 interface_penalty_cell_operation(PointEvaluationType &interface_penalty_surface,
189 FECellIntegrator<dim, 1, number> &interface_penalty,
190 const unsigned int lane,
191 const number penalty_coefficient) const;
192
194 const ScratchData<dim, dim, number> &scratch_data;
195
198
200 const unsigned int reinit_quad_idx;
201
204
207
209 const unsigned int n_dofs_per_cell;
210
212 const unsigned int ls_dof_idx;
213
218 };
219} // namespace MeltPoolDG::LevelSet
Operator for the matrix-free evaluation of diffusive reinitialization of the level set function.
Definition reinitialization_elliptic_operator_CG_newton.hpp:38
VectorizedArrayType evaluate_coefficient(const FECellIntegrator< dim, n_components, number > &phi_old, const unsigned int q_index) const
This evaluates the coefficient for the rhs integral.
Definition reinitialization_elliptic_operator_CG_newton.cpp:201
VectorType solution_old
Solution vector from the previous iteration or time step (used in matrix-free mode).
Definition reinitialization_elliptic_operator_CG_newton.hpp:97
const MappingInfoType & mapping_info_surface
Mapping information for integration over the interface.
Definition reinitialization_elliptic_operator_CG_newton.hpp:203
void tangent_laplace_operation(FECellIntegrator< dim, 1, number > &cell_eval, FECellIntegrator< dim, 1, number > &phi_old) const
Calculate the contribution of the weighted Laplace operator to the lhs.
Definition reinitialization_elliptic_operator_CG_newton.cpp:136
const unsigned int n_dofs_per_cell
Number of DoFs per cell of the temporary FE.
Definition reinitialization_elliptic_operator_CG_newton.hpp:209
void create_residual(VectorType &rhs, const VectorType &level_set) const
Create the right-hand side vector using a matrix-free evaluation. Top-level function.
Definition reinitialization_elliptic_operator_CG_newton.cpp:160
const ScratchData< dim, dim, number > & scratch_data
Reference to scratch data containing mesh, geometry, and FE evaluation utilities.
Definition reinitialization_elliptic_operator_CG_newton.hpp:194
void vmult(VectorType &dst, const VectorType &src) const final
Apply the operator in a matrix-free fashion. Top-level function for the evaluation of the left-hand s...
Definition reinitialization_elliptic_operator_CG_newton.cpp:44
dealii::FE_Q< dim > fe_point_level_set
Temporary FE object required by FEPointEvaluation.
Definition reinitialization_elliptic_operator_CG_newton.hpp:206
CutUtil::MappingInfoType< dim, number > MappingInfoType
Definition reinitialization_elliptic_operator_CG_newton.hpp:46
VectorizedArrayType evaluate_coefficient_derivative(const FECellIntegrator< dim, n_components, number > &phi_old, const unsigned int q_index) const
This evaluates the coefficient derivative for the analytical form.
Definition reinitialization_elliptic_operator_CG_newton.cpp:85
dealii::VectorizedArray< number > VectorizedArrayType
Definition reinitialization_elliptic_operator_CG_newton.hpp:45
const unsigned int reinit_quad_idx
Quadrature index for evaluating terms during reinitialization.
Definition reinitialization_elliptic_operator_CG_newton.hpp:200
void compute_system_matrix_from_matrixfree(dealii::TrilinosWrappers::SparseMatrix &system_matrix) const final
Compute and assemble the system matrix from matrix-free operator evaluations. Used by the preconditio...
Definition reinitialization_elliptic_operator_CG_newton.cpp:274
void reinit() final
Reinitialize internal data structures, typically after mesh changes.
Definition reinitialization_elliptic_operator_CG_newton.cpp:35
void cell_operation(FECellIntegrator< dim, 1, number > &interface_penalty, FECellIntegrator< dim, 1, number > &cell_eval, PointEvaluationType &interface_penalty_surface) const
Compute the contribution of a single cell integral to the right-hand side. First-level function for t...
Definition reinitialization_elliptic_operator_CG_newton.cpp:235
void interface_penalty_cell_operation(PointEvaluationType &interface_penalty_surface, FECellIntegrator< dim, 1, number > &interface_penalty, const unsigned int lane, const number penalty_coefficient) const
Calculate the contribution of a single cell surface integral to the penalty term for the weak imposit...
Definition reinitialization_elliptic_operator_CG_newton.cpp:216
const unsigned int ls_dof_idx
DOF handler index for the level set field.
Definition reinitialization_elliptic_operator_CG_newton.hpp:212
VectorType zero_interface
Definition reinitialization_elliptic_operator_CG_newton.hpp:217
dealii::FEPointEvaluation< 1, dim, dim, VectorizedArrayType > PointEvaluationType
Definition reinitialization_elliptic_operator_CG_newton.hpp:47
dealii::LinearAlgebra::distributed::Vector< number > VectorType
Definition reinitialization_elliptic_operator_CG_newton.hpp:44
void compute_inverse_diagonal_from_matrixfree(VectorType &diagonal) const final
Compute the inverse diagonal of the system matrix. Used by the preconditioner.
Definition reinitialization_elliptic_operator_CG_newton.cpp:311
const ReinitializationData< number > & reinit_data
Reference to the reinitialization parameters and coefficients.
Definition reinitialization_elliptic_operator_CG_newton.hpp:197
void residual_laplace_operation(FECellIntegrator< dim, 1, number > &cell_eval) const
Calculate the contribution of the weigted Laplace operator of a cell to the rhs.
Definition reinitialization_elliptic_operator_CG_newton.cpp:120
Operator handling matrix-free computations.
Definition operator_base.hpp:191
virtual void create_rhs(VectorType &, const VectorType &) const
Compute the right-hand side vector.
Definition operator_base.hpp:209
Container for shared scratch data between operations/operators.
Definition scratch_data.hpp:61
dealii::NonMatching::MappingInfo< dim, dim, dealii::VectorizedArray< number > > MappingInfoType
Definition util.hpp:53
This operation solves the reinitialization problem for a CG-FEM-based discrete level-set field by sol...
Definition advection_DG_operation.hpp:20
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
Definition dealii_tensor.hpp:10
Definition reinitialization_data.hpp:133