本文整理汇总了C++中Updater::simulate方法的典型用法代码示例。如果您正苦于以下问题:C++ Updater::simulate方法的具体用法?C++ Updater::simulate怎么用?C++ Updater::simulate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Updater
的用法示例。
在下文中一共展示了Updater::simulate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
array1.push_back(r1);
array2.push_back(r2);
cout << mid <<" "<< mid2 << endl;
}
a += r1;
b += r2;
c += fi;
}
aver1 /= N;
aver2 /= N;
for(unsigned int w=0; w<array1.size(); w++) {
s1 += (aver1 - array1[w])*(aver1 - array1[w]);
s2 += (aver2 - array2[w])*(aver2 - array2[w]);
}
s1 /= N; s1 = sqrt(s1);
s2 /= N; s2 = sqrt(s2);
cout << "N= " << N << endl;
cout << "r1="<< aver1 << ", s1= " << s1 << ", r2= " << aver2 << ", s2= " << s2 << endl;
cout << "H= " << 1/aver1 - 1/aver2 << ", s= " << s1*s1/(aver1*aver1) + s2*s2/(aver2*aver2) << endl;
cout << "K= " << 1/aver1 * 1/aver2 * (-1.0) << ", s= " << 1/(aver1*aver2) * (s1*s1/aver1 + s2*s2/aver2) << endl;
fclose (infile);
exit(1);*/
/********************************************************/
/* EQUILIBRATION */
/********************************************************/
if (sim.nequil) {
printf("\nStart equilibration...\n");
updater->simulate(sim.nequil/2, sim.adjust, 0, 0);
updater->simulate(sim.nequil/2, 0, 0, 0);
sim.printEqStat();
cout << "Further equilibration of configuration: " << sim.nequil/2 << " sweeps" << endl;
outfile = fopen("config.eq", "w");
fprintf (outfile, "%15.8e %15.8e %15.8e\n", conf.geo.box.x, conf.geo.box.y, conf.geo.box.z);
conf.draw(outfile);
fclose (outfile);
printf (" Equilibrated configuration written to config.eq\n");
printf (" Box dimensions: %.10f, %.10f, %.10f\n\n", conf.geo.box.x, conf.geo.box.y, conf.geo.box.z);
}
/********************************************************/
/* PRODUCTION RUN */
/********************************************************/
cout << "Production run: "<< sim.nsweeps << " sweeps\n" << endl;
updater->simulate(sim.nsweeps, 0, sim.paramfrq, sim.report);
#ifdef ENABLE_MPI
printf (" MPI replica changeT / changeP / acceptance ratio: \t %.6f / %.6f / %.6f\n\n", sim.mpiexch.mx,sim.mpiexch.angle,RATIO(sim.mpiexch));
#endif
outfile = fopen(files.configurationoutfile, "w");
#ifdef TESTING
fprintf (outfile, "%15.6e %15.6e %15.6e\n", conf.geo.box.x, conf.geo.box.y, conf.geo.box.z);
#else
fprintf (outfile, "%15.8e %15.8e %15.8e\n", conf.geo.box.x, conf.geo.box.y, conf.geo.box.z);