RepastHPC
2.3.1
|
An AbstractValueLayerND is the abstract parent class for N-dimensional value layers. More...
#include <ValueLayerND.h>
Public Member Functions | |
virtual bool | isInLocalBounds (vector< int > coords) |
Returns true only if the coordinates given are within the local boundaries. More... | |
virtual bool | isInLocalBounds (Point< int > location) |
const GridDimensions & | getLocalBoundaries () |
Gets the local boundaries for this process's part of the value layer. More... | |
Static Public Attributes | |
static int | instanceCount = 0 |
Protected Member Functions | |
AbstractValueLayerND (vector< int > processesPerDim, GridDimensions globalBoundaries, int bufferSize, bool periodic) | |
Constructor. More... | |
vector< int > | getIndexes (vector< int > location, bool isSimplified=false) |
Gets a vector of the indexed locations. More... | |
int | getIndex (vector< int > location, bool isSimplified=false) |
Given a location in global simulation coordinates, get the offset from the global base pointer to the position in the global array representing that location. More... | |
int | getIndex (Point< int > location) |
Given a location in global simulation coordinates, get the offset from the global base pointer to the position in the global array representing that location. More... | |
virtual void | initialize (T initialValue, bool fillBufferZone=false, bool fillLocal=true)=0 |
Initializes the array to the specified value. More... | |
virtual void | initialize (T initialLocalValue, T initialBufferZoneValue)=0 |
Initializes the array to the specified values. More... | |
virtual T | addValueAt (T val, Point< int > location, bool &errFlag)=0 |
Adds to the value in the grid at a specific location Returns the new value. More... | |
virtual T | addValueAt (T val, vector< int > location, bool &errFlag)=0 |
Adds to the value in the grid at the specific location Returns the new value. More... | |
virtual T | setValueAt (T val, Point< int > location, bool &errFlag)=0 |
Sets the value in the grid at a specific location Returns the new value. More... | |
virtual T | setValueAt (T val, vector< int > location, bool &errFlag)=0 |
Sets the value in the grid at the specific location Returns the new value. More... | |
virtual T | getValueAt (Point< int > location, bool &errFlag)=0 |
Gets the value in the grid at a specific location. More... | |
virtual T | getValueAt (vector< int > location, bool &errFlag)=0 |
Gets the value in the grid at a specific location. More... | |
virtual void | synchronize ()=0 |
Synchronizes across processes. More... | |
Protected Attributes | |
CartesianTopology * | cartTopology |
GridDimensions | localBoundaries |
int | length |
int | numDims |
bool | globalSpaceIsPeriodic |
vector< int > | places |
vector< int > | strides |
vector< DimensionDatum< T > > | dimensionData |
RankDatum * | neighborData |
int | neighborCount |
MPI_Request * | requests |
int | instanceID |
int | syncCount |
An AbstractValueLayerND is the abstract parent class for N-dimensional value layers.
|
protected |
Constructor.
processesPerDim | number of processes in each dimension |
globalBoundaries | global boundaries for the simulation |
bufferSize | size of the buffer zone |
periodic | true if the space is periodic, false otherwise |
|
protectedpure virtual |
Adds to the value in the grid at a specific location Returns the new value.
If the location is not within the local boundaries, sets the error flag to 'true', otherwise it will be set to 'false'
val | Value to be placed |
location | location where value is to be placed @errFlag a flag that will be set to 'false' if an error occurs |
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.
|
protectedpure virtual |
Adds to the value in the grid at the specific location Returns the new value.
If the location is not within the local boundaries, sets the error flag to 'true', otherwise it will be set to 'false'
val | Value to be added |
location | location where value is to be placed @errFlag a flag that will be set to 'false' if an error occurs |
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.
|
protected |
Given a location in global simulation coordinates, get the offset from the global base pointer to the position in the global array representing that location.
The location may be simplified (transformed); if it is not, it is first simplified before the index is calculated.
location | the location to be transformed |
|
protected |
Given a location in global simulation coordinates, get the offset from the global base pointer to the position in the global array representing that location.
The location may be simplified (transformed); if it is not, it is first simplified before the index is calculated.
location | the location to be transformed |
isSimplified | true if the coordinates are already in simplified form |
|
protected |
Gets a vector of the indexed locations.
If the value passed is already simplified (transformed), does not transform.
location | the location to be transformed |
isSimplified | true if the coordinates are already in simplified form |
|
inline |
Gets the local boundaries for this process's part of the value layer.
|
protectedpure virtual |
Gets the value in the grid at a specific location.
If the location is not within the boundaries, sets the error flag to 'true', otherwise it will be set to 'false'
location | location where value is to be placed @errFlag a flag that will be set to 'false' if an error occurs |
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.
|
protectedpure virtual |
Gets the value in the grid at a specific location.
If the location is not within the boundaries, sets the error flag to 'true', otherwise it will be set to 'false'
location | location where value is to be placed @errFlag a flag that will be set to 'false' if an error occurs |
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.
|
protectedpure virtual |
Initializes the array to the specified values.
initialize(val1, val2); // Initializes the local space to val1 and the buffer zones to val2
initialLocalValue | value to be placed in local cells |
initialBufferZoneValue | value to be placed in non-local cells |
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.
|
protectedpure virtual |
Initializes the array to the specified value.
Usage:
initialize(val); // Initializes only the local space initialize(val, true); // Initializes the entire space initialize(val, false); // Initializes only the local space (default) initialize(val, true, false); // Initializes only the buffer zone initialize(val, false, true); // Initializes only the local space (default) initialize(val, true, true); // Initializes the entire space initialize(val, false, false); // Does nothing
initialValue | Value to be placed in the array |
fillBufferZone | true if the value should be placed in all local cells |
fillLocal | true if the value should be placed in all non-local cells |
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.
|
virtual |
Returns true only if the coordinates given are within the local boundaries.
coords | Coordinates to be tested |
|
protectedpure virtual |
Sets the value in the grid at a specific location Returns the new value.
If the location is not within the local boundaries, sets the error flag to 'true', otherwise it will be set to 'false'
val | Value to be added |
location | location where value is to be placed @errFlag a flag that will be set to 'false' if an error occurs |
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.
|
protectedpure virtual |
Sets the value in the grid at the specific location Returns the new value.
If the location is not within the local boundaries, sets the error flag to 'true', otherwise it will be set to 'false'
val | Value to be added |
location | location where value is to be placed @errFlag a flag that will be set to 'false' if an error occurs |
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.
|
protectedpure virtual |
Synchronizes across processes.
This copies the values in the interior 'buffer zones' from self and sends to adjacent processes, while receiving data from adjacent processes and placing it in the appropriate exterior buffer zones.
Implemented in repast::ValueLayerNDSU< T >, and repast::ValueLayerND< T >.