]> git.treefish.org Git - phys/heatbath.git/commitdiff
Setup o815 skeleton.
authorAlexander Schmidt <alex@treefish.org>
Wed, 13 Nov 2013 09:51:43 +0000 (10:51 +0100)
committerAlexander Schmidt <alex@treefish.org>
Wed, 13 Nov 2013 09:51:43 +0000 (10:51 +0100)
CMakeLists.txt
heatbath.cc [deleted file]
heatbath.cpp [new file with mode: 0644]
latlib
sim.hpp [new file with mode: 0644]

index 3417d67c7464dcef8c14b8a274d1112130ec66f4..bedfec9e0bfb21906179b9a6263865f46d9fef54 100644 (file)
@@ -11,6 +11,6 @@ SET(CMAKE_BUILD_TYPE Release)
 
 add_subdirectory(latlib)
 
-add_executable(heatbath heatbath.cc)
+add_executable(heatbath heatbath.cpp)
 #set_target_properties(phi4iso-local PROPERTIES COMPILE_DEFINITIONS "LOCAL_UPDATE_ALGORITHM")
-target_link_libraries(heatbath o815)
+target_link_libraries(heatbath o815 gsl gslcblas lat_neigh)
diff --git a/heatbath.cc b/heatbath.cc
deleted file mode 100644 (file)
index 086f367..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-int main (int argc, char *argv[])
-{
-
-  return 0;
-}
diff --git a/heatbath.cpp b/heatbath.cpp
new file mode 100644 (file)
index 0000000..70e2140
--- /dev/null
@@ -0,0 +1,46 @@
+#include "latlib/o815/o815.h"
+
+#include "sim.hpp"
+
+o815 *O815;
+sim *Sim;
+
+o815::comoption specOps[] = {
+  { "mass", required_argument, NULL, 'm', "set mass", "min:max:inc" },
+  { "", 0, NULL, 0, "", "" }
+};
+
+void parseSpecOps() 
+{
+  for (int isopt = 0; isopt < O815->parsedSpecOps.size(); isopt++)
+    switch(O815->parsedSpecOps[isopt].first) {
+    case 'm':
+      O815->paraQ->addRange("mass", O815->parsedSpecOps[isopt].second);
+      break;
+    }
+}
+
+void helpHeader() 
+{
+  cout << "Usage: ./heatbath [OPTIONS] [obs1] ... [obsN]" << endl << endl;
+}
+
+int main (int argc, char *argv[])
+{
+  O815 = new o815(argc, argv, "heatbath", specOps, &helpHeader);
+
+  O815->addPara("mass", 1);
+
+  parseSpecOps();
+
+  O815->postParaInit();
+
+  O815->Sim = new sim(O815);
+
+  //parseLonelyArgs();
+
+  O815->mainLoop();
+
+  delete O815;
+  return 0;
+}
diff --git a/latlib b/latlib
index 2918744d037d9254538dd84311aa346576e0fe04..a2b065a04a23009d81caab4ce169497b042b352b 160000 (submodule)
--- a/latlib
+++ b/latlib
@@ -1 +1 @@
-Subproject commit 2918744d037d9254538dd84311aa346576e0fe04
+Subproject commit a2b065a04a23009d81caab4ce169497b042b352b
diff --git a/sim.hpp b/sim.hpp
new file mode 100644 (file)
index 0000000..e58c70d
--- /dev/null
+++ b/sim.hpp
@@ -0,0 +1,46 @@
+#ifndef SIM_HPP
+#define SIM_HPP
+
+#include <gsl/gsl_rng.h>
+
+#include "latlib/neigh.h"
+
+class sim : public o815::sim {
+public:
+  struct siteconf {
+    int k[2][4];
+    int l[2][4];
+  };
+  sim(o815 *_O815);
+  siteconf* conf;
+  int LSIZE4;
+
+private:
+  void _makeSweep();
+  void _newParas();
+
+  gsl_rng* rangsl;
+
+  neigh *nb;
+};
+
+sim::sim(o815 *_O815) : o815::sim( _O815, 
+                                  sizeof(siteconf)*
+                                  (_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) {
+  conf = (siteconf*)confMem;
+  LSIZE4 = _O815->comargs.lsize[0] * _O815->comargs.lsize[0] * _O815->comargs.lsize[0] * _O815->comargs.lsize[1];
+
+  rangsl = gsl_rng_alloc(gsl_rng_ranlxs0);
+  gsl_rng_set(rangsl, time(NULL));
+
+  nb = new neigh(4, _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[0], _O815->comargs.lsize[1]);
+}
+
+void sim::_makeSweep() {  
+}
+
+void sim::_newParas() {
+  /* reset variables */
+}
+
+#endif