mpacts.boundaryconditions. periodicboundary1D

In order to be able to use this module import it like this:

import mpacts.boundaryconditions.periodicboundary1D
#or assign it to a shorter name
import mpacts.boundaryconditions.periodicboundary1D as pd

PeriodicBoundary1D

class mpacts.boundaryconditions.periodicboundary1D.PeriodicBoundary1D(name, parent, pc, point1, point2, boundary_width, add_arrays)

Bases: mpacts.boundaryconditions.ghostpc.GhostParticleManager

Constructs a GhostParticleManager, and adds the required commands to the simulation so that this ghostparticlemanager will behave as a periodicboundary. Required Arguments: parent = Parent object (must contain a simulation object somewhere above it) pc = The particle container that will be used as a “model” for the ghostpc p1 = A point on the boundary between ghost and real particles p2 = A second point defining from where the real particles are translated back to p1

p1 and p2 together define two planes with a normal (p2 -p1) going through p1 and p2 respectively

boundary_width = the width of over which real particles are duplicated into ghost particles. add_arrays = List of strings containing the names of the arrays that will be added to the real

pc with the values of the ghost. (Usually at least F is transferred)

1 2 3 4 + + + | * * * * * * * | * * * p1-width p1 p2-width p2

  • = real particle
  • = ghost particle from this array
PeriodicBoundary1D(name, parent, **kwargs)
add_commands()

Previous: 1) All ghost particles to the left of 1 have to be deleted 2) All ghost particles right of 2 have to be deleted 3) All real particles to the right of 3 have to added as ghost 4) real particles to the right of 4 have to be translated. 5) real particles to the left of 2 have to be translated.

Now: 1) real particles to the right of 4 have to be translated. 2) real particles to the left of 2 have to be translated. 3) All real particles to the right of 3 have to added as ghost. 4) Copy all data from real to ghost. 5) translate all ghost particles 6) All ghost particles to the left of 1 have to be deleted 7) All ghost particles right of 2 have to be deleted 8) set value of F and M to zero of the ghost pc 9) add data of requested arrays from ghost to real arrays

remove_commands()