-
Notifications
You must be signed in to change notification settings - Fork 12
Interactor
Interactor is one of the base modules of UAMMD[1]. See Interactor.cuh
An Interactor has access to the system state and computes something according to it.
This something can be the force, energy or some arbitrary computation according to some kind of interaction.
If you are looking to set up some interaction look in the list of available Interactors to see if it already exists.
The Interactor interface exposes the following functions:
-
void sumForce(cudaStream_t st);
- Computes the forces on each particle according to the interaction
-
void sumEnergy();
- Computes the energy for each particle according to the interaction
-
void sumForceEnergy(cudaStream_t st);
- Computes both forces and energies at the same time
-
void compute(cudaStream_t st);
- Performs an arbitrary user-defined computation following the interactions rules, see the wiki page of a given module to know how to use the compute function.
After calling sumForce, sumEnergy, etc, on a given Interactor the relevant particle properties will be updated and can be accesed via ParticleData[5].
The CUDA stream argument can be ignored and the default stream used instead. However, launching GPU kernels in a different stream to the one provided can be dangerous if some particle property is modified. In that case there is no guarantee that no other Interactor is also modifying that property and a race condition might occur.
This is just a base class that cannot be used by its own. Childs of this class are instanced and added to an integrator to configure a simulation. See the wiki page of a particular Interactor or usage instructions.
In order to create a new Interactor module, just write a class that inherits from it and overrides its virtual functions. You will then have access to all its members, and will be able to use it as an Interactor. See PairForces[4] for an example of an Interactor.
An Interactor is expected to write to the pd->getForce()
array when sumForce is called. Always adding to the previous contents.
Similarly sumEnergy must sum to pd->getEnergy().
See [5] on how to access particle properties through ParticleData.
[1] https://github.com/RaulPPelaez/UAMMD/wiki/Base-Modules
[2] https://github.com/RaulPPelaez/UAMMD/wiki/Simulation-File
[3] https://en.wikipedia.org/wiki/Smart_pointer#shared_ptr_and_weak_ptr
[4] https://github.com/RaulPPelaez/UAMMD/wiki/Pair-Forces
[5] https://github.com/RaulPPelaez/UAMMD/wiki/ParticleData
-
-
1. PairForces
2. NbodyForces
3. ExternalForces
4. BondedForces
5. AngularBondedForces
6. TorsionalBondedForces
7. Poisson (Electrostatics) -
-
MD (Molecular Dynamics)
1. VerletNVT
2. VerletNVE - BD Brownian Dynamics
-
BDHI Brownian Dynamics with Hydrodynamic Interactions
1. EulerMaruyama
1.1 BDHI_Cholesky Brownian displacements through Cholesky factorization.
1.2 BDHI_Lanczos Brownian displacements through Lanczos algorithm.
1.3 BDHI_PSE Positively Split Edwald.
1.4 BDHI_FCM Force Coupling Method. - DPD Dissipative Particle Dynamics
- SPH Smoothed Particle Hydrodynamics
-
Hydrodynamics
1. ICM Inertial Coupling Method.
2. FIB Fluctuating Immerse Boundary.
3. Quasi2D Quasi2D hydrodynamics
-
MD (Molecular Dynamics)
-
- 1. Neighbour Lists
-
1. Programming Tools
2. Utils
-
1. Transverser
2. Functor
3. Potential
-
1. Particle Data
2. Particle Group
3. System
4. Parameter updatable
-
1. Tabulated Function
2. Postprocessing tools
3. InputFile
4. Tests
5. Allocator
6. Temporary memory
7. Immersed Boundary (IBM)
-
1. NBody
2. Neighbour Lists
3. Python wrappers
- 1. Superpunto