SBInteractionModelParticleSystem#

This class describes a particle system interaction model in SAMSON. A particle system interaction model has one buffer - a force buffer which may be used to write adaptive simulation algorithms.

You can get a number of changed forces and a force of a particle in the particle system interaction model:

print(particleSystemInteractionModel.numberOfChangedForces)
print(particleSystemInteractionModel.getForce(i))

You can get the index of i-th changed force. Assume for example that particle 17, 32, and 529 have had their forces changed since the last flush of the force buffer. Then the following code:

for i in range(particleSystemInteractionModel.numberOfChangedForces):
        # changedForceIndex is the index of the i-th changed force
        changedForceIndex = particleSystemInteractionModel.getChangedForceIndex(i)
        print(changedForceIndex)

This will result in the following output:

17
32
529

You can use these indices in adaptive simulation algorithms for example together with samson.SBInteractionModelParticleSystem.

See also

SAMSON SDK: SBMInteractionModelParticleSystem

class samson.SBInteractionModelParticleSystem#

Bases: SBInteractionModel

This class is the base class of particle interaction models.

getForce(self: samson.SBInteractionModelParticleSystem, i: int) samson.SBPhysicalVector3#

Returns the force applied to particle i

getParticleSystem(self: samson.SBInteractionModelParticleSystem) samson.SBParticleSystem#

Returns the particle system