4 #include <gsl/gsl_rng.h>
8 #include "latlib/neigh.h"
10 class sim : public o815::sim {
24 void updatePhi (const int& x);
30 sim::sim(o815 *_O815) : o815::sim( _O815,
32 (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) {
33 conf = (siteconf*)confMem;
35 rangsl = gsl_rng_alloc(gsl_rng_ranlxs0);
36 gsl_rng_set(rangsl, time(NULL));
38 LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1];
40 nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]);
43 void sim::updatePhi (const int& x)
45 const double r = gsl_rng_uniform(rangsl);
46 const double theta = gsl_rng_uniform(rangsl) * 2*M_PI;
49 for (int nu=0; nu<4; nu++)
50 V += conf[ (*nb)[x*4+nu] ].phi;
52 conf[x].phi = sqrt(std::log( 1./(1-r) )) / sqrt(M)
53 * complex<double>( cos(theta), sin(theta) )
57 void sim::_makeSweep() {
58 for (int ix=0; ix<LSIZE2; ix++)
62 void sim::_newParas() {
63 M = pow( (*O815->paraQ)["mass"], 2 ) + 4;
64 *log << "SIM: Resetting fields." << endl << flush;
65 memset(conf, 0, sizeof(siteconf)*LSIZE2);