Molecular Dynamics Simulation  1.0
OutflowBoundaryType.cpp
Go to the documentation of this file.
1 #include "OutflowBoundaryType.h"
2 
3 #include "io/logger/Logger.h"
5 #include "utils/ArrayUtils.h"
6 
9  for (Cell* cell : container.left_halo_cell_references) {
10  for (Particle* p : cell->getParticleReferences()) {
11  container.particles.erase(container.particles.begin() + (p - &container.particles[0]));
12  }
13  }
14  }
15 
17  for (Cell* cell : container.right_halo_cell_references) {
18  for (Particle* p : cell->getParticleReferences()) {
19  container.particles.erase(container.particles.begin() + (p - &container.particles[0]));
20  }
21  }
22  }
23 
25  for (Cell* cell : container.bottom_halo_cell_references) {
26  for (Particle* p : cell->getParticleReferences()) {
27  container.particles.erase(container.particles.begin() + (p - &container.particles[0]));
28  }
29  }
30  }
31 
33  for (Cell* cell : container.top_halo_cell_references) {
34  for (Particle* p : cell->getParticleReferences()) {
35  container.particles.erase(container.particles.begin() + (p - &container.particles[0]));
36  }
37  }
38  }
39 
41  for (Cell* cell : container.back_halo_cell_references) {
42  for (Particle* p : cell->getParticleReferences()) {
43  container.particles.erase(container.particles.begin() + (p - &container.particles[0]));
44  }
45  }
46  }
47 
49  for (Cell* cell : container.front_halo_cell_references) {
50  for (Particle* p : cell->getParticleReferences()) {
51  container.particles.erase(container.particles.begin() + (p - &container.particles[0]));
52  }
53  }
54  }
55 }
56 
Class representing a cell in the linked cells algorithm.
Definition: Cell.h:12
std::vector< Particle * > & getParticleReferences()
Get the reference vector for the particles the cell contains.
Definition: Cell.cpp:7
Extension of the ParticleContainer class using a linked cells data structure for improved performance...
std::vector< Cell * > right_halo_cell_references
References to the halo cells on the right (x = domain_num_cells[0])
std::vector< Cell * > front_halo_cell_references
References to the halo cells on the front (z = domain_num_cells[2])
std::vector< Cell * > bottom_halo_cell_references
References to the halo cells on the bottom (y = -1)
std::vector< Cell * > left_halo_cell_references
References to the halo cells on the left (x = -1)
std::vector< Cell * > top_halo_cell_references
References to the halo cells on the top (y = domain_num_cells[1])
std::vector< Cell * > back_halo_cell_references
References to the halo cells on the back (z = -1)
std::array< BoundaryCondition, 6 > boundary_types
The boundary types for each side of the domain (order in array: left, right, bottom,...
std::vector< Particle > particles
Internal data structure for the particles.
static void applyBoundaryConditions(LinkedCellsContainer &container)
Applies the boundary conditions for the outflow boundary condition.
static void pre(LinkedCellsContainer &container)
Applies the preconditioning step for the outflow boundary condition.
Class to represent a particle.
Definition: Particle.h:26