IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SAMRAI::hier::ProcessorMapping Class Reference

#include <ProcessorMapping.h>

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< intgetProcessorMapping () 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
 

Private Member Functions

void computeLocalIndices () const
 
void operator= (const ProcessorMapping &)
 

Private Attributes

int d_my_rank
 
int d_nodes
 
tbox::Array< intd_mapping
 
int d_local_index_count
 
tbox::Array< intd_local_indices
 

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

◆ ProcessorMapping() [1/4]

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().

◆ ProcessorMapping() [2/4]

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.

◆ ProcessorMapping() [3/4]

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

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

◆ ProcessorMapping() [4/4]

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.

◆ ~ProcessorMapping()

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

The destructor simply releases the storage for the mapping.

Member Function Documentation

◆ setMappingSize()

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().

◆ setNumberNodes()

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

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.

◆ getProcessorAssignment()

int SAMRAI::hier::ProcessorMapping::getProcessorAssignment ( const int  i) const

Return the processor assignment for the specified patch index.

◆ setProcessorAssignment()

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

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

◆ getProcessorMapping()

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

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

◆ setProcessorMapping()

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.

◆ getNumberOfLocalIndices()

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

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

◆ getLocalIndices()

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).

◆ getSizeOfMappingArray()

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

Return the total number of indices in the mapping array.

◆ isMappingLocal()

bool SAMRAI::hier::ProcessorMapping::isMappingLocal ( const int  i) const

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

◆ computeLocalIndices()

void SAMRAI::hier::ProcessorMapping::computeLocalIndices ( ) const
private

Fills in the array d_local_indices, and sets d_local_index_count.

◆ operator=()

void SAMRAI::hier::ProcessorMapping::operator= ( const ProcessorMapping )
private

Member Data Documentation

◆ d_my_rank

int SAMRAI::hier::ProcessorMapping::d_my_rank
private

◆ d_nodes

int SAMRAI::hier::ProcessorMapping::d_nodes
private

◆ d_mapping

tbox::Array<int> SAMRAI::hier::ProcessorMapping::d_mapping
private

◆ d_local_index_count

int SAMRAI::hier::ProcessorMapping::d_local_index_count
mutableprivate

◆ d_local_indices

tbox::Array<int> SAMRAI::hier::ProcessorMapping::d_local_indices
mutableprivate

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