SignedDistanceSolver< dim, VectorType > Class Template Reference
|
Developer Documentation
|
Solver to compute the signed distance from a given level of a level-set field. More...
#include <signed_distance_solver.hpp>
Public Member Functions | |
| SignedDistanceSolver (std::shared_ptr< dealii::parallel::DistributedTriangulationBase< dim > > background_triangulation, const dealii::FiniteElement< dim > &background_fe, const double p_max_distance, const double p_iso_level, const double p_scaling=1.0, const Verbosity p_verbosity=Verbosity::quiet) | |
| Constructor. | |
| SignedDistanceSolver (const dealii::DoFHandler< dim > &background_dof_handler, const double p_max_distance, const double p_iso_level, const double p_scaling=1.0, const Verbosity p_verbosity=Verbosity::quiet) | |
| Constructor. | |
| void | setup_dofs () |
| Initialize the degrees of freedom and associated memory. | |
| void | set_level_set_from_background_mesh (const dealii::DoFHandler< dim > &background_dof_handler, const VectorType &background_level_set_vector) |
| Set the level-set field from the background mesh solver. | |
| void | solve () |
| Solve for the signed distance from the given level of the level-set vector. | |
| VectorType & | get_signed_distance () |
| Get the computed signed distance field. | |
| const VectorType & | get_signed_distance () const |
| Get the computed signed distance field. | |
| const dealii::DoFHandler< dim > & | get_dof_handler () const |
| Get the DoFHandler used by the signed distance solver. | |
| void | output_interface_reconstruction (const std::string &filename) const |
| Output the interface reconstruction used for signed distance computations. | |
Private Member Functions | |
| void | zero_out_ghost_values () const |
| Zero the ghost DoF entries of solution vectors to gain write access to ghost elements. | |
| void | update_ghost_values () const |
| Update ghost DoF entries of solution vectors to gain read access to ghost elements. | |
| void | exchange_distance () |
| Exchange the distance field and keep the minimum value across processors with compress(VectorOperation::min). | |
| void | initialize_distance () |
| Initialize the distance vectors to the maximum distance. | |
| void | compute_first_neighbors_distance () |
| Compute brute-force geometric distances between the reconstructed interface and DoFs of intersected cells. | |
| void | compute_second_neighbors_distance () |
| Compute marching-method geometric distances between the reconstructed interface and remaining DoFs. | |
| void | compute_signed_distance_from_distance () |
| Compute signed_distance from the unsigned distance and the sign of the signed-distance entries. | |
| void | compute_cell_wise_volume_correction () |
| Compute the cell-wise volume correction matching the volume enclosed by the given level of the level-set field in each cell. | |
| void | conserve_global_volume () |
| Correct the global volume to match the volume enclosed by the given level of the level-set field. | |
| void | set_face_opposite_dofs_map () |
| Set the map of local ids of opposite DoFs for each face. | |
| void | set_face_dofs_map () |
| Set the map of local ids of face DoFs for each face. | |
| void | get_face_opposite_dofs (unsigned int local_face_id, std::vector< unsigned int > &local_opposite_dofs) const |
| Return the local ids of DoFs opposite to a given face. | |
| void | get_face_local_dofs (unsigned int local_face_id, std::vector< unsigned int > &local_dofs) const |
| Return the local ids of the DoFs located on a given face. | |
| void | get_face_transformation_jacobian (const dealii::DerivativeForm< 1, dim, dim > &cell_transformation_jac, const unsigned int local_face_id, dealii::LAPACKFullMatrix< double > &face_transformation_jac) const |
| Return the face transformation Jacobian. | |
| dealii::Point< dim > | transform_ref_face_point_to_ref_cell (const dealii::Point< dim - 1 > &x_ref_face, const unsigned int local_face_id) const |
| Transform a point from a reference face to the reference cell. | |
| void | compute_residual (const dealii::Tensor< 1, dim > &x_n_to_x_I_real, const dealii::Tensor< 1, dim > &distance_gradient, const dealii::LAPACKFullMatrix< double > &transformation_jac, dealii::Tensor< 1, dim - 1 > &residual_ref) const |
| Compute the residual of the distance minimization problem in the reference face space. | |
| dealii::Tensor< 1, dim > | transform_ref_face_correction_to_ref_cell (const dealii::Vector< double > &correction_ref_face, const unsigned int local_face_id) const |
| Transform a Newton correction from the reference face to the reference cell. | |
| void | compute_analytical_jacobian (const dealii::Tensor< 1, dim > &x_n_to_x_I_real_p1, const dealii::LAPACKFullMatrix< double > &transformation_jacobian, const std::vector< double > &face_local_dof_values, dealii::LAPACKFullMatrix< double > &jacobian_matrix) |
| Compute the analytical Jacobian of the distance minimization problem in the reference face space. | |
| double | compute_distance (const dealii::Tensor< 1, dim > &x_n_to_x_I_real, const double distance) const |
| Compute the propagated distance d(x_I) = d(x_n) + ||x_I - x_n||. | |
Private Attributes | |
| bool | is_external_dof_handler = false |
| std::unique_ptr< dealii::FiniteElement< dim > > | fe |
| Finite element discretizing the signed distance problem. | |
| std::unique_ptr< dealii::DoFHandler< dim > > | owned_dof_handler |
| DoFHandler describing the signed distance problem. | |
| const dealii::DoFHandler< dim > * | dof_handler = nullptr |
| Pointer to the DoFHandler describing the signed distance problem (can be fed from external) | |
| std::unique_ptr< dealii::MappingQ< dim > > | mapping |
| dealii::Mapping between the real and reference spaces. | |
| const double | max_distance |
| Maximum redistancing distance. | |
| const double | iso_level |
| Iso-level describing the interface from which the signed distance is computed. | |
| const double | scaling |
| Scaling factor applied to the input level-set field. | |
| Verbosity | verbosity |
| Verbosity level. | |
| dealii::ConditionalOStream | pcout |
| Parallel output stream. | |
| dealii::IndexSet | locally_owned_dofs |
| Set of locally owned DoFs. | |
| dealii::IndexSet | locally_relevant_dofs |
| Set of locally relevant DoFs. | |
| dealii::IndexSet | locally_active_dofs |
| Set of locally active DoFs. | |
| VectorType | level_set |
| Level-set field coming from the background solver. | |
| VectorType | signed_distance |
| Solution vector of the signed distance without ghost values. | |
| VectorType | signed_distance_with_ghost |
| Solution vector of the signed distance with ghost values. | |
| VectorType | distance |
| Solution vector of the unsigned distance without ghost values. | |
| VectorType | distance_with_ghost |
| Solution vector of the unsigned distance with ghost values. | |
| VectorType | volume_correction |
| Correction applied to match the cell-wise volume enclosed by the level set. | |
| std::map< dealii::types::global_cell_index, std::vector< dealii::Point< dim > > > | interface_reconstruction_vertices |
| std::map< dealii::types::global_cell_index, std::vector< dealii::CellData< dim==1 ? 1 :dim - 1 > > > | interface_reconstruction_cells |
| std::set< dealii::types::global_dof_index > | intersected_dofs |
| Set of DoFs belonging to intersected cells. | |
| std::map< unsigned int, std::vector< unsigned int > > | face_opposite_dofs_map |
| Map from face ids to local ids of opposite DoFs. | |
| std::map< unsigned int, std::vector< unsigned int > > | face_dofs_map |
| Map from face ids to local ids of face DoFs. | |
| std::unique_ptr< dealii::AffineConstraints< double > > | constraints |
| Hanging node constraints. | |
Detailed Description
class MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >
Solver to compute the signed distance from a given level of a level-set field.
It is based on the geometric mass-preserving redistancing scheme proposed by Ausas, Dari and Buscaglia (2011).
- Template Parameters
-
dim An integer that denotes the dimension of the space in which the problem is solved. VectorType The vector type of the level-set vector.
Constructor & Destructor Documentation
◆ SignedDistanceSolver() [1/2]
| MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >::SignedDistanceSolver | ( | std::shared_ptr< dealii::parallel::DistributedTriangulationBase< dim > > | background_triangulation, |
| const dealii::FiniteElement< dim > & | background_fe, | ||
| const double | p_max_distance, | ||
| const double | p_iso_level, | ||
| const double | p_scaling = 1.0, |
||
| const Verbosity | p_verbosity = Verbosity::quiet |
||
| ) |
Constructor.
- Parameters
-
[in] background_triangulation Shared pointer to the triangulation of the domain. [in] background_fe Reference to the finite element discretizing the domain. [in] p_max_distance Maximum reinitialization distance value. [in] p_iso_level Iso-level before scaling from which the signed distance is computed. [in] p_scaling Scaling factor applied to the input level-set field. [in] p_verbosity Verbosity level.
◆ SignedDistanceSolver() [2/2]
| MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >::SignedDistanceSolver | ( | const dealii::DoFHandler< dim > & | background_dof_handler, |
| const double | p_max_distance, | ||
| const double | p_iso_level, | ||
| const double | p_scaling = 1.0, |
||
| const Verbosity | p_verbosity = Verbosity::quiet |
||
| ) |
Constructor.
- Parameters
-
[in] background_dof_handler Reference to the DoFHandler of the domain. [in] p_max_distance Maximum reinitialization distance value. [in] p_iso_level Iso-level before scaling from which the signed distance is computed. [in] p_scaling Scaling factor applied to the input level-set field. [in] p_verbosity Verbosity level.
Member Function Documentation
◆ compute_analytical_jacobian()
|
inlineprivate |
Compute the analytical Jacobian of the distance minimization problem in the reference face space.
- Parameters
-
[in] x_n_to_x_I_real_p1 Vector from x_n to x_I at the current Newton iterate in real space. [in] transformation_jacobian Face transformation Jacobian. [in] face_local_dof_values Values of the DoFs on the face. [out] jacobian_matrix Jacobian matrix of the minimization problem.
◆ compute_cell_wise_volume_correction()
|
private |
Compute the cell-wise volume correction matching the volume enclosed by the given level of the level-set field in each cell.
◆ compute_distance()
|
inlineprivate |
Compute the propagated distance d(x_I) = d(x_n) + ||x_I - x_n||.
- Parameters
-
[in] x_n_to_x_I_real Vector from x_n to x_I in real space. [in] distance Distance value at x_n.
- Returns
- Distance between x_I and the interface.
◆ compute_first_neighbors_distance()
|
private |
Compute brute-force geometric distances between the reconstructed interface and DoFs of intersected cells.
◆ compute_residual()
|
inlineprivate |
Compute the residual of the distance minimization problem in the reference face space.
- Parameters
-
[in] x_n_to_x_I_real Vector from x_n to x_I in real space. [in] distance_gradient Gradient of the distance at x_n. [in] transformation_jac Transformation Jacobian of the face. [out] residual_ref Residual in reference face space.
◆ compute_second_neighbors_distance()
|
private |
Compute marching-method geometric distances between the reconstructed interface and remaining DoFs.
◆ compute_signed_distance_from_distance()
|
private |
Compute signed_distance from the unsigned distance and the sign of the signed-distance entries.
◆ conserve_global_volume()
|
private |
Correct the global volume to match the volume enclosed by the given level of the level-set field.
◆ exchange_distance()
|
private |
Exchange the distance field and keep the minimum value across processors with compress(VectorOperation::min).
◆ get_dof_handler()
|
inline |
Get the DoFHandler used by the signed distance solver.
- Returns
- Constant reference to the solver DoFHandler.
◆ get_face_local_dofs()
|
inlineprivate |
Return the local ids of the DoFs located on a given face.
- Parameters
-
[in] local_face_id Local id of the face in the cell. [out] local_dofs Vector containing the local ids of the face DoFs.
◆ get_face_opposite_dofs()
|
inlineprivate |
Return the local ids of DoFs opposite to a given face.
- Parameters
-
[in] local_face_id Local id of the face in the cell. [out] local_opposite_dofs Vector containing the local ids of the opposite DoFs.
◆ get_face_transformation_jacobian()
|
inlineprivate |
Return the face transformation Jacobian.
This is required because the distance minimization problem is solved in the reference face space.
- Parameters
-
[in] cell_transformation_jac Cell transformation Jacobian. [in] local_face_id Local id of the face. [out] face_transformation_jac Face transformation Jacobian.
◆ get_signed_distance() [1/2]
| VectorType & MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >::get_signed_distance | ( | ) |
Get the computed signed distance field.
- Returns
- Reference to the vector storing the computed signed distance values.
◆ get_signed_distance() [2/2]
| const VectorType & MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >::get_signed_distance | ( | ) | const |
Get the computed signed distance field.
- Returns
- Reference to the vector storing the computed signed distance values.
◆ initialize_distance()
|
private |
Initialize the distance vectors to the maximum distance.
◆ output_interface_reconstruction()
| void MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >::output_interface_reconstruction | ( | const std::string & | filename | ) | const |
Output the interface reconstruction used for signed distance computations.
- Parameters
-
[in] filename Name of the output file.
◆ set_face_dofs_map()
|
inlineprivate |
Set the map of local ids of face DoFs for each face.
◆ set_face_opposite_dofs_map()
|
inlineprivate |
Set the map of local ids of opposite DoFs for each face.
◆ set_level_set_from_background_mesh()
| void MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >::set_level_set_from_background_mesh | ( | const dealii::DoFHandler< dim > & | background_dof_handler, |
| const VectorType & | background_level_set_vector | ||
| ) |
Set the level-set field from the background mesh solver.
- Parameters
-
[in] background_dof_handler DoFHandler corresponding to the level-set field solver. [in] background_level_set_vector Level-set solution vector from the background solver.
◆ setup_dofs()
| void MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >::setup_dofs | ( | ) |
Initialize the degrees of freedom and associated memory.
◆ solve()
| void MeltPoolDG::LevelSet::SignedDistanceSolver< dim, VectorType >::solve | ( | ) |
Solve for the signed distance from the given level of the level-set vector.
◆ transform_ref_face_correction_to_ref_cell()
|
inlineprivate |
Transform a Newton correction from the reference face to the reference cell.
- Parameters
-
[in] correction_ref_face Newton correction in the reference face. [in] local_face_id Local id of the face.
- Returns
- Correction vector in the reference cell.
◆ transform_ref_face_point_to_ref_cell()
|
inlineprivate |
Transform a point from a reference face to the reference cell.
- Parameters
-
[in] x_ref_face dealii::Point in the reference face. [in] local_face_id Local id of the face.
- Returns
- dealii::Point in the reference cell.
◆ update_ghost_values()
|
private |
Update ghost DoF entries of solution vectors to gain read access to ghost elements.
◆ zero_out_ghost_values()
|
private |
Zero the ghost DoF entries of solution vectors to gain write access to ghost elements.
Member Data Documentation
◆ constraints
|
private |
Hanging node constraints.
◆ distance
|
private |
Solution vector of the unsigned distance without ghost values.
◆ distance_with_ghost
|
private |
Solution vector of the unsigned distance with ghost values.
◆ dof_handler
|
private |
Pointer to the DoFHandler describing the signed distance problem (can be fed from external)
◆ face_dofs_map
|
private |
Map from face ids to local ids of face DoFs.
◆ face_opposite_dofs_map
|
private |
Map from face ids to local ids of opposite DoFs.
◆ fe
|
private |
Finite element discretizing the signed distance problem.
◆ interface_reconstruction_cells
|
private |
◆ interface_reconstruction_vertices
|
private |
◆ intersected_dofs
|
private |
Set of DoFs belonging to intersected cells.
◆ is_external_dof_handler
|
private |
Flag to indicate whether the DoFHandler is provided externally or built by the solver.
◆ iso_level
|
private |
Iso-level describing the interface from which the signed distance is computed.
◆ level_set
|
private |
Level-set field coming from the background solver.
◆ locally_active_dofs
|
private |
Set of locally active DoFs.
◆ locally_owned_dofs
|
private |
Set of locally owned DoFs.
◆ locally_relevant_dofs
|
private |
Set of locally relevant DoFs.
◆ mapping
|
private |
dealii::Mapping between the real and reference spaces.
◆ max_distance
|
private |
Maximum redistancing distance.
◆ owned_dof_handler
|
private |
DoFHandler describing the signed distance problem.
◆ pcout
|
private |
Parallel output stream.
◆ scaling
|
private |
Scaling factor applied to the input level-set field.
◆ signed_distance
|
private |
Solution vector of the signed distance without ghost values.
◆ signed_distance_with_ghost
|
private |
Solution vector of the signed distance with ghost values.
◆ verbosity
|
private |
Verbosity level.
◆ volume_correction
|
private |
Correction applied to match the cell-wise volume enclosed by the level set.
The documentation for this class was generated from the following files:
- include/meltpooldg/level_set/signed_distance_solver.hpp
- source/level_set/signed_distance_solver.cpp
Generated by