5#include "coupling/CouplingMDDefinitions.h"
6#include "coupling/datastructures/CouplingCell.h"
7#include "coupling/indexing/IndexingService.h"
10namespace datastructures {
11template <
class CellIndexT,
unsigned int dim>
class CellContainer;
29 CellContainer() {
_couplingCells.reserve(CellIndexT::linearNumberCellsInDomain); }
32 for (
auto cell : couplingCells) {
42#if (COUPLING_MD_ERROR == COUPLING_MD_YES)
43 if (
_couplingCells.size() < CellIndexT::linearNumberCellsInDomain) {
44 std::cout <<
"CellContainer<" << CellIndexT::TNAME <<
"," << dim <<
"> accessed but not full " << std::endl;
45 std::exit(EXIT_FAILURE);
55#if (COUPLING_MD_ERROR == COUPLING_MD_YES)
56 if (
_couplingCells.size() >= CellIndexT::linearNumberCellsInDomain) {
57 std::cout <<
"CellContainer<" << CellIndexT::TNAME <<
"," << dim <<
"> can only hold " << CellIndexT::linearNumberCellsInDomain <<
" coupling cells!"
59 std::exit(EXIT_FAILURE);
79 using CouplingCellIterator =
typename std::vector<coupling::datastructures::CouplingCell<dim>*>::const_iterator;
81 Iterator(CouplingCellIterator itCouplingCells,
typename CellIndexT::IndexIterator itIdx) :
_itCouplingCells(itCouplingCells),
_itIdx(itIdx) {}
96 Iterator operator++(
int) {
102 friend bool operator==(
const Iterator& a,
const Iterator& b) {
return a._itCouplingCells == b._itCouplingCells; }
104 friend bool operator!=(
const Iterator& a,
const Iterator& b) {
return !(a == b); }
115 typename CellIndexT::IndexIterator
_itIdx;
Provides iterator functionality (increment, access as <*cell, index> pair, equality)
Definition CellContainer.h:77
CellIndexT::IndexIterator _itIdx
Definition CellContainer.h:115
const std::pair< coupling::datastructures::CouplingCell< dim > *, CellIndexT > operator*() const
Definition CellContainer.h:88
CouplingCellIterator _itCouplingCells
Definition CellContainer.h:108
provides access to the coupling cells. Base class for the class coupling::datastructures::LinkedCellC...
Definition CellContainer.h:26
Iterator end() const
Definition CellContainer.h:122
void operator<<(coupling::datastructures::CouplingCell< dim > *couplingCell)
Definition CellContainer.h:54
coupling::datastructures::CouplingCell< dim > * operator[](CellIndexT index) const
Definition CellContainer.h:41
unsigned int size() const
Definition CellContainer.h:72
std::vector< coupling::datastructures::CouplingCell< dim > * > _couplingCells
Definition CellContainer.h:130
Iterator begin() const
Definition CellContainer.h:119
defines the cell type with cell-averaged quantities only (no linked cells).
Definition CouplingCell.h:29
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15