27template <
class ParticleCellType>
45 for (
auto &p : cell) {
49 [](
const auto &a,
const auto &b) ->
bool { return a.first < b.first; });
104 [&behavior](
auto pair) { return behavior.contains(*(std::get<1>(pair))); });
113 [](
const auto &particlePosPair) { return particlePosPair.second->isDummy(); }),
118 if (index >=
size()) {
123 if (index <
size() - 1) {
#define AutoPasLog(lvl, fmt,...)
Macro for logging providing common meta information without filename.
Definition: Logger.h:24
Wraps the iterator of arbitrary cells to provide a common interface.
Definition: CellIterator.h:19
Class for Cells of Particles.
Definition: ParticleCell.h:51
void setPossibleParticleOwnerships(OwnershipState state)
Set the type of particles contained in this cell.
Definition: ParticleCell.h:162
This class defines a sorted view on a given ParticleCell.
Definition: SortedCellView.h:28
typename ParticleCellType::ParticleType ParticleType
The particle type for this view is the particle type from the cell.
Definition: SortedCellView.h:33
void setCellLength(std::array< double, 3 > &cellLength) override
Set the side lengths of this cell.
Definition: SortedCellView.h:129
void clear() override
Deletes all particles in this cell.
Definition: SortedCellView.h:109
std::array< double, 3 > getCellLength() const override
Get the side lengths of this cell.
Definition: SortedCellView.h:131
SortedCellView(ParticleCellType &cell, const std::array< double, 3 > &r)
Constructs a FullSortedParticleCell.
Definition: SortedCellView.h:43
void deleteByIndex(size_t index) override
Deletes the index-th particle.
Definition: SortedCellView.h:117
const ParticleType & at(size_t index) const
Returns the const particle at position index.
Definition: SortedCellView.h:145
void deleteDummyParticles() override
Deletes all dummy particles in this cell.
Definition: SortedCellView.h:111
CellIterator< typename ParticleCellType::StorageType, false > end() const
Get an iterator to the end of a ParticleCell.
Definition: SortedCellView.h:89
size_t getNumberOfParticles(IteratorBehavior behavior) const override
Get the number of particles with respect to the specified IteratorBehavior.
Definition: SortedCellView.h:102
ParticleCellType * _cell
Underlying cell.
Definition: SortedCellView.h:155
CellIterator< typename ParticleCellType::StorageType, false > begin() const
Get an iterator to the start of a ParticleCell.
Definition: SortedCellView.h:74
CellIterator< typename ParticleCellType::StorageType, true > begin()
Get an iterator to the start of a ParticleCell.
Definition: SortedCellView.h:65
bool isEmpty() const override
Check if the cell is empty.
Definition: SortedCellView.h:107
void addParticle(const ParticleType &p) override
Adds a Particle to the cell.
Definition: SortedCellView.h:59
CellIterator< typename ParticleCellType::StorageType, true > end()
Get an iterator to the end of a ParticleCell.
Definition: SortedCellView.h:81
std::vector< ParticleType * > StorageType
Type that holds or refers to the actual particles.
Definition: SortedCellView.h:37
CellType getParticleCellTypeAsEnum() override
Get the ParticleCell type as an ParticleCellTypeEnum.
Definition: SortedCellView.h:54
ParticleType & at(size_t index)
Returns the particle at position index.
Definition: SortedCellView.h:138
size_t size() const override
Get the number of all particles stored in this cell (owned, halo and dummy).
Definition: SortedCellView.h:97
std::vector< std::pair< double, ParticleType * > > _particles
Sorted vector of projected positions and particle pointers.
Definition: SortedCellView.h:150
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
constexpr T dot(const std::array< T, SIZE > &a, const std::array< T, SIZE > &b)
Generates the dot product of two arrays.
Definition: ArrayMath.h:233
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32
CellType
The ParticleCell Type as an Enum.
Definition: ParticleCell.h:19
@ SortedCellView
SortedCellView : Holds pointers to particles sorted by their position projected along a vector.