CArl
Code Arlequin / C++ implementation
|
Class with a series of methods to find the intersections between libMesh's elements, using CGAL internally. More...
#include <intersection_tools.h>
Public Member Functions | |
Intersection_Tools (const libMesh::Elem *elem_C, double Min_Inter_Volume=1E-21, bool bDoPerf_log=false) | |
Constructor with a pre-defined coupling element. It preallocates most objects and build the decomposition mappings. More... | |
Intersection_Tools (double Min_Inter_Volume=1E-21, bool bDoPerf_log=false) | |
Constructor preallocating most objects and building the decomposition mappings. More... | |
const libMesh::Elem * | FindFirstIntersection (const libMesh::Elem *Query_elem, std::unique_ptr< libMesh::PointLocatorBase > &point_locator, bool bGuaranteeQueryIsInMesh=false) |
Find an element from a mesh intersecting Query_elem, using the mesh's libMesh::PointLocatorBase. More... | |
bool | FindAllIntersection (const libMesh::Elem *Query_elem, std::unique_ptr< libMesh::PointLocatorBase > &point_locator, std::set< unsigned int > &Intersecting_elems) |
Find all elements from the mesh intersecting Query_elem, using the mesh's libMesh::PointLocatorBase. More... | |
bool | libMesh_exact_do_intersect (const libMesh::Elem *elem_A, const libMesh::Elem *elem_B) |
Determinate if two elements intersect. More... | |
bool | libMesh_exact_intersection (const libMesh::Elem *elem_A, const libMesh::Elem *elem_B, std::set< Point_3 > &points_out, bool bCreateNewNefForA=true, bool bConvertPoints=true, bool bTestNeeded=true) |
Build the intersection between two elements. More... | |
bool | libMesh_exact_do_intersect_inside_coupling (const libMesh::Elem *elem_A, const libMesh::Elem *elem_B, bool bCreateNewNefForA=true) |
Determinate if two elements intersect inside the coupling region. More... | |
bool | libMesh_exact_intersection_inside_coupling (const libMesh::Elem *elem_A, const libMesh::Elem *elem_B, std::set< libMesh::Point > &points_out, bool bCreateNewNefForA=true, bool bConvertPoints=true, bool bTestNeeded=false) |
Build the intersection between two elements intersect inside the coupling region. More... | |
void | libmesh_set_coupling_nef_polyhedron (const libMesh::Elem *elem_C) |
Set the Nef polyhedron for the coupling mesh element. More... | |
void | convert_elem_to_exact_points (const libMesh::Elem *elem_input, std::vector< ExactPoint_3 > &points_output) |
Convert an libMesh element to a list of CGAL exact points. More... | |
void | convert_exact_points_to_Nef (std::vector< ExactPoint_3 >::const_iterator it_begin, std::vector< ExactPoint_3 >::const_iterator it_end, Nef_Polyhedron &nef_out) |
Convert an CGAL exact point set to a CGAL Nef polyhedron. More... | |
Protected Member Functions | |
void | set_element_indexes () |
Build the tetrahedron and triangle decomposition mappings. More... | |
bool | elements_do_intersect (std::vector< ExactPoint_3 > &elem_C_points, std::vector< std::vector< unsigned int > > &elem_C_tetras, std::vector< std::vector< unsigned int > > &elem_C_triangles, std::vector< ExactPoint_3 > &elem_D_points, std::vector< std::vector< unsigned int > > &elem_D_tetras, std::vector< std::vector< unsigned int > > &elem_D_triangles) |
Determinate if two elements intersect, using their points and decompositions. More... | |
Protected Attributes | |
Nef_Polyhedron | m_nef_A |
Nef polyhedrons for the elements. More... | |
Nef_Polyhedron | m_nef_B |
Nef_Polyhedron | m_nef_I |
Nef_Polyhedron | m_nef_C |
Nef_Polyhedron | m_nef_I_AC |
Nef polyhedron used to save the intersection between m_nef_A and m_nef_C, reducing the number of intersection operations. More... | |
std::vector< ExactPoint_3 > | m_exact_points_A |
CGAL Exact point vectors. More... | |
std::vector< ExactPoint_3 > | m_exact_points_B |
std::vector< ExactPoint_3 > | m_exact_points_C |
ExactPolyhedron | m_dummyPoly |
Intersection polyhedron. More... | |
CGAL::Convex_hull_traits_3< ExactKernel > | ExactHullTraits |
CGAL ExactKernel's convex hull traits. 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... | |
ExactTetrahedron | m_test_tetra |
ExactTriangle_3 | m_test_triangle |
double | m_Min_Inter_Volume |
Minimal volume cutoff for the intersections. More... | |
bool | MASTER_bPerfLog_intersection_tools |
Do performance log? Default: false. More... | |
libMesh::PerfLog | m_perf_log |
libMesh::PerfLog object. More... | |
std::vector< std::vector< unsigned int > > | m_TET_tetrahedrons |
Vertex indices for a TET* element tetrahedron. More... | |
std::vector< std::vector< unsigned int > > | m_TET_triangles |
Vertex indices for a TET* element surface triangles. More... | |
std::vector< std::vector< unsigned int > > | m_TET_edges |
Vertex indices for a TET* element edges (not used!) More... | |
std::vector< std::vector< unsigned int > > | m_HEX_tetrahedrons |
Vertex indices for a HEX* element tetrahedron decomposition. More... | |
std::vector< std::vector< unsigned int > > | m_HEX_triangles |
Vertex indices for a HEX* element surface triangles decomposition. More... | |
std::vector< std::vector< unsigned int > > | m_HEX_edges |
Vertex indices for a HEX* element edges (not used!) More... | |
std::vector< std::vector< unsigned int > > * | m_elem_C_tetrahedrons |
Pointer for the appropriate tetrahedron vertex index list (useless!) More... | |
std::vector< std::vector< unsigned int > > * | m_elem_C_triangles |
Pointer for the appropriate triangle vertex index list (useless!) More... | |
Class with a series of methods to find the intersections between libMesh's elements, using CGAL internally.
Definition at line 25 of file intersection_tools.h.
|
inline |
Constructor with a pre-defined coupling element. It preallocates most objects and build the decomposition mappings.
Definition at line 114 of file intersection_tools.h.
|
inline |
Constructor preallocating most objects and building the decomposition mappings.
Definition at line 135 of file intersection_tools.h.
void carl::Intersection_Tools::convert_elem_to_exact_points | ( | const libMesh::Elem * | elem_input, |
std::vector< ExactPoint_3 > & | points_output | ||
) |
Convert an libMesh element to a list of CGAL exact points.
Definition at line 636 of file intersection_tools.cpp.
void carl::Intersection_Tools::convert_exact_points_to_Nef | ( | std::vector< ExactPoint_3 >::const_iterator | it_begin, |
std::vector< ExactPoint_3 >::const_iterator | it_end, | ||
Nef_Polyhedron & | nef_out | ||
) |
Convert an CGAL exact point set to a CGAL Nef polyhedron.
Definition at line 649 of file intersection_tools.cpp.
|
protected |
Determinate if two elements intersect, using their points and decompositions.
CGAL's "do_intersect" methods are not compatible with generic polyhedrons - at most, we can determinate if a triangle intersects a tetrahedron. To determinate if two elements A and B intersect, we must then decompose them into these geometrical objects, and test the intersections pairwise. This method takes the elements' points and decompositions into tetrahedrons and triangles and test each tetrahedron / triangle pair for intersections.
Definition at line 84 of file intersection_tools.cpp.
bool carl::Intersection_Tools::FindAllIntersection | ( | const libMesh::Elem * | Query_elem, |
std::unique_ptr< libMesh::PointLocatorBase > & | point_locator, | ||
std::set< unsigned int > & | Intersecting_elems | ||
) |
Find all elements from the mesh intersecting Query_elem, using the mesh's libMesh::PointLocatorBase.
Definition at line 200 of file intersection_tools.cpp.
const libMesh::Elem * carl::Intersection_Tools::FindFirstIntersection | ( | const libMesh::Elem * | Query_elem, |
std::unique_ptr< libMesh::PointLocatorBase > & | point_locator, | ||
bool | bGuaranteeQueryIsInMesh = false |
||
) |
Find an element from a mesh intersecting Query_elem, using the mesh's libMesh::PointLocatorBase.
By default, a test is done to be sure that the query element does indeed intersect the tested mesh. The test can be bypassed using the flag bGuaranteeQueryIsInMesh.
Definition at line 163 of file intersection_tools.cpp.
bool carl::Intersection_Tools::libMesh_exact_do_intersect | ( | const libMesh::Elem * | elem_A, |
const libMesh::Elem * | elem_B | ||
) |
Determinate if two elements intersect.
Serves as a frontend for the private Intersection_Tools::elements_do_intersect method.
Definition at line 232 of file intersection_tools.cpp.
bool carl::Intersection_Tools::libMesh_exact_do_intersect_inside_coupling | ( | const libMesh::Elem * | elem_A, |
const libMesh::Elem * | elem_B, | ||
bool | bCreateNewNefForA = true |
||
) |
Determinate if two elements intersect inside the coupling region.
This method uses CGAL's Nef polyhedrons. The boolean flag "bCreateNewNefForA" is used to avoid re-building the elem_A's Nef polyhedron.
Definition at line 397 of file intersection_tools.cpp.
bool carl::Intersection_Tools::libMesh_exact_intersection | ( | const libMesh::Elem * | elem_A, |
const libMesh::Elem * | elem_B, | ||
std::set< Point_3 > & | points_out, | ||
bool | bCreateNewNefForA = true , |
||
bool | bConvertPoints = true , |
||
bool | bTestNeeded = true |
||
) |
Build the intersection between two elements.
Definition at line 312 of file intersection_tools.cpp.
bool carl::Intersection_Tools::libMesh_exact_intersection_inside_coupling | ( | const libMesh::Elem * | elem_A, |
const libMesh::Elem * | elem_B, | ||
std::set< libMesh::Point > & | points_out, | ||
bool | bCreateNewNefForA = true , |
||
bool | bConvertPoints = true , |
||
bool | bTestNeeded = false |
||
) |
Build the intersection between two elements intersect inside the coupling region.
This method uses CGAL's Nef polyhedrons. The boolean flag "bCreateNewNefForA" is used to avoid re-building the elem_A's Nef polyhedron. If the boolean flag "bConvertPoints" is set to true, the elements points are converted to CGAL's exact points. When the boolean flag "bTestNeeded" is set to true, a preliminary intersection test is done.
Definition at line 452 of file intersection_tools.cpp.
void carl::Intersection_Tools::libmesh_set_coupling_nef_polyhedron | ( | const libMesh::Elem * | elem_C | ) |
Set the Nef polyhedron for the coupling mesh element.
Definition at line 604 of file intersection_tools.cpp.
|
protected |
Build the tetrahedron and triangle decomposition mappings.
CGAL's "do_intersect" methods are not compatible with generic polyhedrons - at most, we can determinate if a triangle intersects a tetrahedron. To determinate if two elements A and B intersect, we must then decompose them into these geometrical objects, and test the intersections pairwise. The Intersection_Tools::set_element_indexes method fills the vectors "m_XYZ_tetrahedrons" and "m_XYZ_triangles" with a mapping between an TET or HEX element and these decompositions.
Definition at line 13 of file intersection_tools.cpp.
|
protected |
Convert exact CGAL constructs to inexact constructs.
Definition at line 51 of file intersection_tools.h.
|
protected |
Convert inexact CGAL constructs to exact constructs.
Definition at line 50 of file intersection_tools.h.
|
protected |
CGAL ExactKernel's convex hull traits.
Definition at line 47 of file intersection_tools.h.
|
protected |
Intersection polyhedron.
Definition at line 45 of file intersection_tools.h.
|
protected |
Pointer for the appropriate tetrahedron vertex index list (useless!)
Definition at line 77 of file intersection_tools.h.
|
protected |
Pointer for the appropriate triangle vertex index list (useless!)
Definition at line 78 of file intersection_tools.h.
|
protected |
CGAL Exact point vectors.
Definition at line 41 of file intersection_tools.h.
|
protected |
Definition at line 42 of file intersection_tools.h.
|
protected |
Definition at line 43 of file intersection_tools.h.
|
protected |
Vertex indices for a HEX* element edges (not used!)
Definition at line 75 of file intersection_tools.h.
|
protected |
Vertex indices for a HEX* element tetrahedron decomposition.
Definition at line 73 of file intersection_tools.h.
|
protected |
Vertex indices for a HEX* element surface triangles decomposition.
Definition at line 74 of file intersection_tools.h.
|
protected |
Minimal volume cutoff for the intersections.
Definition at line 57 of file intersection_tools.h.
|
protected |
Nef polyhedrons for the elements.
Definition at line 30 of file intersection_tools.h.
|
protected |
Definition at line 31 of file intersection_tools.h.
|
protected |
Definition at line 33 of file intersection_tools.h.
|
protected |
Definition at line 32 of file intersection_tools.h.
|
protected |
Nef polyhedron used to save the intersection between m_nef_A and m_nef_C, reducing the number of intersection operations.
Definition at line 38 of file intersection_tools.h.
|
protected |
libMesh::PerfLog object.
Definition at line 61 of file intersection_tools.h.
|
protected |
Definition at line 54 of file intersection_tools.h.
|
protected |
Definition at line 55 of file intersection_tools.h.
|
protected |
Vertex indices for a TET* element edges (not used!)
Definition at line 71 of file intersection_tools.h.
|
protected |
Vertex indices for a TET* element tetrahedron.
Definition at line 69 of file intersection_tools.h.
|
protected |
Vertex indices for a TET* element surface triangles.
Definition at line 70 of file intersection_tools.h.
|
protected |
Do performance log? Default: false.
Definition at line 60 of file intersection_tools.h.