AutoPas  3.0.0
Loading...
Searching...
No Matches
CellBorderAndFlagManager.h
Go to the documentation of this file.
1
7#pragma once
8#include <cstdlib>
9
11
12namespace autopas::internal {
18 public:
22 using index_t = std::size_t;
23
27 virtual ~CellBorderAndFlagManager() = default;
28
34 [[nodiscard]] virtual bool cellCanContainHaloParticles(index_t index1d) const = 0;
35
41 [[nodiscard]] virtual bool cellCanContainOwnedParticles(index_t index1d) const = 0;
42
49 [[nodiscard]] bool ignoreCellForIteration(index_t index1d, IteratorBehavior behavior) const {
50 if ((behavior & IteratorBehavior::halo) and cellCanContainHaloParticles(index1d)) {
51 return false;
52 }
53 if ((behavior & IteratorBehavior::owned) and cellCanContainOwnedParticles(index1d)) {
54 return false;
55 }
56 if (behavior & IteratorBehavior::dummy) {
57 return false;
58 }
59 return true;
60 }
61};
62} // namespace autopas::internal
Interface class to handle cell borders and cell types of cells.
Definition: CellBorderAndFlagManager.h:17
bool ignoreCellForIteration(index_t index1d, IteratorBehavior behavior) const
Checks if cell with index1d can be ignored for iteration with currently selected behavior.
Definition: CellBorderAndFlagManager.h:49
std::size_t index_t
The index type to access the particle cells.
Definition: CellBorderAndFlagManager.h:22
virtual bool cellCanContainOwnedParticles(index_t index1d) const =0
Checks if the cell with the one-dimensional index index1d can contain owned particles.
virtual ~CellBorderAndFlagManager()=default
Cestructor.
virtual bool cellCanContainHaloParticles(index_t index1d) const =0
Checks if the cell with the one-dimensional index index1d can contain halo particles.
This namespace is used for implementation specifics.
Definition: CellFunctor.h:14