atlas::mesh::MultiBlockConnectivityImpl class

Connectivity contiguously composed of multiple BlockConnectivityImpl.

Container for connectivity tables that are layed out in memory as multiple BlockConnectivities stitched together. This is e.g. the case for a element-node connectivity, with element-types grouped together:

connectivity = [
   # triangles  (block 0)
       1   2   3
       4   5   6
       7   8   9
      10  11  12
   # quadrilaterals (block 1)
      13  14  15  16
      17  18  19  20
      21  22  23  24
]

This class can also be interpreted as a atlas::IrregularConnectivity without distinction between blocks

There are 2 modes of construction:

  • It wraps existing raw data
  • It owns the connectivity data

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

Base classes

class IrregularConnectivityImpl

Public types

using Row = ConnectivityRow
using ctxt_t = void*
using callback_t = void(*)(ctxt_t)

Constructors, destructors, conversion operators

MultiBlockConnectivityImpl(const std::string& name = "")
Construct connectivity table that needs resizing a-posteriori Data is owned.
MultiBlockConnectivityImpl(eckit::Stream&) explicit
Construct a mesh from a Stream (serialization)
~MultiBlockConnectivityImpl() virtual

Public functions

auto blocks() const -> idx_t
Number of blocks.
auto block(idx_t block_idx) const -> const BlockConnectivityImpl&
Access to a block connectivity.
auto block(idx_t block_idx) -> BlockConnectivityImpl&
auto operator()(idx_t row_idx, idx_t col_idx) const -> idx_t
Access to connectivity table elements for given row and column The row_idx counts up from 0, from block 0, as in IrregularConnectivity The returned index has base 0 regardless if ATLAS_HAVE_FORTRAN is defined.
auto operator()(idx_t block_idx, idx_t block_row_idx, idx_t block_col_idx) const -> idx_t
Access to connectivity table elements for given row and column The block_row_idx counts up from zero for every block_idx. The returned index has base 0 regardless if ATLAS_HAVE_FORTRAN is defined.
void add(idx_t rows, idx_t cols, const idx_t values[], bool fortran_array = false) virtual
Resize connectivity, and add given rows as a new block.
void add(const BlockConnectivityImpl&) virtual
Resize connectivity, and copy from a BlockConnectivity to a new block.
void add(idx_t rows, idx_t cols) virtual
Resize connectivity, and add given rows with missing values.
void add(idx_t rows, const idx_t cols[]) virtual
Resize connectivity, and add given rows with missing values.
void insert(idx_t position, idx_t rows, idx_t cols, const idx_t values[], bool fortran_array = false) virtual
Resize connectivity, and insert given rows.
void insert(idx_t position, idx_t rows, idx_t cols) virtual
Resize connectivity, and insert given rows with missing values.
void insert(idx_t position, idx_t rows, const idx_t cols[]) virtual
Resize connectivity, and insert given rows with missing values.
void clear() virtual
auto footprint() const -> size_t virtual
void encode(eckit::Stream& s) const virtual
void decode(eckit::Stream& s) virtual
auto name() const -> const std::string
Name associated to this Connetivity.
void rename(const std::string& name)
Rename this Connectivity.
auto rows() const -> idx_t
Number of rows in the connectivity table.
auto cols(idx_t row_idx) const -> idx_t
Number of columns for specified row in the connectivity table.
auto maxcols() const -> idx_t
Maximum value for number of columns over all rows.
auto mincols() const -> idx_t
Minimum value for number of columns over all rows.
auto size() const -> idx_t
auto missing_value() const -> idx_t
auto row(idx_t row_idx) const -> Row
void set(idx_t row_idx, const idx_t column_values[])
Modify row with given values. Values must be given with base 0.
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 resize(idx_t old_size, idx_t size, bool initialize, const idx_t values[], bool fortran_array) virtual
Resize connectivity.
auto displs(const idx_t row) const -> idx_t
void dump(std::ostream& os) const

Friends

auto operator<<(eckit::Stream& s, const MultiBlockConnectivityImpl& x) -> eckit::Stream&
auto operator>>(eckit::Stream& s, MultiBlockConnectivityImpl& x) -> eckit::Stream&

Function documentation

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

Resize connectivity, and add given rows as a new block.

void atlas::mesh::MultiBlockConnectivityImpl::add(const BlockConnectivityImpl&) virtual

Resize connectivity, and copy from a BlockConnectivity to a new block.

void atlas::mesh::MultiBlockConnectivityImpl::add(idx_t rows, idx_t cols) virtual

Resize connectivity, and add given rows with missing values.

void atlas::mesh::MultiBlockConnectivityImpl::add(idx_t rows, const idx_t cols[]) virtual

Resize connectivity, and add given rows with missing values.

void atlas::mesh::MultiBlockConnectivityImpl::insert(idx_t position, idx_t rows, idx_t cols, const idx_t values[], bool fortran_array = false) virtual

Resize connectivity, and insert given rows.

void atlas::mesh::MultiBlockConnectivityImpl::insert(idx_t position, idx_t rows, idx_t cols) virtual

Resize connectivity, and insert given rows with missing values.

void atlas::mesh::MultiBlockConnectivityImpl::insert(idx_t position, idx_t rows, const idx_t cols[]) virtual

Resize connectivity, and insert given rows with missing values.