15 if (p->isLocked())
continue;
16 double distance = p->getX()[0];
25 if (p->isLocked())
continue;
26 double distance = container.
domain_size[0] - p->getX()[0];
35 if (p->isLocked())
continue;
36 double distance = p->getX()[1];
45 if (p->isLocked())
continue;
46 double distance = container.
domain_size[1] - p->getX()[1];
55 if (p->isLocked())
continue;
56 double distance = p->getX()[2];
65 if (p->isLocked())
continue;
66 double distance = container.
domain_size[2] - p->getX()[2];
77 if (2 * distance >= std::pow(2, 1.0 / 6) * p.
getSigma()) {
82 ghost_particle.
setX(p.
getX() - std::array<double, 3>{2 * distance, 0, 0});
84 auto force_vector_left_side = force.
calculateForce(p, ghost_particle);
88 return force_vector_left_side;
90 return {-force_vector_left_side[0], 0, 0};
92 return {0, force_vector_left_side[0], 0};
94 return {0, -force_vector_left_side[0], 0};
96 return {0, 0, force_vector_left_side[0]};
98 return {0, 0, -force_vector_left_side[0]};
Class representing a cell in the linked cells algorithm.
std::vector< Particle * > & getParticleReferences()
Get the reference vector for the particles the cell contains.
Class to calculate the Lennard-Jones force between particles. Implements the interface PairwiseForceS...
std::array< double, 3UL > calculateForce(const Particle &p, const Particle &q) const override
Calculates the Lennard-Jones forces between two particles.
Extension of the ParticleContainer class using a linked cells data structure for improved performance...
std::vector< Cell * > bottom_boundary_cell_references
References to the boundary cells on the bottom (y = 0)
BoundarySide
Boundary side enum for labeling the sides of the domain.
std::vector< Cell * > top_boundary_cell_references
References to the boundary cells on the top (y = domain_num_cells[1]-1)
std::array< double, 3 > domain_size
Domain size in each dimension.
std::vector< Cell * > right_boundary_cell_references
References to the boundary cells on the right (x = domain_num_cells[0]-1)
std::vector< Cell * > left_boundary_cell_references
References to the boundary cells on the left (x = 0)
std::vector< Cell * > back_boundary_cell_references
References to the boundary cells on the back (z = 0)
std::vector< Cell * > front_boundary_cell_references
References to the boundary cells on the front (z = domain_num_cells[2]-1)
std::array< BoundaryCondition, 6 > boundary_types
The boundary types for each side of the domain (order in array: left, right, bottom,...
static std::shared_ptr< spdlog::logger > logger
Publically accessible shared pointer to the logger.
Class to represent a particle.
double getSigma() const
Gets the Lennard-Jones potential parameter sigma.
const std::array< double, 3 > & getX() const
Gets the position of the particle.
void setX(const std::array< double, 3 > &x)
Sets the position of the particle.
static void applyBoundaryConditions(LinkedCellsContainer &container)
Applies the boundary conditions for the reflective boundary condition.
static void pre(LinkedCellsContainer &container)
Applies the preconditioning step for the reflective boundary condition.
static std::array< double, 3 > calculateReflectiveBoundaryForce(Particle &p, double distance, LinkedCellsContainer::BoundarySide side)
Calculates the force of the reflective boundary for the given particle.