DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <DistanceMapCalculator.hpp>

Collaboration diagram for DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DistanceMapCalculator (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
 ~DistanceMapCalculator ()
void ComputeDistanceMap (const std::vector< unsigned > &rSourceNodeIndices, std::vector< double > &rNodeDistances)

Private Member Functions

void WorkOnLocalQueue (std::vector< c_vector< double, SPACE_DIM > > &rWitnessPoints, std::vector< double > &rNodeDistances)
bool UpdateQueueFromRemote (std::vector< c_vector< double, SPACE_DIM > > &rWitnessPoints, std::vector< double > &rNodeDistances)
void PushLocal (unsigned nodeIndex)

Private Attributes

AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > & 
mrMesh
unsigned mNumNodes
unsigned mLo
unsigned mHi
bool mWorkOnEntireMesh
unsignedmNumHalosPerProcess
std::vector< unsignedmHaloNodeIndices
unsigned mRoundCounter
std::queue< unsignedmActiveNodeIndexQueue

Friends

class TestDistanceMapCalculator

Detailed Description

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

This class provides functionalities to compute a distance map in a given mesh from a given surface, specifying the distance from each node to the surface.

The mesh is specified in the constructor, and the ComputeDistanceMap computes (and returns by reference) the map.

Definition at line 45 of file DistanceMapCalculator.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::DistanceMapCalculator ( AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::~DistanceMapCalculator (  )  [inline]

Destructor - cleans up mNumHalosPerProcess (which is normally set to NULL anyway).

Definition at line 119 of file DistanceMapCalculator.hpp.

References DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mNumHalosPerProcess.


Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap ( const std::vector< unsigned > &  rSourceNodeIndices,
std::vector< double > &  rNodeDistances 
) [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::PushLocal ( unsigned  nodeIndex  )  [inline, private]

Push a node index onto the queue. In the parallel case this will only push a locally-owned (not halo) node. Halo nodes will be updated, but never pushed to the local queue

Parameters:
nodeIndex A global node index.

Definition at line 99 of file DistanceMapCalculator.hpp.

References DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mActiveNodeIndexQueue, DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mHi, and DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mLo.

Referenced by DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::UpdateQueueFromRemote(), and DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::WorkOnLocalQueue().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::UpdateQueueFromRemote ( std::vector< c_vector< double, SPACE_DIM > > &  rWitnessPoints,
std::vector< double > &  rNodeDistances 
) [inline, private]

Update the local Queue of node indices using data that are from the halo nodes of remote processes.

Parameters:
rWitnessPoints The witness points in the source which supply the current minimum distance of each node
rNodeDistances distance map computed
Returns:
true when this update was active => there are non-empty queues left to work on
false without working or side-effects if we don't have a true distributed mesh

Definition at line 118 of file DistanceMapCalculator.cpp.

References PetscTools::GetMyRank(), PetscTools::GetNumProcs(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mActiveNodeIndexQueue, DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mHaloNodeIndices, DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mNumHalosPerProcess, DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mWorkOnEntireMesh, DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::PushLocal(), and PetscTools::ReplicateBool().

Referenced by DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::WorkOnLocalQueue ( std::vector< c_vector< double, SPACE_DIM > > &  rWitnessPoints,
std::vector< double > &  rNodeDistances 
) [inline, private]

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::queue<unsigned> DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mActiveNodeIndexQueue [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mHaloNodeIndices [private]

(Only used when mWorkOnEntrireMesh == false). This is a local cache of halo node indices.

Definition at line 63 of file DistanceMapCalculator.hpp.

Referenced by DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::DistanceMapCalculator(), and DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::UpdateQueueFromRemote().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mHi [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mLo [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned* DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mNumHalosPerProcess [private]

(Only used when mWorkOnEntrireMesh == false). This forms an array of with the number of halo nodes known by each process.

Definition at line 61 of file DistanceMapCalculator.hpp.

Referenced by DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::DistanceMapCalculator(), DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::UpdateQueueFromRemote(), and DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::~DistanceMapCalculator().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mNumNodes [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractTetrahedralMesh<ELEMENT_DIM, SPACE_DIM>& DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mrMesh [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mRoundCounter [private]

Used to check parallel implementation

Definition at line 65 of file DistanceMapCalculator.hpp.

Referenced by DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::ComputeDistanceMap().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool DistanceMapCalculator< ELEMENT_DIM, SPACE_DIM >::mWorkOnEntireMesh [private]

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

Generated by  doxygen 1.6.2