Chaste  Release::3.4
NodePartitioner< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <NodePartitioner.hpp>

+ Collaboration diagram for NodePartitioner< ELEMENT_DIM, SPACE_DIM >:

Static Public Member Functions

static void DumbPartitioning (AbstractMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, std::set< unsigned > &rNodesOwned)
 
static void MetisLibraryPartitioning (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, std::vector< unsigned > &rNodePermutation, std::set< unsigned > &rNodesOwned, std::vector< unsigned > &rProcessorsOffset)
 
static void PetscMatrixPartitioning (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, std::vector< unsigned > &rNodePermutation, std::set< unsigned > &rNodesOwned, std::vector< unsigned > &rProcessorsOffset)
 
static void GeometricPartitioning (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, std::vector< unsigned > &rNodePermutation, std::set< unsigned > &rNodesOwned, std::vector< unsigned > &rProcessorsOffset, ChasteCuboid< SPACE_DIM > *pRegion)
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class NodePartitioner< ELEMENT_DIM, SPACE_DIM >

Static methods to allow node-wise partitioning of meshes.

Definition at line 48 of file NodePartitioner.hpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void NodePartitioner< ELEMENT_DIM, SPACE_DIM >::DumbPartitioning ( AbstractMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh,
std::set< unsigned > &  rNodesOwned 
)
static

Specialised method to compute a parallel partitioning of a given mesh (called by ComputeMeshPartitioning, based on the value of mMetisPartitioning)

Parameters
rMeshis the original mesh (so that we can set the DistributedVectorFactory up
rNodesOwnedis an empty set to be filled with the indices of nodes owned by this process

Definition at line 75 of file NodePartitioner.cpp.

References EXCEPTION, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistributedVectorFactory(), DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLow(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and DistributedVectorFactory::GetProblemSize().

Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void NodePartitioner< ELEMENT_DIM, SPACE_DIM >::GeometricPartitioning ( AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &  rMeshReader,
std::vector< unsigned > &  rNodePermutation,
std::set< unsigned > &  rNodesOwned,
std::vector< unsigned > &  rProcessorsOffset,
ChasteCuboid< SPACE_DIM > *  pRegion 
)
static

Specialised method to compute the partition of a mesh based on geometric partitioning

Parameters
rMeshReaderis the reader pointing to the mesh to be read in and partitioned
rNodePermutationis the vector to be filled with node permutation information.
rNodesOwnedis an empty set to be filled with the indices of nodes owned by this process
rProcessorsOffseta vector of length NumProcs to be filled with the index of the lowest indexed node owned by each process
pRegionthe local region owned by this process.

Definition at line 466 of file NodePartitioner.cpp.

References PetscTools::Barrier(), EXCEPTION, PetscTools::GetMyRank(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), PetscTools::GetNumProcs(), ChasteCuboid< SPACE_DIM >::rGetLowerCorner(), ChasteCuboid< SPACE_DIM >::rGetUpperCorner(), and UNSIGNED_UNSET.

Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void NodePartitioner< ELEMENT_DIM, SPACE_DIM >::MetisLibraryPartitioning ( AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &  rMeshReader,
std::vector< unsigned > &  rNodePermutation,
std::set< unsigned > &  rNodesOwned,
std::vector< unsigned > &  rProcessorsOffset 
)
static

Specialised method to compute a parallel partitioning of a given mesh (called by ComputeMeshPartitioning, based on the value of mMetisPartitioning

Parameters
rMeshReaderis the reader pointing to the mesh to be read in and partitioned
rNodePermutationis the vector to be filled with node permutation information.
rNodesOwnedis an empty set to be filled with the indices of nodes owned by this process
rProcessorsOffseta vector of length NumProcs to be filled with the index of the lowest indexed node owned by each process
Todo:
#2250 Direct calls to METIS are to be deprecated

Definition at line 96 of file NodePartitioner.cpp.

References PetscTools::AmMaster(), EXCEPTION, PetscTools::GetMyRank(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), PetscTools::GetNumProcs(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfElements(), PetscTools::IsParallel(), NEVER_REACHED, ElementData::NodeIndices, Timer::Reset(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().

Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void NodePartitioner< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning ( AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &  rMeshReader,
std::vector< unsigned > &  rNodePermutation,
std::set< unsigned > &  rNodesOwned,
std::vector< unsigned > &  rProcessorsOffset 
)
static

Method to compute a parallel partitioning of a given mesh.

Parameters
rMeshReaderis the reader pointing to the mesh to be read in and partitioned
rNodePermutationis the vector to be filled with node permutation information.
rNodesOwnedis an empty set to be filled with the indices of nodes owned by this process
rProcessorsOffseta vector of length NumProcs to be filled with the index of the lowest indexed node owned by each process
Todo:
#1216 change the number 54 below (row nonzero allocation) to be nonmagic
Todo:
: This assembly is likely to generate many communications. Try to interleave other operations by executing them between Begin() and End().

It seems to be free-ing xadj and adjncy as a side effect

Definition at line 236 of file NodePartitioner.cpp.

References PetscTools::AmMaster(), PetscTools::AmTopMost(), PetscTools::Barrier(), PetscTools::Destroy(), PetscMatTools::Finalise(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetElementData(), PetscTools::GetMyRank(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), PetscTools::GetNumProcs(), PetscTools::HasParMetis(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::IsFileFormatBinary(), PetscTools::IsParallel(), ElementData::NodeIndices, PETSC_DESTROY_PARAM, Timer::PrintAndReset(), Timer::Reset(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset(), and PetscTools::SetupMat().

Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning().


The documentation for this class was generated from the following files: