SAMRAI::hier::ProcessorMapping Class Reference

#include <source/hierarchy/patches/ProcessorMapping.h>

List of all members.

Public Member Functions

 ProcessorMapping ()
 ProcessorMapping (const int n)
 ProcessorMapping (const ProcessorMapping &mapping)
 ProcessorMapping (const tbox::Array< int > &mapping)
 ~ProcessorMapping ()
void setMappingSize (const int n)
void setNumberNodes (const int n)
int getProcessorAssignment (const int i) const
void setProcessorAssignment (const int i, const int p)
tbox::Array< int > getProcessorMapping () const
void setProcessorMapping (const tbox::Array< int > &mapping)
int getNumberOfLocalIndices () const
const tbox::Array< int > & getLocalIndices () const
int getSizeOfMappingArray () const
bool isMappingLocal (const int i) const


Detailed Description

Class ProcessorMapping represents the processor assignments of patches to processors. It makes sure that all processor assignments are in the range from 0 through NODES-1 and answers whether a particular assignment is local to the processor.


Constructor & Destructor Documentation

SAMRAI::hier::ProcessorMapping::ProcessorMapping (  ) 

Create a default processor mapping array with 0 elements. Before the mapping can be used, its size should be set using the function setMappingSize() and each element of the mapping should be set by setProcessorAssignment().

SAMRAI::hier::ProcessorMapping::ProcessorMapping ( const int  n  ) 

Create a processor mapping array with enough space for n elements. All elements of the mapping are initialized to processor zero, but they should be set by setProcessorAssignment() later.

SAMRAI::hier::ProcessorMapping::ProcessorMapping ( const ProcessorMapping mapping  ) 

Create a new processor mapping and copy the processor assignments from the argument.

SAMRAI::hier::ProcessorMapping::ProcessorMapping ( const tbox::Array< int > &  mapping  ) 

Create a new processor mapping and get processor assignments from the the tbox::Array<int> argument.

SAMRAI::hier::ProcessorMapping::~ProcessorMapping (  )  [inline]

The destructor simply releases the storage for the mapping.


Member Function Documentation

void SAMRAI::hier::ProcessorMapping::setMappingSize ( const int  n  ) 

Resize the mapping so that it has n elements. Before it can be used, each element should be set using setProcessorAssignment().

void SAMRAI::hier::ProcessorMapping::setNumberNodes ( const int  n  )  [inline]

Sets the number of nodes to n. IMPORTANT NOTE: This method should only be used for testing purposes. Under normal circumstances, the number of nodes is set by a call to tbox::SAMRAI_MPI::getNodes() and should NOT be changed.

int SAMRAI::hier::ProcessorMapping::getProcessorAssignment ( const int  i  )  const [inline]

Return the processor assignment for the specified patch index.

void SAMRAI::hier::ProcessorMapping::setProcessorAssignment ( const int  i,
const int  p 
) [inline]

Set the processor assignment (second argument) for the specified patch index (first argument).

tbox::Array< int > SAMRAI::hier::ProcessorMapping::getProcessorMapping (  )  const [inline]

Return an tbox::Array<int> of the processor mappings.

void SAMRAI::hier::ProcessorMapping::setProcessorMapping ( const tbox::Array< int > &  mapping  ) 

Sets the processor mappings from an tbox::Array<int>. Remaps the processors so that patches are not accidentally mapped to non-existent nodes.

int SAMRAI::hier::ProcessorMapping::getNumberOfLocalIndices (  )  const

Return the number of local indices (that is, those indices mapped to the local processor).

const tbox::Array< int > & SAMRAI::hier::ProcessorMapping::getLocalIndices (  )  const

Return an array containing the local indices (that is, those indices mapped to the local processor).

int SAMRAI::hier::ProcessorMapping::getSizeOfMappingArray (  )  const [inline]

Return the total number of indices in the mapping array.

bool SAMRAI::hier::ProcessorMapping::isMappingLocal ( const int  i  )  const [inline]

Check whether the specified index is a local index (that is, mapped to the local processor).


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:30 2009 for SAMRAI by  doxygen 1.5.1