class
#include <atlas/mesh/Connectivity.h>
MultiBlockConnectivityImpl 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
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(const BlockConnectivityImpl&) virtual
Resize connectivity, and copy from a BlockConnectivity to a new block.