IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SAMRAI::mesh::SpatialKey Class Reference

#include <SpatialKey.h>

Public Member Functions

 SpatialKey ()
 
 SpatialKey (const unsigned int i, const unsigned int j=0, const unsigned int k=0, const unsigned int level_num=0)
 
 SpatialKey (const SpatialKey &spatial_key)
 
 ~SpatialKey ()
 
SpatialKeyoperator= (const SpatialKey &spatial_key)
 
bool operator== (const SpatialKey &spatial_key) const
 
bool operator!= (const SpatialKey &spatial_key) const
 
bool operator< (const SpatialKey &spatial_key) const
 
bool operator<= (const SpatialKey &spatial_key) const
 
bool operator> (const SpatialKey &spatial_key) const
 
bool operator>= (const SpatialKey &spatial_key) const
 
void setToZero ()
 
void setKey (const unsigned int i=0, const unsigned int j=0, const unsigned int k=0, const unsigned int level_num=0)
 

Private Member Functions

void blendOneCoord (const unsigned int coord, const int coord_offset)
 

Private Attributes

int d_bits_per_int
 
unsigned int d_key [NUM_COORDS_MIXED_FOR_SPATIAL_KEY]
 

Friends

std::ostream & operator<< (std::ostream &s, const SpatialKey &spatial_key)
 

Detailed Description

Class SpatialKey provides a mapping from coordinates in an abstract index space to a key that can be used to order the the points with a Morton-type space filling curve (See Gutman, Dr Dobb's Journal, July 1999, pg 115-21 for an introduction).
This curve orders a set of points in space so that points near each other in space are likely, but not guaranteed, to be near each other in the ordering.

Constructor & Destructor Documentation

◆ SpatialKey() [1/3]

SAMRAI::mesh::SpatialKey::SpatialKey ( )

The default constructor creates a spatial key with zero value.

◆ SpatialKey() [2/3]

SAMRAI::mesh::SpatialKey::SpatialKey ( const unsigned int  i,
const unsigned int  j = 0,
const unsigned int  k = 0,
const unsigned int  level_num = 0 
)

Create a spatial key from given index space coordinates and level number.

◆ SpatialKey() [3/3]

SAMRAI::mesh::SpatialKey::SpatialKey ( const SpatialKey spatial_key)

Copy constructor for spatial key.

◆ ~SpatialKey()

SAMRAI::mesh::SpatialKey::~SpatialKey ( )

The destructor for a spatial key does nothing interesting.

Member Function Documentation

◆ operator=()

SpatialKey& SAMRAI::mesh::SpatialKey::operator= ( const SpatialKey spatial_key)

Assignment operator for spatial key.

◆ operator==()

bool SAMRAI::mesh::SpatialKey::operator== ( const SpatialKey spatial_key) const

Return true if argument key is equal to this key. Otherwise, return false.

◆ operator!=()

bool SAMRAI::mesh::SpatialKey::operator!= ( const SpatialKey spatial_key) const

Return true if argument key is not equal to this key. Otherwise, return false.

◆ operator<()

bool SAMRAI::mesh::SpatialKey::operator< ( const SpatialKey spatial_key) const

Return true if this key is less than argument key. Otherwise, return false.

◆ operator<=()

bool SAMRAI::mesh::SpatialKey::operator<= ( const SpatialKey spatial_key) const

Return true if this key is less than or equal to argument key. Otherwise, return false.

◆ operator>()

bool SAMRAI::mesh::SpatialKey::operator> ( const SpatialKey spatial_key) const

Return true if this key is greater than argument key. Otherwise, return false.

◆ operator>=()

bool SAMRAI::mesh::SpatialKey::operator>= ( const SpatialKey spatial_key) const

Return true if this key is greater than or equal to argument key. Otherwise, return false.

◆ setToZero()

void SAMRAI::mesh::SpatialKey::setToZero ( )

Set this key to zero key.

◆ setKey()

void SAMRAI::mesh::SpatialKey::setKey ( const unsigned int  i = 0,
const unsigned int  j = 0,
const unsigned int  k = 0,
const unsigned int  level_num = 0 
)

Set this key from the index space coordinates and the level number.

The values of i, j, and k default to 0 to handle cases where the number of dimensions in the problem is not 3. The default value of level_num is also 0.

◆ blendOneCoord()

void SAMRAI::mesh::SpatialKey::blendOneCoord ( const unsigned int  coord,
const int  coord_offset 
)
private

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const SpatialKey spatial_key 
)
friend

Write a spatial key to an output stream. The spatial key is output in hex to avoid the binary to decimal conversion of the key.

Note that the proper functioning of this method depends on having 32 bits per integer (more specifically, 8 hex characters per integer).

Member Data Documentation

◆ d_bits_per_int

int SAMRAI::mesh::SpatialKey::d_bits_per_int
private

◆ d_key

unsigned int SAMRAI::mesh::SpatialKey::d_key[NUM_COORDS_MIXED_FOR_SPATIAL_KEY]
private

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