]> git.treefish.org Git - phys/heatbath.git/blob - sim.hpp
Added observable phi2.
[phys/heatbath.git] / sim.hpp
1 #ifndef SIM_HPP
2 #define SIM_HPP
3
4 #include <gsl/gsl_rng.h>
5 #include <complex>
6
7 #include "latlib/neigh.h"
8
9 class sim : public o815::sim {
10 public:
11   struct siteconf {
12     complex<double> phi;
13   };
14   sim(o815 *_O815);
15   siteconf* conf;
16   int LSIZE4;
17
18 private:
19   void _makeSweep();
20   void _newParas();
21
22   gsl_rng* rangsl;
23
24   neigh *nb;
25 };
26
27 sim::sim(o815 *_O815) : o815::sim( _O815, 
28                                    sizeof(siteconf)*
29                                    (_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) {
30   conf = (siteconf*)confMem;
31   LSIZE4 = _O815->comargs.lsize[0] * _O815->comargs.lsize[0] * _O815->comargs.lsize[0] * _O815->comargs.lsize[1];
32
33   rangsl = gsl_rng_alloc(gsl_rng_ranlxs0);
34   gsl_rng_set(rangsl, time(NULL));
35
36   nb = new neigh(4, _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[1]);
37 }
38
39 void sim::_makeSweep() {  
40 }
41
42 void sim::_newParas() {
43   /* reset variables */
44 }
45
46 #endif