CArl
Code Arlequin / C++ implementation
|
Class used to construct the intersection meshes. More...
#include <mesh_intersection_methods.h>
Public Member Functions | |
Mesh_Intersection (libMesh::ReplicatedMesh &mesh, const libMesh::Mesh &mesh_A, const libMesh::Mesh &mesh_B, IntersectionMeshingMethod MeshingMethod=IntersectionMeshingMethod::CGAL, int map_preallocation=1E6, long grid_n_min=static_cast< long >(1E9), bool debugOutput=false) | |
const libMesh::ReplicatedMesh & | mesh () |
Returns the address of the intersection mesh. More... | |
libMesh::Point & | min_point () |
Returns the minimal point of the discrete grid. More... | |
libMesh::Point & | max_point () |
Returns the maximum point of the discrete grid. More... | |
double | eps () |
Returns the discrete grid step. More... | |
double | min_vol () |
Returns the minimal polyhedron volume. More... | |
std::vector< long > & | grid_sizes () |
Returns the discrete grid sizes. More... | |
long | grid_min_size () |
Returns the minimum discrete grid size. More... | |
void | initialize () |
Initialize the data structures. More... | |
void | preallocate_grid (int map_preallocation) |
Preallocate the discrete points grid. More... | |
void | set_grid_constraints (const libMesh::Mesh &mesh_A, const libMesh::Mesh &mesh_B, double vol_tol=-1) |
Set the boundaries of the discrete points grid, taking into account the geometry of meshes mesh_A and mesh_B. More... | |
void | triangulate_intersection (const std::set< libMesh::Point > &input_points) |
Triangulate an intersection defined by a set of libMesh::Points, using either CGAL or Tetgen. More... | |
void | increase_intersection_mesh (const std::set< libMesh::Point > &input_points, unsigned int elem_idx_A, unsigned int elem_idx_B, unsigned int elem_idx_C) |
Increase the intersection mesh with the current polyhedron mesh and update its data structures. More... | |
void | export_intersection_data (const std::string &filename_base, const std::string &mesh_format=std::string(".e")) |
Export both the intersection mesh its data structures. More... | |
void | prepare_for_use () |
Prepare the intersection mesh for use. More... | |
double | get_total_volume () |
Calculate the intersection mesh's total volume. More... | |
double | get_intersection_volume (std::set< libMesh::Point > &input_points) |
Calculate the volume of an polyhedron defined by the point set. More... | |
void | convert_to_discrete (const libMesh::Point &iPoint, std::vector< long > &oPoint) |
Convert a real valued point to a discrete point. More... | |
Protected Member Functions | |
Mesh_Intersection () | |
(Protected) default constructor More... | |
void | update_intersection_mesh () |
Update the intersection mesh with the current polyhedron mesh data. More... | |
void | update_intersection_pairs (unsigned int elem_idx_A, unsigned int elem_idx_B, unsigned int inter_id) |
Update the intersection pair map with a new pair associated to the intersection no. inter_id. More... | |
void | update_intersection_element_range (unsigned int range_start, unsigned int range_end, unsigned int inter_id) |
Update the intersection element range map with a new range associated to the intersection no. inter_id. More... | |
Protected Attributes | |
const libMesh::Parallel::Communicator & | m_comm |
Intersection mesh communicator. More... | |
const unsigned int | m_nodes |
Intersection mesh number of processors (useless!). More... | |
const unsigned int | m_rank |
Intersection mesh processor rank (useless!). More... | |
const libMesh::Parallel::Communicator & | m_global_comm |
Full system communicator. More... | |
const unsigned int | m_global_nodes |
Full system number of processors. More... | |
const unsigned int | m_global_rank |
Full system processor rank. More... | |
libMesh::ReplicatedMesh & | m_libMesh_Mesh |
Address of the intersection mesh. More... | |
libMesh::Mesh | m_libMesh_PolyhedronMesh |
libMesh Mesh containing the tetrahedrization of an intersection polyhedron (the polyhedron mesh). More... | |
DT_3 | m_CGAL_PolyhedronMesh |
Auxiliary CGAL mesh, used if CGAL is chosen for the tetrahedrization. More... | |
libMesh::TetGenMeshInterface | m_TetGenInterface |
TetGen interface. More... | |
Kernel_to_ExactKernel | ConvertInexactToExact |
Convert inexact CGAL constructs to exact constructs. More... | |
ExactKernel_to_Kernel | ConvertExactToInexact |
Convert exact CGAL constructs to inexact constructs. More... | |
unsigned int | m_nb_of_intersections |
std::unordered_map< unsigned int, std::pair< unsigned int, unsigned int > > | m_intersection_pairs |
Unordered map containing the element pair associated to each intersection (key). More... | |
std::unordered_map< unsigned int, unsigned int > | m_intersection_couplings |
Unordered map associating each intersection (key) to a coupling element (useless!) More... | |
std::unordered_map< unsigned int, std::pair< unsigned int, unsigned int > > | m_intersection_element_range |
Unordered map associating each intersection (key) to a range of elements in the intersection mesh. More... | |
double | m_eps |
Precision of the discrete point grid. More... | |
double | m_vol_tol |
Minimal volume for the intersection polyhedrons. More... | |
std::vector< long > | m_GridN |
Dimensions of the discrete point grid. More... | |
std::vector< long > | m_dummy_discrete_point |
libMesh::Point | m_Grid_MinPoint |
Minimal point of the discrete grid. More... | |
libMesh::Point | m_Grid_MaxPoint |
Maximum point of the discrete grid. More... | |
std::unordered_map< std::vector< long >, unsigned int, PointHash_3D, PointHash_3D_Equal > | m_discrete_vertices |
Unordered map (or hash) for the discrete points (key). More... | |
long | m_GridN_min |
Minimal number of integers over each dimension of the discrete grid. More... | |
unsigned int | m_nb_of_elements |
Number of elements of the intersection mesh. More... | |
unsigned int | m_nb_of_vertices |
Number of vertices of the intersection mesh. More... | |
std::vector< unsigned int > | m_intersection_point_indexes |
(Unused!) More... | |
unsigned int | m_nb_of_points |
(Unused!) More... | |
bool | m_bMeshFinalized |
Boolean controlling if the intersection mesh was finished or not. More... | |
bool | m_bPrintDebug |
Print debug information? Default: false. More... | |
IntersectionMeshingMethod | m_MeshingMethod |
Choice of meshing algorithm. More... | |
Class used to construct the intersection meshes.
It contains methods to tetrahedrize polyhedrons (using either CGAL or Tetgen) and to increase the intersection mesh. To avoid rounding error problems during the mesh constructions, each vertex point is associated to a discrete point inside a grid. This grid is constructed taking into account the dimensions of the meshes for which we want to find the intersections.
Definition at line 32 of file mesh_intersection_methods.h.
|
protected |
(Protected) default constructor
|
inline |
Definition at line 140 of file mesh_intersection_methods.h.
void carl::Mesh_Intersection::convert_to_discrete | ( | const libMesh::Point & | iPoint, |
std::vector< long > & | oPoint | ||
) |
Convert a real valued point to a discrete point.
Definition at line 352 of file mesh_intersection_methods.cpp.
double carl::Mesh_Intersection::eps | ( | ) |
Returns the discrete grid step.
Definition at line 130 of file mesh_intersection_methods.cpp.
void carl::Mesh_Intersection::export_intersection_data | ( | const std::string & | filename_base, |
const std::string & | mesh_format = std::string(".e") |
||
) |
Export both the intersection mesh its data structures.
Definition at line 262 of file mesh_intersection_methods.cpp.
double carl::Mesh_Intersection::get_intersection_volume | ( | std::set< libMesh::Point > & | input_points | ) |
Calculate the volume of an polyhedron defined by the point set.
Definition at line 335 of file mesh_intersection_methods.cpp.
double carl::Mesh_Intersection::get_total_volume | ( | ) |
Calculate the intersection mesh's total volume.
Definition at line 318 of file mesh_intersection_methods.cpp.
long carl::Mesh_Intersection::grid_min_size | ( | ) |
Returns the minimum discrete grid size.
Definition at line 145 of file mesh_intersection_methods.cpp.
std::vector< long > & carl::Mesh_Intersection::grid_sizes | ( | ) |
Returns the discrete grid sizes.
Definition at line 140 of file mesh_intersection_methods.cpp.
void carl::Mesh_Intersection::increase_intersection_mesh | ( | const std::set< libMesh::Point > & | input_points, |
unsigned int | elem_idx_A, | ||
unsigned int | elem_idx_B, | ||
unsigned int | elem_idx_C | ||
) |
Increase the intersection mesh with the current polyhedron mesh and update its data structures.
Definition at line 236 of file mesh_intersection_methods.cpp.
void carl::Mesh_Intersection::initialize | ( | ) |
Initialize the data structures.
Definition at line 150 of file mesh_intersection_methods.cpp.
libMesh::Point & carl::Mesh_Intersection::max_point | ( | ) |
Returns the maximum point of the discrete grid.
Definition at line 125 of file mesh_intersection_methods.cpp.
const libMesh::ReplicatedMesh & carl::Mesh_Intersection::mesh | ( | ) |
Returns the address of the intersection mesh.
Definition at line 115 of file mesh_intersection_methods.cpp.
libMesh::Point & carl::Mesh_Intersection::min_point | ( | ) |
Returns the minimal point of the discrete grid.
Definition at line 120 of file mesh_intersection_methods.cpp.
double carl::Mesh_Intersection::min_vol | ( | ) |
Returns the minimal polyhedron volume.
Definition at line 135 of file mesh_intersection_methods.cpp.
void carl::Mesh_Intersection::preallocate_grid | ( | int | map_preallocation | ) |
Preallocate the discrete points grid.
Definition at line 164 of file mesh_intersection_methods.cpp.
void carl::Mesh_Intersection::prepare_for_use | ( | ) |
Prepare the intersection mesh for use.
Definition at line 295 of file mesh_intersection_methods.cpp.
void carl::Mesh_Intersection::set_grid_constraints | ( | const libMesh::Mesh & | mesh_A, |
const libMesh::Mesh & | mesh_B, | ||
double | vol_tol = -1 |
||
) |
Set the boundaries of the discrete points grid, taking into account the geometry of meshes mesh_A and mesh_B.
Definition at line 170 of file mesh_intersection_methods.cpp.
void carl::Mesh_Intersection::triangulate_intersection | ( | const std::set< libMesh::Point > & | input_points | ) |
Triangulate an intersection defined by a set of libMesh::Points, using either CGAL or Tetgen.
Definition at line 6 of file mesh_intersection_methods.cpp.
|
protected |
Update the intersection element range map with a new range associated to the intersection no. inter_id.
Definition at line 110 of file mesh_intersection_methods.cpp.
|
protected |
Update the intersection mesh with the current polyhedron mesh data.
Definition at line 66 of file mesh_intersection_methods.cpp.
|
protected |
Update the intersection pair map with a new pair associated to the intersection no. inter_id.
Definition at line 105 of file mesh_intersection_methods.cpp.
|
protected |
Convert exact CGAL constructs to inexact constructs.
Definition at line 60 of file mesh_intersection_methods.h.
|
protected |
Convert inexact CGAL constructs to exact constructs.
Definition at line 59 of file mesh_intersection_methods.h.
|
protected |
Boolean controlling if the intersection mesh was finished or not.
Definition at line 113 of file mesh_intersection_methods.h.
|
protected |
Print debug information? Default: false.
Definition at line 116 of file mesh_intersection_methods.h.
|
protected |
Auxiliary CGAL mesh, used if CGAL is chosen for the tetrahedrization.
Definition at line 53 of file mesh_intersection_methods.h.
|
protected |
Intersection mesh communicator.
Definition at line 39 of file mesh_intersection_methods.h.
|
protected |
Unordered map (or hash) for the discrete points (key).
Definition at line 95 of file mesh_intersection_methods.h.
|
protected |
Definition at line 85 of file mesh_intersection_methods.h.
|
protected |
Precision of the discrete point grid.
Definition at line 77 of file mesh_intersection_methods.h.
|
protected |
Full system communicator.
Definition at line 43 of file mesh_intersection_methods.h.
|
protected |
Full system number of processors.
Definition at line 44 of file mesh_intersection_methods.h.
|
protected |
Full system processor rank.
Definition at line 45 of file mesh_intersection_methods.h.
|
protected |
Maximum point of the discrete grid.
Definition at line 91 of file mesh_intersection_methods.h.
|
protected |
Minimal point of the discrete grid.
Definition at line 88 of file mesh_intersection_methods.h.
|
protected |
Dimensions of the discrete point grid.
Definition at line 83 of file mesh_intersection_methods.h.
|
protected |
Minimal number of integers over each dimension of the discrete grid.
Definition at line 98 of file mesh_intersection_methods.h.
|
protected |
Unordered map associating each intersection (key) to a coupling element (useless!)
Definition at line 68 of file mesh_intersection_methods.h.
|
protected |
Unordered map associating each intersection (key) to a range of elements in the intersection mesh.
Definition at line 71 of file mesh_intersection_methods.h.
|
protected |
Unordered map containing the element pair associated to each intersection (key).
Definition at line 65 of file mesh_intersection_methods.h.
|
protected |
(Unused!)
Definition at line 107 of file mesh_intersection_methods.h.
|
protected |
Address of the intersection mesh.
Definition at line 47 of file mesh_intersection_methods.h.
|
protected |
libMesh Mesh containing the tetrahedrization of an intersection polyhedron (the polyhedron mesh).
Definition at line 50 of file mesh_intersection_methods.h.
|
protected |
Choice of meshing algorithm.
Can be either IntersectionMeshingMethod::LIBMESH_TETGEN or IntersectionMeshingMethod:: CGAL. Default: IntersectionMeshingMethod:: CGAL.
Definition at line 122 of file mesh_intersection_methods.h.
|
protected |
Number of elements of the intersection mesh.
Definition at line 101 of file mesh_intersection_methods.h.
|
protected |
Definition at line 62 of file mesh_intersection_methods.h.
|
protected |
(Unused!)
Definition at line 110 of file mesh_intersection_methods.h.
|
protected |
Number of vertices of the intersection mesh.
Definition at line 104 of file mesh_intersection_methods.h.
|
protected |
Intersection mesh number of processors (useless!).
Definition at line 40 of file mesh_intersection_methods.h.
|
protected |
Intersection mesh processor rank (useless!).
Definition at line 41 of file mesh_intersection_methods.h.
|
protected |
TetGen interface.
Definition at line 56 of file mesh_intersection_methods.h.
|
protected |
Minimal volume for the intersection polyhedrons.
Definition at line 80 of file mesh_intersection_methods.h.