atlas
Public Member Functions | Protected Member Functions | Friends | List of all members
atlas::mesh::BlockConnectivityImpl Class Reference

Block Connectivity table. More...

#include <Connectivity.h>

Public Member Functions

 BlockConnectivityImpl ()
 Construct connectivity table that needs resizing a-posteriori Data is owned.
 
 BlockConnectivityImpl (idx_t rows, idx_t cols, const std::initializer_list< idx_t > &)
 
 BlockConnectivityImpl (idx_t rows, idx_t cols, idx_t values[])
 Construct connectivity table wrapping existing raw data. More...
 
 BlockConnectivityImpl (BlockConnectivityImpl &&other)
 
BlockConnectivityImploperator= (const BlockConnectivityImpl &other)
 
BlockConnectivityImploperator= (BlockConnectivityImpl &&other)
 
 BlockConnectivityImpl (eckit::Stream &)
 Construct a mesh from a Stream (serialization)
 
 ~BlockConnectivityImpl ()
 Destructor.
 
ATLAS_HOST_DEVICE idx_t index (idx_t i, idx_t j) const
 
ATLAS_HOST_DEVICE idx_t operator() (idx_t row_idx, idx_t col_idx) const
 Access to connectivity table elements for given row and column The returned index has base 0 regardless if ATLAS_HAVE_FORTRAN is defined. More...
 
ATLAS_HOST_DEVICE idx_t rows () const
 Number of rows.
 
ATLAS_HOST_DEVICE idx_t cols () const
 Number of columns.
 
ATLAS_HOST_DEVICE const idx_tdata () const
 Access to raw data. More...
 
ATLAS_HOST_DEVICE idx_tdata ()
 
ATLAS_HOST_DEVICE idx_t missing_value () const
 
size_t footprint () const
 
ATLAS_HOST_DEVICE void set (idx_t row_idx, const idx_t column_values[])
 Modify row with given values. Values must be given with base 0.
 
ATLAS_HOST_DEVICE void set (idx_t row_idx, idx_t col_idx, const idx_t value)
 Modify (row,col) with given value. Value must be given with base 0.
 
void add (idx_t rows, idx_t cols, const idx_t values[], bool fortran_array=false)
 Resize connectivity, and add given rows. More...
 
bool owns () const
 

Protected Member Functions

void rebuild (idx_t rows, idx_t cols, idx_t values[])
 Wrap existing and set owns_ = false.
 
void encode (eckit::Stream &) const
 Serialization to Stream.
 
void decode (eckit::Stream &)
 Serialization from Stream.
 
void print (std::ostream &) const
 

Friends

class IrregularConnectivityImpl
 
class MultiBlockConnectivityImpl
 
std::ostream & operator<< (std::ostream &out, const BlockConnectivityImpl &x)
 
eckit::Stream & operator<< (eckit::Stream &s, const BlockConnectivityImpl &x)
 
eckit::Stream & operator>> (eckit::Stream &s, BlockConnectivityImpl &x)
 

Detailed Description

Block Connectivity table.

Author
Willem Deconinck Container for connectivity tables that are layed out in memory as a block. Every row has the same number of columns.

There are 2 modes of construction:

In case ATLAS_HAVE_FORTRAN is defined (which is usually the case), the raw data will be stored with base 1 for Fortran interoperability. The operator(row,col) will then do the conversion to base 0.

In the first mode of construction, the connectivity table cannot be resized. In the second mode of construction, resizing is possible

Constructor & Destructor Documentation

◆ BlockConnectivityImpl()

atlas::mesh::BlockConnectivityImpl::BlockConnectivityImpl ( idx_t  rows,
idx_t  cols,
idx_t  values[] 
)

Construct connectivity table wrapping existing raw data.

No resizing can be performed as data is not owned.

Member Function Documentation

◆ add()

void atlas::mesh::BlockConnectivityImpl::add ( idx_t  rows,
idx_t  cols,
const idx_t  values[],
bool  fortran_array = false 
)

Resize connectivity, and add given rows.

Note
Can only be used when data is owned.

◆ data()

ATLAS_HOST_DEVICE const idx_t* atlas::mesh::BlockConnectivityImpl::data ( ) const
inline

Access to raw data.

Note that the connectivity base is 1 in case ATLAS_HAVE_FORTRAN is defined.

◆ operator()()

idx_t atlas::mesh::BlockConnectivityImpl::operator() ( idx_t  row_idx,
idx_t  col_idx 
) const
inline

Access to connectivity table elements for given row and column The returned index has base 0 regardless if ATLAS_HAVE_FORTRAN is defined.


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