28 {
29 int n;
30 double forceSumxAtomType1, forceSumxAtomType2, forceSumxAtomType3, forceSumxAtomType4, forceSumxAtomType5;
31 double forceSumyAtomType1, forceSumyAtomType2, forceSumyAtomType3, forceSumyAtomType4, forceSumyAtomType5;
32
33 forceSumxAtomType1 = 0.0; forceSumyAtomType1 = 0.0;
34 forceSumxAtomType2 = 0.0; forceSumyAtomType2 = 0.0;
35 forceSumxAtomType3 = 0.0; forceSumyAtomType3 = 0.0;
36 forceSumxAtomType4 = 0.0; forceSumyAtomType4 = 0.0;
37 forceSumxAtomType5 = 0.0; forceSumyAtomType5 = 0.0;
38
39
40 for(n = 1; n <=
nAtom; n++){
42 forceSumxAtomType1 +=
fx[n];
43 forceSumyAtomType1 +=
fy[n];
45 forceSumxAtomType2 +=
fx[n];
46 forceSumyAtomType2 +=
fy[n];
48 forceSumxAtomType3 +=
fx[n];
49 forceSumyAtomType3 +=
fy[n];
51 forceSumxAtomType4 +=
fx[n];
52 forceSumyAtomType4 +=
fy[n];
54 forceSumxAtomType5 +=
fx[n];
55 forceSumyAtomType5 +=
fy[n];
56 }
57 }
58
59 fprintf(
fpforce,
"%0.4lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16f\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16f\t%0.16f\n",
timeNow,
60 forceSumxAtomType1, forceSumyAtomType1,
61 forceSumxAtomType2, forceSumyAtomType2,
62 forceSumxAtomType3, forceSumyAtomType3,
63 forceSumxAtomType4, forceSumyAtomType4,
64 forceSumxAtomType5, forceSumyAtomType5,
67 }