$treeview $search $mathjax
Palabos  Version 1.1
$projectbrief
$projectbrief
$searchbox

plb::SparseBlockStructure3D Class Reference

#include <sparseBlockStructure3D.h>

Collaboration diagram for plb::SparseBlockStructure3D:

List of all members.

Public Types

typedef std::map< Dot3D,
std::vector< plint > > 
GridT

Public Member Functions

 SparseBlockStructure3D (plint nx, plint ny, plint nz)
 Sparse grid structure with default internal implementation.
 SparseBlockStructure3D (Box3D boundingBox_)
 Sparse grid structure with default internal implementation.
 SparseBlockStructure3D (Box3D boundingBox_, plint gridNx_, plint gridNy_, plint gridNz_)
 Sparse grid structure with explicit grid parameters.
 SparseBlockStructure3D (SparseBlockStructure3D const &rhs, Box3D boundingBox_)
 Restrict an existing SparseBlockStructure3D to a sub-domain.
void addBlock (Box3D const &bulk, Box3D const &uniqueBulk, plint blockId)
 Add a new block to the sparse block-structure.
void addBlock (Box3D const &bulk, plint blockId)
 Add a new block to the sparse block-structure; uniqueBulk = bulk.
void removeBlock (plint blockId)
 Remove an existing block from the sparse block-structure.
bool exists (plint blockId)
 Check if a block with the given ID already exists in the block-structure.
plint nextIncrementalId () const
 Return 1 + the maximum block ID currently found in the structure.
Box3D getBoundingBox () const
 Return outer bounding box.
bool getBulk (plint blockId, Box3D &bulk) const
 Get the bulk of a given block. Returns false if the block does not exist.
bool getUniqueBulk (plint blockId, Box3D &uniqueBulk) const
 Get the unique bulk of a given block. Returns false if the block does not exist.
plint getNumBlocks () const
 Return the number of blocks contained in the structure.
plint getNumBulkCells () const
 Get the number of bulk cells, cumulated over all blocks.
std::map< plint, Box3D > const & getBulks () const
 Get the id-to-bulk map for all blocks.
std::vector< plintgetLocalBlocks (ThreadAttribution const &attribution) const
 Enumerate all blocks attributed to the current MPI thread.
plint locate (plint iX, plint iY, plint iZ) const
 Find a block which contains given coordinates. Return -1 in case no block is found.
void intersect (Box3D const &bulk, std::vector< plint > &ids, std::vector< Box3D > &intersections) const
 Intersect a given block with all blocks of the sparse block-structure.
void computeOverlaps (Box3D const &bulk, plint dx, plint dy, plint dz, std::vector< plint > &ids, std::vector< Box3D > &overlapsOnBulk, std::vector< Box3D > &overlapsOnNeighbors) const
void computeOverlaps (plint blockId, plint envelopeWidth, std::vector< plint > &ids, std::vector< Box3D > &overlapsOnBulk, std::vector< Box3D > &overlapsOnNeighbors) const
 Intersect the envelope of block "blockId" with all neighbors.
void findNeighbors (Box3D const &block, plint neighborhoodWidth, std::vector< plint > &neighbors, plint excludeId=-1) const
void findNeighbors (plint blockId, plint neighborhoodWidth, std::vector< plint > &neighbors) const
 Find all blocks adjacent to a given block of the structure.
void swap (SparseBlockStructure3D &rhs)

Member Typedef Documentation

typedef std::map<Dot3D, std::vector<plint> > plb::SparseBlockStructure3D::GridT

Constructor & Destructor Documentation

plb::SparseBlockStructure3D::SparseBlockStructure3D ( plint  nx,
plint  ny,
plint  nz 
)

Sparse grid structure with default internal implementation.

References PLB_PRECONDITION.

plb::SparseBlockStructure3D::SparseBlockStructure3D ( Box3D  boundingBox_  ) 

Sparse grid structure with default internal implementation.

References plb::Box3D::getNx(), plb::Box3D::getNy(), plb::Box3D::getNz(), and PLB_PRECONDITION.

plb::SparseBlockStructure3D::SparseBlockStructure3D ( Box3D  boundingBox_,
plint  gridNx_,
plint  gridNy_,
plint  gridNz_ 
)

Sparse grid structure with explicit grid parameters.

References plb::Box3D::getNx(), plb::Box3D::getNy(), plb::Box3D::getNz(), and PLB_PRECONDITION.

plb::SparseBlockStructure3D::SparseBlockStructure3D ( SparseBlockStructure3D const &  rhs,
Box3D  boundingBox_ 
)

Member Function Documentation

void plb::SparseBlockStructure3D::addBlock ( Box3D const &  bulk,
plint  blockId 
)

Add a new block to the sparse block-structure; uniqueBulk = bulk.

References addBlock().

void plb::SparseBlockStructure3D::addBlock ( Box3D const &  bulk,
Box3D const &  uniqueBulk,
plint  blockId 
)

Add a new block to the sparse block-structure.

References plb::contained(), exists(), PLB_ASSERT, and removeBlock().

Referenced by addBlock().

void plb::SparseBlockStructure3D::computeOverlaps ( plint  blockId,
plint  envelopeWidth,
std::vector< plint > &  ids,
std::vector< Box3D > &  overlapsOnBulk,
std::vector< Box3D > &  overlapsOnNeighbors 
) const

Intersect the envelope of block "blockId" with all neighbors.

References plb::BlockDomain::bulk, and computeOverlaps().

void plb::SparseBlockStructure3D::computeOverlaps ( Box3D const &  bulk,
plint  dx,
plint  dy,
plint  dz,
std::vector< plint > &  ids,
std::vector< Box3D > &  overlapsOnBulk,
std::vector< Box3D > &  overlapsOnNeighbors 
) const

Intersect the envelope of block "blockId" with all neighbors in a given direction.

References plb::BlockDomain::envelope, intersect(), plb::Box3D::x0, plb::Box3D::x1, plb::Box3D::y0, plb::Box3D::y1, plb::Box3D::z0, and plb::Box3D::z1.

Referenced by computeOverlaps().

bool plb::SparseBlockStructure3D::exists ( plint  blockId  ) 

Check if a block with the given ID already exists in the block-structure.

Referenced by addBlock().

void plb::SparseBlockStructure3D::findNeighbors ( plint  blockId,
plint  neighborhoodWidth,
std::vector< plint > &  neighbors 
) const

Find all blocks adjacent to a given block of the structure.

References plb::BlockDomain::bulk, and findNeighbors().

void plb::SparseBlockStructure3D::findNeighbors ( Box3D const &  block,
plint  neighborhoodWidth,
std::vector< plint > &  neighbors,
plint  excludeId = -1 
) const

Find all blocks adjacent to a given area (a specific block can be excluded from the search.

References plb::doesIntersect(), and plb::Box3D::enlarge().

Referenced by findNeighbors().

bool plb::SparseBlockStructure3D::getBulk ( plint  blockId,
Box3D bulk 
) const

Get the bulk of a given block. Returns false if the block does not exist.

Referenced by plb::computeSparseManagement(), plb::MultiBlockManagement3D::getBulk(), plb::MultiBlockManagement3D::getEnvelope(), and plb::SmartBulk3D::SmartBulk3D().

std::vector< plint > plb::SparseBlockStructure3D::getLocalBlocks ( ThreadAttribution const &  attribution  )  const

Enumerate all blocks attributed to the current MPI thread.

References plb::ThreadAttribution::isLocal().

plint plb::SparseBlockStructure3D::getNumBlocks (  )  const

Return the number of blocks contained in the structure.

plint plb::SparseBlockStructure3D::getNumBulkCells (  )  const

Get the number of bulk cells, cumulated over all blocks.

Referenced by plb::MultiBlockUnSerializer3D::getSize(), and plb::MultiBlockSerializer3D::getSize().

bool plb::SparseBlockStructure3D::getUniqueBulk ( plint  blockId,
Box3D uniqueBulk 
) const

Get the unique bulk of a given block. Returns false if the block does not exist.

Referenced by plb::computeSparseManagement(), and plb::MultiBlockManagement3D::getUniqueBulk().

void plb::SparseBlockStructure3D::intersect ( Box3D const &  bulk,
std::vector< plint > &  ids,
std::vector< Box3D > &  intersections 
) const

Intersect a given block with all blocks of the sparse block-structure.

References plb::intersect(), plb::Box3D::x0, plb::Box3D::x1, plb::Box3D::y0, plb::Box3D::y1, plb::Box3D::z0, and plb::Box3D::z1.

Referenced by computeOverlaps().

plint plb::SparseBlockStructure3D::locate ( plint  iX,
plint  iY,
plint  iZ 
) const

Find a block which contains given coordinates. Return -1 in case no block is found.

References plb::BlockDomain::bulk, and plb::contained().

Referenced by plb::MultiBlockManagement3D::findInLocalBulk().

plint plb::SparseBlockStructure3D::nextIncrementalId (  )  const

Return 1 + the maximum block ID currently found in the structure.

void plb::SparseBlockStructure3D::removeBlock ( plint  blockId  ) 

Remove an existing block from the sparse block-structure.

Referenced by addBlock().

void plb::SparseBlockStructure3D::swap ( SparseBlockStructure3D rhs  ) 

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