Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F113422996
compute_interaction.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 18, 00:25
Size
555 B
Mime Type
text/x-c
Expires
Tue, May 20, 00:25 (2 d)
Engine
blob
Format
Raw Data
Handle
26242092
Attached To
R7571 SP4E-TB-TL-FR
compute_interaction.cc
View Options
#include "compute_interaction.hh"
#include <cmath>
/* -------------------------------------------------------------------------- */
void ComputeInteraction::compute(System& system) {
UInt size = system.getNbParticles();
// first of all reset forces to zero
for (auto & particle : system)
particle.getForce() = 0;
for (UInt p1 = 0; p1 < size; ++p1) {
Particle& par1 = system.getParticle(p1);
for (UInt p2 = p1 + 1; p2 < size; ++p2) {
Particle& par2 = system.getParticle(p2);
computePairInteraction(par1, par2);
}
}
}
Event Timeline
Log In to Comment