Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90784481
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
Mon, Nov 4, 17:47
Size
555 B
Mime Type
text/x-c
Expires
Wed, Nov 6, 17:47 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22134307
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