include/meltpooldg/level_set/signed_distance_solver.hpp Source File
|
Developer Documentation
|
signed_distance_solver.hpp
Go to the documentation of this file.
Scalar function defined by the DoF values of a single cell.
Definition signed_distance_solver.hpp:384
unsigned int n_cell_wise_dofs
Number of DoFs per element.
Definition signed_distance_solver.hpp:467
double value(const dealii::Point< dim > &point, const unsigned int component=0) const override
Return the value of the function at a point in the reference cell.
Definition signed_distance_solver.hpp:417
dealii::Tensor< 1, dim > gradient(const dealii::Point< dim > &point, const unsigned int component=0) const override
Return the gradient of the specified component at a point in the reference cell.
Definition signed_distance_solver.hpp:436
VectorType cell_dof_values
Value of the field at the DoFs of the active cell.
Definition signed_distance_solver.hpp:469
dealii::SymmetricTensor< 2, dim > hessian(const dealii::Point< dim > &point, const unsigned int component=0) const override
Return the Hessian of the specified component at a point in the reference cell.
Definition signed_distance_solver.hpp:455
void set_active_cell(const VectorType &in_local_dof_values)
Set the active cell values used for subsequent evaluations.
Definition signed_distance_solver.hpp:403
FEType fe
Finite element discretizing the field of interest.
Definition signed_distance_solver.hpp:465
CellWiseFunction(const unsigned int p_fe_degree)
Constructor.
Definition signed_distance_solver.hpp:392
Interface to build patches of the interface reconstruction vertices for visualization.
Definition signed_distance_solver.hpp:598
void build_patches(const std::map< dealii::types::global_cell_index, std::vector< dealii::Point< dim > > > &interface_reconstruction_vertices)
Build patches from interface reconstruction vertices for visualization.
Definition signed_distance_solver.hpp:608
const std::vector< dealii::DataOutBase::Patch< 0, dim > > & get_patches() const override
Implementation of the corresponding function of the base class.
Definition signed_distance_solver.hpp:625
std::vector< dealii::DataOutBase::Patch< 0, dim > > patches
Output information filled by build_patches() and written by the base class.
Definition signed_distance_solver.hpp:640
std::vector< std::string > dataset_names
List of field names for all data components stored in patches.
Definition signed_distance_solver.hpp:642
std::vector< std::string > get_dataset_names() const override
Implementation of the corresponding function of the base class.
Definition signed_distance_solver.hpp:634
Solver to compute the signed distance from a given level of a level-set field.
Definition signed_distance_solver.hpp:658
void setup_dofs()
Initialize the degrees of freedom and associated memory.
Definition signed_distance_solver.cpp:224
bool is_external_dof_handler
Definition signed_distance_solver.hpp:943
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.
Definition signed_distance_solver.cpp:510
void set_face_opposite_dofs_map()
Set the map of local ids of opposite DoFs for each face.
Definition signed_distance_solver.cpp:388
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.
std::map< unsigned int, std::vector< unsigned int > > face_dofs_map
Map from face ids to local ids of face DoFs.
Definition signed_distance_solver.hpp:996
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.
Definition signed_distance_solver.cpp:452
const double scaling
Scaling factor applied to the input level-set field.
Definition signed_distance_solver.hpp:959
void set_face_dofs_map()
Set the map of local ids of face DoFs for each face.
Definition signed_distance_solver.cpp:411
std::set< dealii::types::global_dof_index > intersected_dofs
Set of DoFs belonging to intersected cells.
Definition signed_distance_solver.hpp:991
std::map< dealii::types::global_cell_index, std::vector< dealii::CellData< dim==1 ? 1 :dim - 1 > > > interface_reconstruction_cells
Definition signed_distance_solver.hpp:989
VectorType distance
Solution vector of the unsigned distance without ghost values.
Definition signed_distance_solver.hpp:979
void conserve_global_volume()
Correct the global volume to match the volume enclosed by the given level of the level-set field.
Definition signed_distance_solver.cpp:1096
void update_ghost_values() const
Update ghost DoF entries of solution vectors to gain read access to ghost elements.
Definition signed_distance_solver.cpp:362
void compute_signed_distance_from_distance()
Compute signed_distance from the unsigned distance and the sign of the signed-distance entries.
Definition signed_distance_solver.cpp:978
void compute_first_neighbors_distance()
Compute brute-force geometric distances between the reconstructed interface and DoFs of intersected c...
Definition signed_distance_solver.cpp:587
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.
Definition signed_distance_solver.cpp:443
std::unique_ptr< dealii::FiniteElement< dim > > fe
Finite element discretizing the signed distance problem.
Definition signed_distance_solver.hpp:945
void output_interface_reconstruction(const std::string &filename) const
Output the interface reconstruction used for signed distance computations.
Definition signed_distance_solver.cpp:1189
VectorType volume_correction
Correction applied to match the cell-wise volume enclosed by the level set.
Definition signed_distance_solver.hpp:983
void initialize_distance()
Initialize the distance vectors to the maximum distance.
Definition signed_distance_solver.cpp:312
dealii::IndexSet locally_active_dofs
Set of locally active DoFs.
Definition signed_distance_solver.hpp:970
std::unique_ptr< dealii::DoFHandler< dim > > owned_dof_handler
DoFHandler describing the signed distance problem.
Definition signed_distance_solver.hpp:947
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.
Definition signed_distance_solver.cpp:255
const double max_distance
Maximum redistancing distance.
Definition signed_distance_solver.hpp:955
VectorType signed_distance_with_ghost
Solution vector of the signed distance with ghost values.
Definition signed_distance_solver.hpp:977
void compute_second_neighbors_distance()
Compute marching-method geometric distances between the reconstructed interface and remaining DoFs.
Definition signed_distance_solver.cpp:628
VectorType signed_distance
Solution vector of the signed distance without ghost values.
Definition signed_distance_solver.hpp:975
void solve()
Solve for the signed distance from the given level of the level-set vector.
Definition signed_distance_solver.cpp:275
VectorType & get_signed_distance()
Get the computed signed distance field.
Definition signed_distance_solver.cpp:327
VectorType level_set
Level-set field coming from the background solver.
Definition signed_distance_solver.hpp:973
std::map< unsigned int, std::vector< unsigned int > > face_opposite_dofs_map
Map from face ids to local ids of opposite DoFs.
Definition signed_distance_solver.hpp:994
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.
Definition signed_distance_solver.cpp:493
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.
Definition signed_distance_solver.cpp:531
void zero_out_ghost_values() const
Zero the ghost DoF entries of solution vectors to gain write access to ghost elements.
Definition signed_distance_solver.cpp:351
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.
Definition signed_distance_solver.cpp:434
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.
std::unique_ptr< dealii::AffineConstraints< double > > constraints
Hanging node constraints.
Definition signed_distance_solver.hpp:999
void compute_cell_wise_volume_correction()
Compute the cell-wise volume correction matching the volume enclosed by the given level of the level-...
Definition signed_distance_solver.cpp:993
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||.
Definition signed_distance_solver.hpp:937
const dealii::DoFHandler< dim > * dof_handler
Pointer to the DoFHandler describing the signed distance problem (can be fed from external)
Definition signed_distance_solver.hpp:950
const double iso_level
Iso-level describing the interface from which the signed distance is computed.
Definition signed_distance_solver.hpp:957
void exchange_distance()
Exchange the distance field and keep the minimum value across processors with compress(VectorOperatio...
Definition signed_distance_solver.cpp:373
Verbosity verbosity
Verbosity level.
Definition signed_distance_solver.hpp:961
dealii::ConditionalOStream pcout
Parallel output stream.
Definition signed_distance_solver.hpp:964
dealii::IndexSet locally_owned_dofs
Set of locally owned DoFs.
Definition signed_distance_solver.hpp:966
VectorType distance_with_ghost
Solution vector of the unsigned distance with ghost values.
Definition signed_distance_solver.hpp:981
std::unique_ptr< dealii::MappingQ< dim > > mapping
dealii::Mapping between the real and reference spaces.
Definition signed_distance_solver.hpp:952
dealii::IndexSet locally_relevant_dofs
Set of locally relevant DoFs.
Definition signed_distance_solver.hpp:968
std::map< dealii::types::global_cell_index, std::vector< dealii::Point< dim > > > interface_reconstruction_vertices
Definition signed_distance_solver.hpp:986
const dealii::DoFHandler< dim > & get_dof_handler() const
Get the DoFHandler used by the signed distance solver.
Definition signed_distance_solver.hpp:747
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.
Definition signed_distance_solver.cpp:473
This operation solves the reinitialization problem for a CG- or DG-FEM-based discrete level-set field...
Definition advection_DG_operation.hpp:20
std::vector< typename dealii::DoFHandler< dim >::active_cell_iterator > find_cells_around_cell(std::map< unsigned int, std::set< typename dealii::DoFHandler< dim >::active_cell_iterator > > &vertices_cell_map, const typename dealii::DoFHandler< dim >::active_cell_iterator &cell)
Find all active cells sharing at least one vertex with a given cell.
Definition signed_distance_solver.hpp:165
double compute_cell_wise_volume(dealii::FEPointEvaluation< 1, dim > &fe_point_evaluation, const typename dealii::DoFHandler< dim >::active_cell_iterator &cell, dealii::Vector< double > cell_dof_level_set_values, const double corr, const unsigned int n_quad_points)
Compute the volume enclosed by the zero level of a level-set field inside a cell.
std::pair< double, double > integrate_volume_and_surface(const dealii::DoFHandler< dim > &dof_handler, const dealii::FiniteElement< dim > &fe, const VectorType &level_set_vector_relevant_copy)
Integrate the surface area of the zero level of a level-set field and the volume enclosed by it.
double compute_cell_diameter(const double cell_measure, const unsigned int fe_degree)
Compute an equivalent cell diameter from a cell measure.
Definition signed_distance_solver.hpp:114
void vertices_cell_mapping(const dealii::DoFHandler< dim > &dof_handler, std::map< unsigned int, std::set< typename dealii::DoFHandler< dim >::active_cell_iterator > > &vertices_cell_map)
Build a map from mesh vertex indices to the active cells that contain them.
Definition signed_distance_solver.hpp:140
Verbosity
Verbosity levels used to control console output.
Definition signed_distance_solver.hpp:60
constexpr int sgn(const T val) noexcept
Return the sign of a value.
Definition signed_distance_solver.hpp:76
double find_point_triangle_distance(const std::vector< dealii::Point< dim > > &triangle, const dealii::Point< dim > &point)
Compute the shortest distance between a point and an interface segment or triangle.
Definition signed_distance_solver.hpp:200
void reconstruct_interface(const dealii::Mapping< dim > &mapping, const dealii::DoFHandler< dim > &dof_handler, const dealii::FiniteElement< dim > &fe, const VectorType &level_set_vector, const double iso_level, const int mca_n_subdivisions, 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)
Reconstruct the interface defined by a given level of a level-set field in the domain.
void announce_string(const dealii::ConditionalOStream &pcout, const std::string &expression, const char delimiter='-')
Print a string surrounded by delimiter lines.
Definition signed_distance_solver.hpp:89
dealii::VectorizedArray< number, N > scalar_product(const dealii::VectorizedArray< number, N > &scalar, const dealii::Tensor< 1, 1, dealii::VectorizedArray< number, N > > &vec)
Definition dealii_tensor.hpp:60
Generated by