Interaction: public mirheo::MirSimulationObject¶
Compute forces from particle interactions.
We distinguish two kinds of interactions (see Stage enum type):
- Intermediate ones, that do not compute any force, but compute intermediate quantities (e.g. densities in SDPD).
- Final ones, that compute forces (and possibly other quantities, e.g. stresses).
Subclassed by mirheo::BaseMembraneInteraction, mirheo::BasePairwiseInteraction, mirheo::BaseRodInteraction, mirheo::ChainInteraction, mirheo::ObjectBindingInteraction, mirheo::ObjectRodBindingInteraction
Used to specify if a channel is active or not.
If a channel is inactive, the Interaction object can tell the simulation via this function object that the concerned channel does not need to be exchanged.
Typically, this can store the simulation state and be active only at given time intervals. The most common case is to be always active.
Interaction(const MirState *state, std::string name)¶
state: The global state of the system
name: The name of the interaction
setPrerequisites(ParticleVector *pv1, ParticleVector *pv2, CellList *cl1, CellList *cl2)¶
Add needed properties to the given ParticleVectors for future interactions.
Must be called before any other method of this class.
local(ParticleVector *pv1, ParticleVector *pv2, CellList *cl1, CellList *cl2, cudaStream_t stream) = 0¶
Compute interactions between bulk particles.
The result of the interaction isadded to the corresponding channel of the ParticleVector. The order of pv1 and pv2 may change the performance of the interactions.
halo(ParticleVector *pv1, ParticleVector *pv2, CellList *cl1, CellList *cl2, cudaStream_t stream) = 0¶
Compute interactions between bulk particles and halo particles.
The result of the interaction isadded to the corresponding channel of the ParticleVector. In general, the following interactions will be computed: pv1->halo() <> pv2->local() and pv2->halo() <> pv1->local().
This is useful to know if we need exchange / cell-lists for that interaction. Example: membrane interactions are internal, all particles of a membrane are always on the same rank thus it does not need halo particles.
- boolean describing if the interaction is an internal interaction.
Returns which channels are required as input.
Positions and velocities are always required and are not listed here; Only other channels must be specified here.
Returns which channels are those output by the interactions.
- the cut-off radius of the interaction; std::nullopt if there is no cutoff.
A simple structure used to describe which channels are active.