11 #include "../ParticleContainer.h"
30 std::vector<std::vector<Particle> >
cells;
63 std::vector<omp_lock_t> locks;
137 void calculateHaloCellIndices();
142 void calculateBoundaryCellIndices();
147 void calculateDomainCellsIterationScheme();
149 void calculateScheduleParallelSophisticatedHelper(
int xStart,
int yStart,
int zStart);
151 void calculateScheduleNaive();
153 void calculateScheduleParallelSophisticated();
164 double calcDistanceFromBoundary(
Particle &p,
Side side);
174 std::array<double, 3> calcGhostParticle(
Particle &p,
Side side);
185 void teleportParticlesToOppositeSideHelper(
Side sideStart,
int dimension,
int modus);
194 void applyForceToOppositeCellsHelper(
Side side, std::array<int, 3> cellToProcess);
205 void applyForceToOppositeEdgeHelper(std::array<int, 3> cellToProcess, std::array<int, 3> offsetCell,
206 std::array<double, 3> offsetPosition,
int dim);
214 [[nodiscard]]
bool isCellInDomain(std::array<int, 3> cell)
const;
222 [[nodiscard]]
bool isParticleInDomain(
const std::array<double, 3> &position)
const;
231 void applyForcesBetweenTwoCells(
int cellTarget,
int cellSource, std::array<double, 3> offsetSource);
254 int calcCellIndex(
const std::array<double, 3> &position);
275 [[nodiscard]]
int threeDToOneD(
int x,
int y,
int z)
const;
277 int threeDToOneDDomain(
int x,
int y,
int z)
const;
286 [[nodiscard]] std::array<int, 3> oneDToThreeD(
int index)
const;
298 void clearHaloCells(
Side side);
305 void applyToEachParticle(
const std::function<
void(
Particle &)> &
function)
override;
312 void applyToEachParticleInDomain(
const std::function<
void(
Particle &)> &
function)
override;
324 void applyToAllUniquePairsInDomain(
const std::function<
void(
Particle &,
Particle &)> &
function)
override;
332 void applyToAllUniquePairsInDomainOptimized(
333 const std::function<
void(
Particle &,
Particle &, std::array<double, 3>,
double)> &
function);
346 void applyToAllBoundaryParticles(
const std::function<
void(
Particle &, std::array<double, 3> &)> &
function,
354 [[nodiscard]]
size_t size()
const override;
365 std::array<double, 3> fromLowToHigh(
const std::array<double, 3> &position,
int dimension);
376 std::array<double, 3> fromHighToLow(
const std::array<double, 3> &position,
int dimension);
386 void teleportParticlesToOppositeSide(
Side sideStart);
395 void applyForcesFromOppositeSide(
Side side);
405 void applyToAllUniquePairsInDomainParallelReduction(
const std::function<
void(
Particle &,
Particle &,
int)> &
function);
413 void applyToEachParticleInDomainParallel(
const std::function<
void(
Particle &)> &
function);
421 void applyToAllUniquePairsInDomainParallelHelper(
const std::function<
void(
Particle &,
Particle &)> &
function, std::vector<int>& scheduling);
428 void applyToAllUniquePairsInDomainParallelSophisticated(
436 void applyToAllUniquePairsInDomainParallelNaive(
const std::function<
void(
Particle &,
Particle &)> &
function);
455 return domainCellIterationScheme;
Definition: LennardJonesForce.h:8
Container to store the particles for simulation using the linked cells algorithm.
Definition: LinkedCellsContainer.h:22
int getNZ() const
Definition: LinkedCellsContainer.h:466
std::vector< std::vector< int > > & getDomainCellIterationScheme()
Definition: LinkedCellsContainer.h:454
int baseYDomain
Definition: LinkedCellsContainer.h:92
bool twoD
Definition: LinkedCellsContainer.h:118
std::array< std::vector< int >, 6 > boundaries
Definition: LinkedCellsContainer.h:50
int getNY() const
Definition: LinkedCellsContainer.h:462
int nZ
Definition: LinkedCellsContainer.h:80
bool isTwoD() const
Definition: LinkedCellsContainer.h:486
std::array< std::vector< int >, 6 > & getHaloCells()
Definition: LinkedCellsContainer.h:446
std::vector< std::vector< Particle > > cells
Definition: LinkedCellsContainer.h:30
std::array< std::vector< int >, 6 > haloCells
Definition: LinkedCellsContainer.h:46
double getCellSizeX() const
Definition: LinkedCellsContainer.h:470
std::array< double, 3 > getDomainSize() const
Definition: LinkedCellsContainer.h:490
double getCellSizeZ() const
Definition: LinkedCellsContainer.h:478
double getCellSizeY() const
Definition: LinkedCellsContainer.h:474
BoundarySet boundariesSet
Definition: LinkedCellsContainer.h:129
int baseZDomain
Definition: LinkedCellsContainer.h:97
double cellSizeZ
Definition: LinkedCellsContainer.h:110
outputWriter::VTKWriter vtk_writer
Definition: LinkedCellsContainer.h:125
std::vector< int > scheduleParallelNaive
Definition: LinkedCellsContainer.h:58
std::array< double, 3 > domainSize
Definition: LinkedCellsContainer.h:123
std::vector< std::vector< Particle > > & getCells()
Definition: LinkedCellsContainer.h:442
size_t currentSize
Definition: LinkedCellsContainer.h:36
double rCutOff
Definition: LinkedCellsContainer.h:114
int getNX() const
Definition: LinkedCellsContainer.h:458
std::vector< int > scheduleParallelSophisticated
Definition: LinkedCellsContainer.h:59
std::vector< std::vector< int > > domainCellIterationScheme
Definition: LinkedCellsContainer.h:54
int nX
Definition: LinkedCellsContainer.h:72
int nY
Definition: LinkedCellsContainer.h:76
int baseY
Definition: LinkedCellsContainer.h:84
std::array< std::vector< int >, 6 > & getBoundaries()
Definition: LinkedCellsContainer.h:450
int baseZ
Definition: LinkedCellsContainer.h:88
double cellSizeY
Definition: LinkedCellsContainer.h:106
double getRCutOff() const
Definition: LinkedCellsContainer.h:482
LennardJonesForce lJF
Definition: LinkedCellsContainer.h:127
double cellSizeX
Definition: LinkedCellsContainer.h:102
Definition: ParticleContainer.h:11
Definition: Particle.h:16
Class corresponding to the boundaries schema type.
Definition: ConfigurationFile.h:11189
Definition: VTKWriter.h:23
Class corresponding to the rCutOff schema type.
Definition: ConfigurationFile.h:6444
Definition: enumsStructs.h:9
Side
Definition: enumsStructs.h:13
Definition: enumsStructs.h:38