Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
InterfaceTools Namespace Reference

Classes

class  CellWiseFunction
class  InterfaceReconstructionDataOut
class  SignedDistanceSolver
struct  IsocontourBoundingValues

Enumerations

enum  BoundingCoordinates : unsigned int {
  x_min = 0 , x_max = 1 , y_min = 2 , y_max = 3 ,
  z_min = 4 , z_max = 5
}

Functions

template<int dim>
double compute_cell_wise_volume (FEPointEvaluation< 1, dim > &fe_point_evaluation, const typename DoFHandler< dim >::active_cell_iterator &cell, Vector< double > cell_dof_level_set_values, const double corr, const unsigned int n_quad_points)
template<int dim, typename VectorType>
std::pair< double, double > integrate_volume_and_surface (const DoFHandler< dim > &dof_handler, const FiniteElement< dim > &fe, const VectorType &level_set_vector_relevant_copy)
template<int dim, typename VectorType>
std::pair< double, double > integrate_volume_and_surface (const DoFHandler< dim > &dof_handler, const FiniteElement< dim > &fe, const VectorType &level_set_vector, const double iso_level)
template<int dim, typename VectorType>
std::pair< Point< dim >, Tensor< 1, dim > > integrate_barycenter (const DoFHandler< dim > &dof_handler, const FiniteElement< dim > &fe, const VectorType &level_set_vector_relevant_copy, const Mapping< dim > &mapping_velocity, const DoFHandler< dim > &dof_handler_velocity, const FiniteElement< dim > &fe_velocity, const VectorType &velocity_vector)
template<int dim, typename VectorType>
std::pair< Point< dim >, Tensor< 1, dim > > integrate_barycenter (const DoFHandler< dim > &dof_handler, const FiniteElement< dim > &fe, const VectorType &level_set_vector, const Mapping< dim > &mapping_velocity, const DoFHandler< dim > &dof_handler_velocity, const FiniteElement< dim > &fe_velocity, const VectorType &velocity_vector, const double iso_level)
template<int dim, typename VectorType>
void reconstruct_interface (const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const FiniteElement< dim > &fe, const VectorType &level_set_vector, const double iso_level, std::map< types::global_cell_index, std::vector< Point< dim > > > &interface_reconstruction_vertices, std::map< types::global_cell_index, std::vector< CellData< dim - 1 > > > &interface_reconstruction_cells, std::set< types::global_dof_index > &intersected_dofs)
template<int dim, typename VectorType>
IsocontourBoundingValues< dim > compute_isocontour_bounding_values (const DoFHandler< dim > &dof_handler, const VectorType &solution_vector, const double isovalue)
template<int dim, typename VectorType>
void postprocess_isocontour_bounding_values (const Variable &variable, const std::multimap< Variable, std::pair< unsigned int, typename Parameters::PostProcessing< dim >::IsocontourBoundingBoxes::Isocontour > > &ids_and_isocontours_per_variable, const DoFHandler< dim > &dof_handler, const VectorType &solution_vector, const double current_time, const Parameters::Verbosity &verbosity, const ConditionalOStream &pcout, std::vector< TableHandler > &isocontour_bounding_values_tables)
template<int dim>
void write_isocontour_bounding_values_tables (const MPI_Comm &mpi_communicator, const std::string &output_folder, const Variable &variable, const std::multimap< Variable, std::pair< unsigned int, typename Parameters::PostProcessing< dim >::IsocontourBoundingBoxes::Isocontour > > &ids_and_isocontours_per_variable, const std::vector< TableHandler > &isocontour_bounding_values_tables)

Enumeration Type Documentation

◆ BoundingCoordinates

Named indices used to access the bounding coordinates of an isocontour.

This enum defines named indices for the minimum and maximum coordinates stored in IsocontourBoundingValues::bounding_values. The values are ordered by spatial direction: \(x\), \(y\), then \(z\).

Enumerator
x_min 

Minimum x value of the isocontour.

x_max 

Maximum x value of the isocontour.

y_min 

Minimum y value of the isocontour.

y_max 

Maximum y value of the isocontour.

z_min 

Minimum z value of the isocontour.

z_max 

Maximum z value of the isocontour.

Definition at line 1162 of file interface_tools.h.

Function Documentation

◆ compute_cell_wise_volume()

template<int dim>
double InterfaceTools::compute_cell_wise_volume ( FEPointEvaluation< 1, dim > & fe_point_evaluation,
const typename DoFHandler< dim >::active_cell_iterator & cell,
Vector< double > cell_dof_level_set_values,
const double corr,
const unsigned int n_quad_points )

Compute the volume enclosed by the 0 level of a level-set field inside a cell. The inside volume is computed, defined by negative values of the level-set field.

Template Parameters
dimAn integer that denotes the dimension of the space in which the problem is solved.
Parameters
[in]fe_point_evaluationFePointEvaluation
[in]cellCell for which the volume is computed
[in]cell_dof_level_set_valuesCell DoF values of the level-set field
[in]corrCorrection to apply to the DOF values (constant for all DoFs). It can be used if we want the volume enclosed by the iso-level equal to the value of the correction.
[in]n_quad_pointsNumber of quadrature points for the volume integration faces
Returns
cell-wise volume

Definition at line 20 of file interface_tools.cc.

References InterfaceTools::CellWiseFunction< dim, VectorType, FEType >::set_active_cell().

◆ compute_isocontour_bounding_values()

template<int dim, typename VectorType>
IsocontourBoundingValues< dim > InterfaceTools::compute_isocontour_bounding_values ( const DoFHandler< dim > & dof_handler,
const VectorType & solution_vector,
const double isovalue )

Identifies and returns bounding coordinates of a given isocontour by scanning through quadrature points on the isocontour.

Template Parameters
dimAn integer that denotes the dimension of the space in which the problem is solved.
VectorTypeThe vector type of the solution vector.
Parameters
[in]dof_handlerDofHandler associated to the triangulation where the isocontour lies.
[in]solution_vectorSolution vector field.
[in]isovalueIsovalue corresponding to the isocontour of interest.
Returns
Struct with the bounding isocontour's bounding values.

◆ integrate_barycenter() [1/2]

template<int dim, typename VectorType>
std::pair< Point< dim >, Tensor< 1, dim > > InterfaceTools::integrate_barycenter ( const DoFHandler< dim > & dof_handler,
const FiniteElement< dim > & fe,
const VectorType & level_set_vector,
const Mapping< dim > & mapping_velocity,
const DoFHandler< dim > & dof_handler_velocity,
const FiniteElement< dim > & fe_velocity,
const VectorType & velocity_vector,
const double iso_level )

Integrate the barycenter position and velocity of the region enclosed by a given level of a level-set field. The region of interest correspond to the sub-domain where the level-set value is greater or equal to the specified level.

Template Parameters
dimAn integer that denotes the dimension of the space in which the problem is solved.
VectorTypeThe vector type of the solution vector.
Parameters
[in]dof_handlerDofHandler associated to the triangulation on which the level-set is described
[in]feFinite element describing the level-set
[in]level_set_vectorLevel-set vector
[in]mapping_velocityMapping associated to the velocity field
[in]dof_handler_velocityDofHandler associated to the triangulation on which the velocity is described
[in]feFinite element describing the velocity
[in]velocity_vectorVelocity solution vector
[in]iso_levelGiven level of the level-set field enclosing the region of interest
Returns
The position and the velocity of the barycenter of the region enclosed by the specified level of the level-set field. The position is the first entry and the velocity the second.

Definition at line 323 of file interface_tools.cc.

References integrate_barycenter().

◆ integrate_barycenter() [2/2]

template<int dim, typename VectorType>
std::pair< Point< dim >, Tensor< 1, dim > > InterfaceTools::integrate_barycenter ( const DoFHandler< dim > & dof_handler,
const FiniteElement< dim > & fe,
const VectorType & level_set_vector_relevant_copy,
const Mapping< dim > & mapping_velocity,
const DoFHandler< dim > & dof_handler_velocity,
const FiniteElement< dim > & fe_velocity,
const VectorType & velocity_vector )

Integrate the barycenter position and velocity of the volume enclosed by the zero-level of a level set field. The region of interest correspond to the sub-domain where the level-set value is smaller or equal to 0.

Template Parameters
dimAn integer that denotes the dimension of the space in which the problem is solved.
VectorTypeThe vector type of the solution vector.
Parameters
[in]dof_handlerDofHandler associated to the triangulation on which the level-set is described
[in]feFinite element describing the level-set
[in]level_set_vector_relevant_copyLevel-set vector
[in]mapping_velocityMapping associated to the velocity field
[in]dof_handler_velocityDofHandler associated to the triangulation on which the velocity is described
[in]feFinite element describing the velocity
[in]velocity_vectorVelocity solution vector
Returns
The position and the velocity of the barycenter of the region enclosed by the zero-level of the level-set field. The position is the first entry and the velocity the second.

Definition at line 189 of file interface_tools.cc.

◆ integrate_volume_and_surface() [1/2]

template<int dim, typename VectorType>
std::pair< double, double > InterfaceTools::integrate_volume_and_surface ( const DoFHandler< dim > & dof_handler,
const FiniteElement< dim > & fe,
const VectorType & level_set_vector,
const double iso_level )

Overload of the function above. Here, the zero-contour of the level set field is defined with respect to the iso_level value precised by shifting the values of the level set field.

Template Parameters
dimAn integer that denotes the dimension of the space in which the problem is solved.
VectorTypeThe vector type of the solution vector.
Parameters
[in]dof_handlerDofHandler associated to the triangulation on which the volume is computed
[in]feFinite element
[in]level_set_vectorLevel-set vector
[in]iso_levelGiven level of the level-set field enclosing the volume of interest
Returns
Volume and surface enclosed by specified iso_level. The volume is the first value and the surface the second.

Definition at line 147 of file interface_tools.cc.

References integrate_volume_and_surface().

◆ integrate_volume_and_surface() [2/2]

template<int dim, typename VectorType>
std::pair< double, double > InterfaceTools::integrate_volume_and_surface ( const DoFHandler< dim > & dof_handler,
const FiniteElement< dim > & fe,
const VectorType & level_set_vector_relevant_copy )

Integrate the surface area of a given level of a level set field and the volume enclosed by it. The inside volume is computed, defined by negative values of the level-set field.

Template Parameters
dimAn integer that denotes the dimension of the space in which the problem is solved.
VectorTypeThe vector type of the solution vector.
Parameters
[in]dof_handlerDofHandler associated to the triangulation on which the volume is computed
[in]feFinite element
[in]level_set_vector_relevant_copyLevel-set vector
Returns
Volume enclosed by specified level and its surface area. The volume is the first value and the surface the second.

Definition at line 70 of file interface_tools.cc.

◆ postprocess_isocontour_bounding_values()

template<int dim, typename VectorType>
void InterfaceTools::postprocess_isocontour_bounding_values ( const Variable & variable,
const std::multimap< Variable, std::pair< unsigned int, typename Parameters::PostProcessing< dim >::IsocontourBoundingBoxes::Isocontour > > & ids_and_isocontours_per_variable,
const DoFHandler< dim > & dof_handler,
const VectorType & solution_vector,
const double current_time,
const Parameters::Verbosity & verbosity,
const ConditionalOStream & pcout,
std::vector< TableHandler > & isocontour_bounding_values_tables )

Identifies the bounding values of requested isocontours using InterfaceTools::compute_isocontour_bounding_values.

Template Parameters
dimAn integer that denotes the dimension of the space in which the problem is solved.
VectorTypeThe vector type of the solution vector.
Parameters
[in]variableVariable of the isocontour.
[in]ids_and_isocontours_per_variableMap of isocontours with their IDs sorted with their variable as a key.
[in]dof_handlerDofHandler associated to the triangulation where the isocontour lies.
[in]solution_vectorSolution vector field.
[in]current_timeCurrent simulation time.
[in]verbosityVerbosity level for console output.
[in]pcoutParallel conditional output stream used to print information on console.
[in,out]isocontour_bounding_values_tablesTables to be filled with isocontour bounding values of the current time.

Definition at line 1764 of file interface_tools.cc.

References InterfaceTools::IsocontourBoundingValues< dim >::bounding_coordinates_names, InterfaceTools::IsocontourBoundingValues< dim >::bounding_values, compute_isocontour_bounding_values(), InterfaceTools::IsocontourBoundingValues< dim >::isocontour_exists, and Parameters::verbose.

◆ reconstruct_interface()

template<int dim, typename VectorType>
void InterfaceTools::reconstruct_interface ( const Mapping< dim > & mapping,
const DoFHandler< dim > & dof_handler,
const FiniteElement< dim > & fe,
const VectorType & level_set_vector,
const double iso_level,
std::map< types::global_cell_index, std::vector< Point< dim > > > & interface_reconstruction_vertices,
std::map< types::global_cell_index, std::vector< CellData< dim - 1 > > > & interface_reconstruction_cells,
std::set< types::global_dof_index > & intersected_dofs )

Reconstruct the interface defined by a given level of a level set field in the domain.

Template Parameters
dimAn integer that denotes the dimension of the space in which the problem is solved.
VectorTypeThe vector type of the solution vector.
Parameters
[in]mappingMapping of the domain
[in]dof_handlerDofHandler associated to the triangulation for which the interface is reconstructed
[in]feFinite element
[in]level_set_vectorLevel-set vector
[in]iso_levelGiven level of the level-set field defining the interface of interest
[in,out]interface_reconstruction_verticesCell-wise map of the reconstructed surface vertices. The map contains vectors storing the vertices of the reconstructed surface for each intersected volume cell (dim).
[in,out]interface_reconstruction_cellsCell-wise map of the reconstructed surface cells. The map contains vectors storing the cell (dim-1) of the reconstructed surface for each intersected volume cell (dim).
[in,out]intersected_dofsSet of DoFs that belong to intersected volume cell (dim).

Definition at line 382 of file interface_tools.cc.

◆ write_isocontour_bounding_values_tables()

template<int dim>
void InterfaceTools::write_isocontour_bounding_values_tables ( const MPI_Comm & mpi_communicator,
const std::string & output_folder,
const Variable & variable,
const std::multimap< Variable, std::pair< unsigned int, typename Parameters::PostProcessing< dim >::IsocontourBoundingBoxes::Isocontour > > & ids_and_isocontours_per_variable,
const std::vector< TableHandler > & isocontour_bounding_values_tables )

Writes the bounding values tables of the specified isocontours in their respective output files.

Parameters
[in]mpi_communicatorMPI communicator.
[in]output_folderOutput folder where the output files are saved.
[in]variableVariable of the isocontour.
[in]ids_and_isocontours_per_variableMap of isocontours with their IDs sorted with their variable as a key.
[in]isocontour_bounding_values_tablesTables with isocontour bounding values.

Definition at line 1868 of file interface_tools.cc.