This example shows how to simulate bulk silicon with an applied background electric field and with using the Fast Multipole Method (FMM) to include the particle-particle interactions.
This simulation performs the same simulation as the bulkSimulation Example (see associated README), the only difference is that here the particle-particle interactions are considered (with the help of the FMM).
With this example it is possible to add multiple moving or non-moving particle types to the simulation and see the effect that they have on each other.
Considering the particle-particle interaction in this case just means that the force
Here
In this calculation
This sum that is needed for each particle is calculated using the Fast Multipole Method (with the library scalFMM).
Periodic Boundary Conditions in scalFMM
See Doc Page of scalFMM: Periodicity in scalFMM.
The previously mentioned page states that periodicity in scalFMM is not the usual periodicity, it's just that the simulation box (which has to be cubic and includes all the particles) is repeated for a specific number of times in each direction. The calculated potential and force at each particle in the original box then consists of the interactions with every other particle in the original box and with every particle in the repeated (copied + translated) boxes.
The number of times that the box is repeated is determined with the parameter periodicityParam which can be in (-1, 0, 1, 2, 3,...). In the following table the relation between periodicityParam and the number of boxes that are repeated in each direction nrBoxesDir and the total number of boxes that are considered in the simulation nrBoxesTotal is shown:
periodicityParam | nrBoxesDir | nrBoxesTotal |
---|---|---|
-1 | 3 | 27 |
0 | 6 | 216 |
1 | 12 | 1728 |
2 | 24 | 13824 |
3 | 48 | 110592 |
The implementation of this can be seen here: scalFMM/include/Core/FFMMAlgorithmPeriodic.hpp
How periodicityParam (in this example called idxLevelAbove) effects the particle potential can be seen in the following example: scalFMM/Tests/Kernels/testRotationPeriodicBench.cpp
It is also possible to use a cut-off radius for the electric field of the particle-particle interaction, to avoid numerical heating if particles are "too close" to each other. In this case the formula for the particle interaction between two particles
Most of the customizable simulation parameter are the same as in the bulkSimulation Example.
In this simulation one can also add more than one particleType and see the effect of the different particle-types on each other (see emcDonor in example).
Furthermore one can also decide if the cutoff radius approach should be used or not, this can be set by either commenting line 9 (macro #define USE_CUTOFF_KERNEL) out or not.
As already mentioned in previous section with periodicityParam the handling of the periodic boundary conditions in scalFMM can be altered.
The simulation is the same as the one in bulkSimulation Example. The only difference is that for the calculation of the particle-particle interaction some additional functions have to be called in each round:
-
executeFMM: calculates the
$E^{pp}$ (the electric field that stems from the particle interactions) - resetForcesAndPotential: resets the calculated electric field
- rearrangeTree: the particles are stored in an octree, this function makes sure that each particle is in the right leaf of the octree after the particles were moved.
Same as bulkSimulation see README.
- scalFMM Library: The library that is used for the particle interaction calculations. In the following some of the used classes and some helpful tests that were useful for a better understanding are linked:
- Kernel:
- include/Kernels/Rotation/RotationKernel.hpp: Rotation Kernel of scalFMM using spherical harmonics.
- Periodic Boundary Conditions:
- Periodicity under scalFMM: Doc Page where periodicity in scalFMM is shortly described
- Tests/Kernels/testRotationPeriodicBench.cpp: Test of scalFMM library that shows how to use the rotation kernel with periodic boundary conditions.
- Tests/Utils/testFMMAlgorithmPeriodic.cpp: Test of scalFMM library that gives better insight on how periodicity in scalFMM works.
- Kernel: