CArl
Code Arlequin / C++ implementation
|
Class containing the structure needed to find all the intersections between two meshes, inside the coupling region mesh. More...
#include <intersection_search.h>
Public Member Functions | |
Intersection_Search (libMesh::Mesh &mesh_A, libMesh::Mesh &mesh_B, libMesh::Mesh &mesh_Coupling, libMesh::Mesh &mesh_I, const std::string &output_base=std::string("test"), IntersectionMeshingMethod MeshingMethod=IntersectionMeshingMethod::CGAL, double Min_Inter_Volume=1E-15, bool bDoPerf_log=true, bool bDebugOutput=false) | |
Constructor. More... | |
libMesh::Mesh & | mesh_A () |
Reference to the mesh A. More... | |
libMesh::Mesh & | mesh_B () |
Reference to the mesh B. More... | |
libMesh::Mesh & | mesh_Coupling () |
Reference to the coupling mesh. More... | |
void | PreparePreallocationAndLoad (SearchMethod search_type=BRUTE) |
Do a preliminary search, to optimize the intersection search and construction. More... | |
void | PreallocateAndPartitionCoupling () |
Preallocate Intersection_Search::m_Intersection_Pairs_multimap and repartition the coupling mesh. More... | |
void | BuildIntersections (SearchMethod search_type=BRUTE) |
Find and build all the intersections. More... | |
void | SetScalingFiles (const std::string &timing_data_file_base) |
Set up timing output file. More... | |
void | SkipIntersectionConstruction (bool bSkipIntersectionConstruction) |
Set the "Skip intersection construction" flag. More... | |
void | SkipIntersectionPartitioning (bool bSkipIntersectionPartitioning) |
Set the "Skip the coupling mesh repartition" flag. More... | |
void | CalculateGlobalVolume () |
Calculate the total intersection volume over all the processors. More... | |
Protected Member Functions | |
void | BuildCoupledPatches (const libMesh::Elem *Query_elem, int patch_counter=0) |
Build both patches associated a given query element from the coupling region mesh. More... | |
void | FindPatchIntersections_Brute (const libMesh::Elem *Query_elem) |
Find all the intersections between the patches associated to the Query_elem, using a brute force method. All elements from a patch are tested against all the elements from the other patch. More... | |
void | FindPatchIntersections_Front (const libMesh::Elem *Query_elem) |
Find all the intersections between the patches associated to the Query_elem, using an advancing front method. More... | |
void | FindFirstPair (Patch_construction *Patch_guide, Patch_construction *Patch_probed, std::pair< unsigned int, unsigned int > &First_intersection) |
Find the first intersecting pair from a patch. More... | |
void | BruteForce_FindFirstPair (Patch_construction *Patch_guide, Patch_construction *Patch_probed, std::pair< unsigned int, unsigned int > &First_intersection) |
Find the first intersecting pair from a patch, doing a full scan of the patches. More... | |
void | FindAndBuildIntersections_Brute () |
Find and build all the intersections, using the brute force method. More... | |
void | FindIntersections_Brute () |
Find all the intersections, using the brute force method. More... | |
void | FindAndBuildIntersections_Front () |
Find and build all the intersections, using the advancing front method. More... | |
void | FindIntersections_Front () |
Find all the intersections, using the advancing front method. More... | |
void | CalculateIntersectionVolume (const libMesh::Elem *Query_elem) |
Calculate the volume of the intersections associated to Query_elem without updating the intersection mesh. Currently unused More... | |
void | UpdateCouplingIntersection (const libMesh::Elem *Query_elem) |
Build the intersections associated to the Query_elem and update the intersection mesh. More... | |
Protected Attributes | |
libMesh::Mesh & | m_Mesh_A |
libMesh::Mesh & | m_Mesh_B |
libMesh::Mesh & | m_Mesh_Coupling |
Mesh representing the coupling region. More... | |
const libMesh::Parallel::Communicator & | m_comm |
Global communicator. More... | |
const unsigned int | m_nodes |
Number of MPI processors. More... | |
const unsigned int | m_rank |
This processor's rank (or ID in the communicator) More... | |
const libMesh::Parallel::Communicator & | m_local_comm |
Local communicator, used for mesh patches. More... | |
Patch_construction | m_Patch_Constructor_A |
Patch_construction object for mesh A. More... | |
Patch_construction | m_Patch_Constructor_B |
Patch_construction object for mesh B. More... | |
IntersectionMeshingMethod | m_MeshingMethod |
Flag defining the intersection meshing algorithm. More... | |
Mesh_Intersection | m_Mesh_Intersection |
Object containing the intersection mesh. More... | |
std::unordered_multimap< unsigned int, unsigned int > | m_Intersection_Pairs_multimap |
Multimap containing the intersection pairs. More... | |
Intersection_Tools | m_Intersection_test |
Intersection operations for the main intersection tests. More... | |
Intersection_Tools | m_Intersection_test_neighbors |
Intersection operations for the neighbor intersection tests. (why do we need both?) More... | |
std::vector< unsigned int > | m_Nb_Of_Intersections_Elem_C |
Vector containing the number of intersections found inside each of the coupling mesh elements. More... | |
libMesh::ErrorVector | m_coupling_weights |
libMesh::ErrorVector used to repartition the coupling mesh. More... | |
bool | m_bSaveInterData |
Boolean flag determining if we should save the intersection data or not. Default: true. More... | |
bool | m_bDidPreliminarySearch |
Boolean flag determining if we did a preliminary intersection search, used for the coupling mesh repartition and memory preallocations. More... | |
bool | m_bHavePreallocData |
Boolean flag determining if we have the data for a proper preallocation of m_Intersection_Pairs_multimap. More... | |
bool | m_bIntersectionsBuilt |
Boolean flag indicating if the intersections were built. (A bit useless right now ...) More... | |
double | m_Min_Inter_Volume |
Volume cutoff for the intersection polyhedrons. Default: 1E-15. More... | |
bool | m_bSkipIntersectionConstruction |
Boolean indicating if we should skip the intersection construction. Default: false. More... | |
bool | m_bSkipIntersectionPartitioning |
Boolean indicating if we should skip the intersection repartitioning. Default: false. More... | |
std::string | m_Output_filename_base |
Output filenames base. More... | |
bool | MASTER_bPerfLog_intersection_search |
Do performance log? Default: true. More... | |
libMesh::PerfLog | m_perf_log |
libMesh::PerfLog object. More... | |
bool | m_bPrintDebug |
Print debug data. Default: false. More... | |
bool | m_bPrintTimingData |
Print timing data. Default: false. More... | |
bool | m_bPrintIntersectionsPerPartData |
Print intersections per partition. Default: false. More... | |
std::string | m_timing_data_file_base |
Output filenames base for the timing data. More... | |
Class containing the structure needed to find all the intersections between two meshes, inside the coupling region mesh.
Definition at line 28 of file intersection_search.h.
|
inline |
Constructor.
Definition at line 179 of file intersection_search.h.
|
protected |
Find the first intersecting pair from a patch, doing a full scan of the patches.
This is, essentially, a brute force algorithm set to stop after the first positive test).
Definition at line 197 of file intersection_search.cpp.
|
protected |
Build both patches associated a given query element from the coupling region mesh.
Calls the method Patch_construction::BuildPatch for both patches, and export the patch meshes if Intersection_Search::m_bPrintDebug == true.
Definition at line 30 of file intersection_search.cpp.
void carl::Intersection_Search::BuildIntersections | ( | SearchMethod | search_type = BRUTE | ) |
Find and build all the intersections.
Definition at line 750 of file intersection_search.cpp.
void carl::Intersection_Search::CalculateGlobalVolume | ( | ) |
Calculate the total intersection volume over all the processors.
Definition at line 784 of file intersection_search.cpp.
|
protected |
Calculate the volume of the intersections associated to Query_elem without updating the intersection mesh. Currently unused
Definition at line 817 of file intersection_search.cpp.
|
protected |
Find and build all the intersections, using the brute force method.
Skips build step if Intersection_Search::m_bSkipIntersectionConstruction == true.
Definition at line 438 of file intersection_search.cpp.
|
protected |
Find and build all the intersections, using the advancing front method.
Skips build step if Intersection_Search::m_bSkipIntersectionConstruction == true.
Definition at line 545 of file intersection_search.cpp.
|
protected |
Find the first intersecting pair from a patch.
Do so by :
Definition at line 126 of file intersection_search.cpp.
|
protected |
Find all the intersections, using the brute force method.
Skips saving intersecting element pairs if Intersection_Search::m_bSaveInterData == true.
Definition at line 517 of file intersection_search.cpp.
|
protected |
Find all the intersections, using the advancing front method.
Skips saving intersecting element pairs if Intersection_Search::m_bSaveInterData == true.
Definition at line 623 of file intersection_search.cpp.
|
protected |
Find all the intersections between the patches associated to the Query_elem, using a brute force method. All elements from a patch are tested against all the elements from the other patch.
Definition at line 52 of file intersection_search.cpp.
|
protected |
Find all the intersections between the patches associated to the Query_elem, using an advancing front method.
Definition at line 241 of file intersection_search.cpp.
libMesh::Mesh & carl::Intersection_Search::mesh_A | ( | ) |
libMesh::Mesh & carl::Intersection_Search::mesh_B | ( | ) |
libMesh::Mesh & carl::Intersection_Search::mesh_Coupling | ( | ) |
Reference to the coupling mesh.
Definition at line 22 of file intersection_search.cpp.
void carl::Intersection_Search::PreallocateAndPartitionCoupling | ( | ) |
Preallocate Intersection_Search::m_Intersection_Pairs_multimap and repartition the coupling mesh.
Definition at line 673 of file intersection_search.cpp.
void carl::Intersection_Search::PreparePreallocationAndLoad | ( | SearchMethod | search_type = BRUTE | ) |
Do a preliminary search, to optimize the intersection search and construction.
This method finds all the intersecting element pairs, only saving their number for each element of the coupling mesh. This information is used to repartition the coupling mesh and to preallocate the Intersection_Search::m_Intersection_Pairs_multimap.
Definition at line 652 of file intersection_search.cpp.
void carl::Intersection_Search::SetScalingFiles | ( | const std::string & | timing_data_file_base | ) |
Set up timing output file.
Definition at line 938 of file intersection_search.cpp.
|
inline |
Set the "Skip intersection construction" flag.
Definition at line 245 of file intersection_search.h.
|
inline |
Set the "Skip the coupling mesh repartition" flag.
Definition at line 251 of file intersection_search.h.
|
protected |
Build the intersections associated to the Query_elem and update the intersection mesh.
Definition at line 878 of file intersection_search.cpp.
|
protected |
Boolean flag determining if we did a preliminary intersection search, used for the coupling mesh repartition and memory preallocations.
Definition at line 79 of file intersection_search.h.
|
protected |
Boolean flag determining if we have the data for a proper preallocation of m_Intersection_Pairs_multimap.
Definition at line 82 of file intersection_search.h.
|
protected |
Boolean flag indicating if the intersections were built. (A bit useless right now ...)
Definition at line 85 of file intersection_search.h.
|
protected |
Print debug data. Default: false.
Definition at line 100 of file intersection_search.h.
|
protected |
Print intersections per partition. Default: false.
Definition at line 102 of file intersection_search.h.
|
protected |
Print timing data. Default: false.
Definition at line 101 of file intersection_search.h.
|
protected |
Boolean flag determining if we should save the intersection data or not. Default: true.
Definition at line 76 of file intersection_search.h.
|
protected |
Boolean indicating if we should skip the intersection construction. Default: false.
Definition at line 91 of file intersection_search.h.
|
protected |
Boolean indicating if we should skip the intersection repartitioning. Default: false.
Definition at line 94 of file intersection_search.h.
|
protected |
Global communicator.
Definition at line 38 of file intersection_search.h.
|
protected |
libMesh::ErrorVector used to repartition the coupling mesh.
Definition at line 73 of file intersection_search.h.
|
protected |
Multimap containing the intersection pairs.
The element indexes of the mesh A are used as the keys of the multimap
Definition at line 61 of file intersection_search.h.
|
protected |
Intersection operations for the main intersection tests.
Definition at line 64 of file intersection_search.h.
|
protected |
Intersection operations for the neighbor intersection tests. (why do we need both?)
Definition at line 67 of file intersection_search.h.
|
protected |
Local communicator, used for mesh patches.
Definition at line 41 of file intersection_search.h.
|
protected |
Definition at line 33 of file intersection_search.h.
|
protected |
Definition at line 34 of file intersection_search.h.
|
protected |
Mesh representing the coupling region.
Definition at line 35 of file intersection_search.h.
|
protected |
Object containing the intersection mesh.
Definition at line 55 of file intersection_search.h.
|
protected |
Flag defining the intersection meshing algorithm.
Can be either carl::LIBMESH_TETGEN (use LibMesh's tetgen module, problematic with Intel compilers) or carl::CGAL (use CGAL's Triangulation_3). Default: carl::CGAL.
Definition at line 52 of file intersection_search.h.
|
protected |
Volume cutoff for the intersection polyhedrons. Default: 1E-15.
Definition at line 88 of file intersection_search.h.
|
protected |
Vector containing the number of intersections found inside each of the coupling mesh elements.
Definition at line 70 of file intersection_search.h.
|
protected |
Number of MPI processors.
Definition at line 39 of file intersection_search.h.
|
protected |
Output filenames base.
Definition at line 96 of file intersection_search.h.
|
protected |
Patch_construction object for mesh A.
Definition at line 44 of file intersection_search.h.
|
protected |
Patch_construction object for mesh B.
Definition at line 45 of file intersection_search.h.
|
protected |
libMesh::PerfLog object.
Definition at line 99 of file intersection_search.h.
|
protected |
This processor's rank (or ID in the communicator)
Definition at line 40 of file intersection_search.h.
|
protected |
Output filenames base for the timing data.
Definition at line 103 of file intersection_search.h.
|
protected |
Do performance log? Default: true.
Definition at line 98 of file intersection_search.h.