MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::datastructures::CellContainer< CellIndexT, dim > Class Template Reference

provides access to the coupling cells. Base class for the class coupling::datastructures::LinkedCellContainer More...

#include <CellContainer.h>

Classes

class  Iterator
 Provides iterator functionality (increment, access as <*cell, index> pair, equality) More...
 

Public Member Functions

 CellContainer (std::vector< coupling::datastructures::CouplingCell< dim > * > couplingCells)
 
coupling::datastructures::CouplingCell< dim > * operator[] (CellIndexT index) const
 
void operator<< (coupling::datastructures::CouplingCell< dim > *couplingCell)
 
unsigned int size () const
 
Iterator begin () const
 
Iterator end () const
 

Protected Attributes

std::vector< coupling::datastructures::CouplingCell< dim > * > _couplingCells
 

Detailed Description

template<class CellIndexT, unsigned int dim>
class coupling::datastructures::CellContainer< CellIndexT, dim >

provides access to the coupling cells. Base class for the class coupling::datastructures::LinkedCellContainer

The CellContainer is intended to be used for a fixed indexing domain. Once created, it is assumed to hold all cells in that domain. For example, a CellContainer created with template parameter I02 is expected to contain all cells that are accessible by iterating through I02. CellContainers do not capture relevant cells automatically. It is the responsibility of the calling function to allocate the cells and populate the container completely before using it. Due to this complete and contiguous nature of the datastructure, direct indexing is allowed, and the cell container is expected to start at location 0 of the indexing domain it was initialized with. CellContainers contain pointers to coupling cells, the cells are not owned by the container, hence the calling function must delete the cells later.

Template Parameters
dimNumber of dimensions; it can be 1, 2 or 3

Member Function Documentation

◆ begin()

template<class CellIndexT, unsigned int dim>
Iterator coupling::datastructures::CellContainer< CellIndexT, dim >::begin ( ) const
inline

Provides pointer to beginning of iterator of this container

◆ end()

template<class CellIndexT, unsigned int dim>
Iterator coupling::datastructures::CellContainer< CellIndexT, dim >::end ( ) const
inline

Provides pointer to end of iterator of this container

◆ operator<<()

template<class CellIndexT, unsigned int dim>
void coupling::datastructures::CellContainer< CellIndexT, dim >::operator<< ( coupling::datastructures::CouplingCell< dim > * couplingCell)
inline

Adds a new coupling cell to the datastructure at the next index (will only work if the data structure is not yet full)

Parameters
cella pointer to the cell to be inserted

◆ operator[]()

template<class CellIndexT, unsigned int dim>
coupling::datastructures::CouplingCell< dim > * coupling::datastructures::CellContainer< CellIndexT, dim >::operator[] ( CellIndexT index) const
inline

Index based access, returns a pointer to the coupling cell

Parameters
indexindex An index of type CellIndexT i.e. from the initializing subdomain
Returns
the pointer to the requested cell

◆ size()

template<class CellIndexT, unsigned int dim>
unsigned int coupling::datastructures::CellContainer< CellIndexT, dim >::size ( ) const
inline

Returns size of the underlying container.

This size is notably not the number of cells in the index domain. However, in practice the two numbers should be identical, as accessing contents of an incomplete cotnainer is not allowed.

Returns
the number of cells stored currently

Member Data Documentation

◆ _couplingCells

template<class CellIndexT, unsigned int dim>
std::vector<coupling::datastructures::CouplingCell<dim>*> coupling::datastructures::CellContainer< CellIndexT, dim >::_couplingCells
protected

Holds pointers to all coupling cells. This is used for interfacing to send-recv operations.


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