+ public void doinit(int mdsize) {
+ for(int j=0;j<3;j++) {
+ double[] sh=sh_force[j];
+ for (int i=0;i<mdsize;i++) {
+ sh[i] = 0.0;
+ }
+ }
+ }
+
+
+ public void doinit2(int mdsize) {
+ for(int k=0;k<3;k++) {
+ double[] sh=sh_force[k];
+ double [][] sha=sh_force2[k];
+ for(int j=0;j<nthreads;j++) {
+ double[] sha2=sha[j];
+ for(int i=0;i<mdsize;i++) {
+ sh[i] += sha2[i];
+ }
+ }
+ }
+
+ for(int k=0;k<3;k++) {
+ double [][] sh1=sh_force2[k];
+ for(int j=0;j<nthreads;j++) {
+ double[] sh2=sh1[j];
+ for(int i=0;i<mdsize;i++) {
+
+
+ sh2[i] = 0.0;
+ }
+ }
+ }
+
+ for(int j=1;j<nthreads;j++) {
+ mymd.epot[0].d += mymd.epot[j].d;
+ mymd.vir[0].d += mymd.vir[j].d;
+ }
+ for(int j=1;j<nthreads;j++) {
+ mymd.epot[j].d = mymd.epot[0].d;
+ mymd.vir[j].d = mymd.vir[0].d;
+ }
+ for(int j=0;j<nthreads;j++) {
+ mymd.interactions += mymd.interacts[j].i;
+ }
+
+ for (int j=0;j<3;j++) {
+ double sh[]=sh_force[j];
+ for (int i=0;i<mdsize;i++) {
+ sh[i] = sh[i] * hsq2;
+ }
+ }
+}
+