44 template <
class CellType>
222 #include "common/abstract/HoldsCells.tpp"
std::basic_string< CepsChar > CepsString
C++ format string.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
CepsInt CepsIndex
Index rowid etc.
An abstract class for objects that regroup pointers to cells (eg a mesh, a finite elements discretiza...
HoldsCells(const HoldsCells &)=default
Copy constructor.
void removeCell(CellType *&name)
Removes a given cell pointer from the list.
HoldsCells(HoldsCells &&) noexcept=default
Copy constructor.
HoldsCells(const CepsVector< CellType * > &cells)
Constructor with a vector of cells.
void reset()
Equivalent to HoldsCells::clearCells.
CepsUInt getNumberOfCells() const
Returns the number of cells in the object.
void addCells(const CepsVector< CellType * > &cells)
Adds several cells to the list.
void errorOnCellIndex(CepsUInt i, const CepsString &funcName) const
Aborts if object holds less than i cells.
HoldsCells(CellType **cells, const CepsUInt &n)
Constructor with a vector of cells.
CepsBool hasAllCells(const CepsVector< CellType * > &cells)
Tells if object has all cells given in argument.
CepsIndex getCellIndex(CepsUInt i) const
Get the index of i-th cell.
CepsBool hasOneOfCells(const CepsVector< CellType * > &cells)
Tells if object has one of the cells given in argument.
void addCell(CellType *&name)
Adds a cell to the list.
CepsVector< CellType * > & getCells()
Reference to the cells.
CepsBool hasCell(CellType *&neigh)
Tells if object has the cell given in argument.
void setCellAt(const CepsUInt &i, CellType *neigh)
Set a cell pointer in the vector of currently held cells, at given index.
void setCells(const CepsVector< CellType * > &cells)
Replaces currently held cell pointers.
HoldsCells()=default
Default constructor.
void removeCells(const CepsVector< CellType * > &cells)
Removes several cell pointers from the list.
CepsVector< CellType * > getValidCells()
Reference to the valid cells.
CepsVector< CellType * > m_cells
The cell pointers.
void clearCells()
Wipes the current list of cell pointers.
CepsVector< CepsIndex > getCellsIndices() const
Get indices of all cells.
CellType *& getCellAt(const CepsUInt &i)
Pointer to the i-th cell.
CepsUInt countValidCells()
Get the number of cells that are not nullptr.
A namespace for all utility methods.