Molecular Dynamics Simulation  1.0
Static Public Member Functions | List of all members
OutflowBoundaryType Class Reference

#include <OutflowBoundaryType.h>

Collaboration diagram for OutflowBoundaryType:
Collaboration graph

Static Public Member Functions

static void pre (LinkedCellsContainer &container)
 Applies the preconditioning step for the outflow boundary condition. More...
 
static void applyBoundaryConditions (LinkedCellsContainer &container)
 Applies the boundary conditions for the outflow boundary condition. More...
 

Detailed Description

Definition at line 7 of file OutflowBoundaryType.h.

Member Function Documentation

◆ applyBoundaryConditions()

void OutflowBoundaryType::applyBoundaryConditions ( LinkedCellsContainer container)
static

Applies the boundary conditions for the outflow boundary condition.

Parameters
containerThe container to apply the boundary conditions to.

This method is empty, as the outflow boundary condition does not require any special treatment.

Definition at line 57 of file OutflowBoundaryType.cpp.

57 {}

◆ pre()

void OutflowBoundaryType::pre ( LinkedCellsContainer container)
static

Applies the preconditioning step for the outflow boundary condition.

Parameters
containerThe container to apply the boundary conditions to.

This method removes all particles from the container that are in halo cells with the outflow boundary condition.

Definition at line 7 of file OutflowBoundaryType.cpp.

7  {
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 }
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
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.
Class to represent a particle.
Definition: Particle.h:26

The documentation for this class was generated from the following files: