OlssonOperator< dim, number > Class Template Reference
|
Developer Documentation
|
Operator for the Olsson reinitialization method used in level set methods. More...
#include <olsson_CG_operator.hpp>
Public Types | |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| Distributed vector type used for matrix-free and matrix-based computations. | |
| using | BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector< number > |
| Distributed block vector type used for storing the interface normal field. | |
| using | SparseMatrixType = dealii::TrilinosWrappers::SparseMatrix |
| Sparse matrix type used for assembling and storing the system matrix. | |
| using | VectorizedArrayType = dealii::VectorizedArray< number > |
| Vectorized scalar type used in SIMD computations. | |
| using | vector = dealii::Tensor< 1, dim, VectorizedArrayType > |
Vector type with SIMD-enabled entries in dim dimensions. | |
| using | scalar = VectorizedArrayType |
| Scalar type with SIMD-enabled entries. | |
Public Types inherited from MeltPoolDG::OperatorMatrixBased< dim, number > | |
| using | SparseMatrixType = dealii::TrilinosWrappers::SparseMatrix |
| using | SparsityPatternType = dealii::TrilinosWrappers::SparsityPattern |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| using | BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector< number > |
Public Types inherited from MeltPoolDG::OperatorMatrixFree< dim, number > | |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| using | BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector< number > |
| using | SparseMatrixType = dealii::TrilinosWrappers::SparseMatrix |
Public Member Functions | |
| OlssonOperator (const ScratchData< dim, dim, number > &scratch_data_in, const ReinitializationData< number > &reinit_data_in, const int ls_n_subdivisions, const BlockVectorType &n_in, const unsigned int reinit_dof_idx_in, const unsigned int reinit_quad_idx_in, const unsigned int ls_dof_idx_in, const unsigned int normal_dof_idx_in) | |
| Constructor. | |
| void | compute_system_matrix_and_rhs (const VectorType &old_level_set, VectorType &rhs) const final |
| Assemble the system matrix and right-hand side using a matrix-based approach. | |
| void | vmult (VectorType &dst, const VectorType &src) const final |
| Apply the operator in a matrix-free fashion. | |
| void | create_rhs (VectorType &rhs, const VectorType &old_level_set) const final |
| Create the right-hand side vector using a matrix-free evaluation. | |
| void | compute_system_matrix_from_matrixfree (dealii::TrilinosWrappers::SparseMatrix &system_matrix) const final |
| Compute and assemble the system matrix from matrix-free operator evaluations. | |
| void | compute_inverse_diagonal_from_matrixfree (VectorType &diagonal) const final |
| Compute an approximation of the inverse diagonal of the system matrix. | |
| void | reinit () final |
| Reinitialize internal data structures, typically after mesh changes. | |
| void | set_wetting_boundary_condition_ids (std::vector< dealii::types::boundary_id > &&wetting_bc_ids) |
| Specify the boundary IDs where wetting boundary conditions should be applied. | |
Public Member Functions inherited from MeltPoolDG::OperatorMatrixBased< dim, number > | |
| virtual | ~OperatorMatrixBased ()=default |
| virtual void | compute_system_matrix_and_rhs (const BlockVectorType &, VectorType &) const |
| Compute the system matrix and right-hand side vector for block vectors. | |
| virtual void | compute_system_matrix_and_rhs (const VectorType &, BlockVectorType &) const |
| Compute the system matrix and right-hand side block vector. | |
| virtual void | reinit_sparsity_pattern (const ScratchData< dim, dim, number > &scratch_data) |
| Reinitialize the sparsity pattern of the system matrix. | |
| const SparseMatrixType & | get_system_matrix () const |
| SparseMatrixType & | get_system_matrix () |
Public Member Functions inherited from MeltPoolDG::OperatorBase< number > | |
| virtual | ~OperatorBase ()=default |
| void | reset_dof_index (const unsigned int dof_idx_in) |
| Set the index for the current degrees of freedom (DoF). | |
| void | reset_time_increment (const number dt) |
| Set the time increment for the operator. | |
| virtual void | pre () |
| Prepare for computations (e.g. update ghost values). Can be overridden by derived classes. | |
| virtual void | post () |
| Finalize for computations (e.g. zero out ghost values). Can be overridden by derived classes. | |
Public Member Functions inherited from MeltPoolDG::OperatorMatrixFree< dim, number > | |
| virtual | ~OperatorMatrixFree ()=default |
| virtual void | create_rhs (BlockVectorType &, const VectorType &) const |
Compute the right-hand side vector for block vectors dst. | |
| virtual void | create_rhs (VectorType &, const BlockVectorType &) const |
Compute the right-hand side vector for block vectors src. | |
| virtual void | vmult (BlockVectorType &, const BlockVectorType &) const |
| virtual void | compute_inverse_diagonal_from_matrixfree (BlockVectorType &) const |
| Compute the inverse diagonal using matrix-free techniques for block vectors. | |
Private Member Functions | |
| void | tangent_cell_operation (FECellIntegrator< dim, 1, number > &delta_psi) const |
| Compute the contribution of a single cell integral to the tangent. | |
| void | tangent_boundary_face_operation (FEFaceIntegrator< dim, 1, number > &face_eval, FEFaceIntegrator< dim, dim, number > &normal_face_eval) const |
| Compute the contribution of a single boundary face integral to the tangent. | |
| void | rhs_boundary_face_operation (FEFaceIntegrator< dim, 1, number > &face_eval, FEFaceIntegrator< dim, dim, number > &normal_face_eval) const |
| Compute the contribution of a single boundary face integral to the right-hand side. | |
| void | tangent_boundary_loop (const dealii::MatrixFree< dim, number > &matrix_free, VectorType &dst, const VectorType &src, std::pair< unsigned int, unsigned int > face_range) const |
| Loop over boundary faces to compute tangent (left-hand side) contributions in matrix-free mode. | |
| void | rhs_boundary_loop (const dealii::MatrixFree< dim, number > &matrix_free, VectorType &dst, const VectorType &src, std::pair< unsigned int, unsigned int > face_range) const |
| Loop over boundary faces to compute right-hand side contributions in matrix-free mode. | |
Private Attributes | |
| const ScratchData< dim, dim, number > & | scratch_data |
| Reference to scratch data containing mesh, geometry, and FE evaluation utilities. | |
| const ReinitializationData< number > & | reinit_data |
| Reference to the reinitialization parameters and coefficients. | |
| const number | ls_n_subdivisions |
| Number of subdivisions used to define the interface thickness parameter. | |
| const BlockVectorType & | normal_vec |
| Reference to the vector field representing the interface normals. | |
| const unsigned int | reinit_quad_idx |
| Quadrature index for evaluating terms during reinitialization. | |
| const unsigned int | normal_dof_idx |
| DOF handler index for the normal vector field. | |
| const unsigned int | ls_dof_idx |
| DOF handler index for the level set field. | |
| std::vector< dealii::types::boundary_id > | wetting_bc_ids |
| List of boundary IDs where wetting boundary conditions are applied. | |
| bool | enable_boundary_face_integral = false |
| Flag to enable or disable boundary face integral contributions. | |
| const number | tolerance_normal_vector |
| Tolerance threshold used for validating or correcting normal vectors. | |
| dealii::AlignedVector< dealii::VectorizedArray< number > > | normal_diffusion_length |
| Precomputed diffusive length scale in the normal direction at each quadrature point. | |
| dealii::AlignedVector< dealii::VectorizedArray< number > > | tangential_diffusion_length |
| Precomputed diffusive length scale in the tangential direction at each quadrature point. | |
| dealii::AlignedVector< dealii::VectorizedArray< number > > | solution_old |
| dealii::AlignedVector< dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > > | unit_normal |
Additional Inherited Members | |
Protected Attributes inherited from MeltPoolDG::OperatorMatrixBased< dim, number > | |
| SparseMatrixType | system_matrix |
| SparsityPatternType | dsp |
Protected Attributes inherited from MeltPoolDG::OperatorBase< number > | |
| unsigned int | dof_idx = dealii::numbers::invalid_unsigned_int |
| number | time_increment = numbers::invalid_double |
| number | time_increment_inv = numbers::invalid_double |
Detailed Description
class MeltPoolDG::LevelSet::OlssonOperator< dim, number >
Operator for the Olsson reinitialization method used in level set methods.
This class implements both matrix-based and matrix-free variants of the operator, enabling flexible assembly and application of the reinitialization system used to maintain signed distance properties of level set functions. It supports tangential diffusion, compressive fluxes, and optional wetting boundary conditions.
The implementation is based on the conservative level set reinitialization method described in:
E. Olsson, G. Kreiss, and S. Zahedi, "A conservative level set method for two phase flow II," Journal of Computational Physics, 225(1), 785–807, 2007. https://doi.org/10.1016/j.jcp.2007.01.026
and for wetting consideration, we add the tangential component as described in:
S. Zahedi, K. Gustavsson, and G. Kreiss, “A conservative level set method for contact line dynamics,” J. Comput. Phys., vol. 228, no. 17, pp. 6361–6375, Sep. 2009, doi: 10.1016/j.jcp.2009.05.043.
- Template Parameters
-
dim Spatial dimension (2 or 3). number Scalar number type (e.g., double or float).
Member Typedef Documentation
◆ BlockVectorType
| using MeltPoolDG::LevelSet::OlssonOperator< dim, number >::BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector<number> |
Distributed block vector type used for storing the interface normal field.
◆ scalar
| using MeltPoolDG::LevelSet::OlssonOperator< dim, number >::scalar = VectorizedArrayType |
Scalar type with SIMD-enabled entries.
◆ SparseMatrixType
| using MeltPoolDG::LevelSet::OlssonOperator< dim, number >::SparseMatrixType = dealii::TrilinosWrappers::SparseMatrix |
Sparse matrix type used for assembling and storing the system matrix.
◆ vector
| using MeltPoolDG::LevelSet::OlssonOperator< dim, number >::vector = dealii::Tensor<1, dim, VectorizedArrayType> |
Vector type with SIMD-enabled entries in dim dimensions.
◆ VectorizedArrayType
| using MeltPoolDG::LevelSet::OlssonOperator< dim, number >::VectorizedArrayType = dealii::VectorizedArray<number> |
Vectorized scalar type used in SIMD computations.
◆ VectorType
| using MeltPoolDG::LevelSet::OlssonOperator< dim, number >::VectorType = dealii::LinearAlgebra::distributed::Vector<number> |
Distributed vector type used for matrix-free and matrix-based computations.
Constructor & Destructor Documentation
◆ OlssonOperator()
| MeltPoolDG::LevelSet::OlssonOperator< dim, number >::OlssonOperator | ( | const ScratchData< dim, dim, number > & | scratch_data_in, |
| const ReinitializationData< number > & | reinit_data_in, | ||
| const int | ls_n_subdivisions, | ||
| const BlockVectorType & | n_in, | ||
| const unsigned int | reinit_dof_idx_in, | ||
| const unsigned int | reinit_quad_idx_in, | ||
| const unsigned int | ls_dof_idx_in, | ||
| const unsigned int | normal_dof_idx_in | ||
| ) |
Constructor.
- Parameters
-
scratch_data_in Scratch data containing mesh and FE information. reinit_data_in Parameters used during the reinitialization process. ls_n_subdivisions Number of subdivisions for the level_set_framework. n_in Precomputed normal vector field. reinit_dof_idx_in DOF handler index for reinitialization. reinit_quad_idx_in Quadrature index for reinitialization. ls_dof_idx_in DOF handler index for the level set function. normal_dof_idx_in DOF handler index for the normal vector.
Member Function Documentation
◆ compute_inverse_diagonal_from_matrixfree()
|
finalvirtual |
Compute an approximation of the inverse diagonal of the system matrix.
- Parameters
-
diagonal Output vector containing the diagonal inverse values.
Reimplemented from MeltPoolDG::OperatorMatrixFree< dim, number >.
◆ compute_system_matrix_and_rhs()
|
finalvirtual |
Assemble the system matrix and right-hand side using a matrix-based approach.
- Parameters
-
old_level_set The level set vector from the previous pseudo time step. rhs Output vector for the right-hand side.
Reimplemented from MeltPoolDG::OperatorMatrixBased< dim, number >.
◆ compute_system_matrix_from_matrixfree()
|
finalvirtual |
Compute and assemble the system matrix from matrix-free operator evaluations.
- Parameters
-
system_matrix Output sparse matrix.
Reimplemented from MeltPoolDG::OperatorMatrixFree< dim, number >.
◆ create_rhs()
|
finalvirtual |
Create the right-hand side vector using a matrix-free evaluation.
- Parameters
-
rhs Right-hand side vector. old_level_set The level set vector from the previous pseudo time step.
Reimplemented from MeltPoolDG::OperatorMatrixFree< dim, number >.
◆ reinit()
|
finalvirtual |
Reinitialize internal data structures, typically after mesh changes.
Reimplemented from MeltPoolDG::OperatorBase< number >.
◆ rhs_boundary_face_operation()
|
private |
Compute the contribution of a single boundary face integral to the right-hand side.
- Parameters
-
face_eval Face integrator for the solution field (increment of level set). normal_face_eval Face integrator for the normal vector field.
◆ rhs_boundary_loop()
|
private |
Loop over boundary faces to compute right-hand side contributions in matrix-free mode.
- Parameters
-
matrix_free Matrix-free data structure. dst Output vector for the right-hand side. src Input solution vector (increment of level set). face_range Range of face indices to process.
◆ set_wetting_boundary_condition_ids()
| void MeltPoolDG::LevelSet::OlssonOperator< dim, number >::set_wetting_boundary_condition_ids | ( | std::vector< dealii::types::boundary_id > && | wetting_bc_ids | ) |
Specify the boundary IDs where wetting boundary conditions should be applied.
- Parameters
-
wetting_bc_ids A vector of boundary IDs.
◆ tangent_boundary_face_operation()
|
private |
Compute the contribution of a single boundary face integral to the tangent.
- Parameters
-
face_eval Face integrator for the solution field (increment of level set). normal_face_eval Face integrator for the normal vector field.
◆ tangent_boundary_loop()
|
private |
Loop over boundary faces to compute tangent (left-hand side) contributions in matrix-free mode.
- Parameters
-
matrix_free Matrix-free data structure. dst Output vector for the right-hand side. src Input solution vector (increment of level set). face_range Range of face indices to process.
◆ tangent_cell_operation()
|
private |
Compute the contribution of a single cell integral to the tangent.
- Parameters
-
delta_psi Cell integrator for the solution field (increment of level set).
◆ vmult()
|
finalvirtual |
Apply the operator in a matrix-free fashion.
- Parameters
-
dst Output vector. src Input vector.
Reimplemented from MeltPoolDG::OperatorMatrixFree< dim, number >.
Member Data Documentation
◆ enable_boundary_face_integral
|
private |
Flag to enable or disable boundary face integral contributions.
◆ ls_dof_idx
|
private |
DOF handler index for the level set field.
◆ ls_n_subdivisions
|
private |
Number of subdivisions used to define the interface thickness parameter.
◆ normal_diffusion_length
|
private |
Precomputed diffusive length scale in the normal direction at each quadrature point.
◆ normal_dof_idx
|
private |
DOF handler index for the normal vector field.
◆ normal_vec
|
private |
Reference to the vector field representing the interface normals.
◆ reinit_data
|
private |
Reference to the reinitialization parameters and coefficients.
◆ reinit_quad_idx
|
private |
Quadrature index for evaluating terms during reinitialization.
◆ scratch_data
|
private |
Reference to scratch data containing mesh, geometry, and FE evaluation utilities.
◆ solution_old
|
mutableprivate |
Solution vector from the previous iteration or time step (used in matrix-free mode).
- Note
- Marked as mutable to allow updates in const functions.
◆ tangential_diffusion_length
|
private |
Precomputed diffusive length scale in the tangential direction at each quadrature point.
◆ tolerance_normal_vector
|
private |
Tolerance threshold used for validating or correcting normal vectors.
◆ unit_normal
|
mutableprivate |
Precomputed unit normals at quadrature points (used during face integration).
- Note
- Marked as mutable to allow updates in const functions.
◆ wetting_bc_ids
|
private |
List of boundary IDs where wetting boundary conditions are applied.
The documentation for this class was generated from the following files:
- include/meltpooldg/level_set/olsson_CG_operator.hpp
- source/level_set/olsson_CG_operator.cpp
Generated by
Public Types inherited from