atlas::mesh::BlockConnectivityImpl class

Block Connectivity table.

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

Constructors, destructors, conversion operators

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. No resizing can be performed as data is not owned.
BlockConnectivityImpl(BlockConnectivityImpl&& other)
BlockConnectivityImpl(eckit::Stream&) explicit
Construct a mesh from a Stream (serialization)
~BlockConnectivityImpl()
Destructor.

Public functions

auto operator=(const BlockConnectivityImpl& other) -> BlockConnectivityImpl&
auto operator=(BlockConnectivityImpl&& other) -> BlockConnectivityImpl&
auto index(idx_t i, idx_t j) const -> idx_t
auto operator()(idx_t row_idx, idx_t col_idx) const -> idx_t
Access to connectivity table elements for given row and column The returned index has base 0 regardless if ATLAS_HAVE_FORTRAN is defined.
auto rows() const -> idx_t
Number of rows.
auto cols() const -> idx_t
Number of columns.
auto data() const -> const idx_t*
Access to raw data. Note that the connectivity base is 1 in case ATLAS_HAVE_FORTRAN is defined.
auto data() -> idx_t*
auto missing_value() const -> idx_t
auto footprint() const -> size_t
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 add(idx_t rows, idx_t cols, const idx_t values[], bool fortran_array = false)
Resize connectivity, and add given rows.
auto owns() const -> bool

Friends

auto operator<<(std::ostream& out, const BlockConnectivityImpl& x) -> std::ostream&
auto operator<<(eckit::Stream& s, const BlockConnectivityImpl& x) -> eckit::Stream&
auto operator>>(eckit::Stream& s, BlockConnectivityImpl& x) -> eckit::Stream&

Function documentation

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.