From: Alexander Schmidt Date: Thu, 14 Nov 2013 19:05:04 +0000 (+0100) Subject: Made algorithm names more meaningful. X-Git-Url: http://git.treefish.org/~alex/phys/heatbath.git/commitdiff_plain/7a2a209a8e67d342eb4faa2fa203a94fb68d5e6c Made algorithm names more meaningful. --- diff --git a/.gitignore b/.gitignore index abf17c1..356965e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,9 @@ *~ -heatbath cmake_install.cmake Makefile CMakeCache.txt CMakeFiles data -heatbath-heatless -heatbath-relaxedheat -heatbath-usualheat +heatbath-nor +heatbath-1mr +heatbath-r diff --git a/CMakeLists.txt b/CMakeLists.txt index c90e8c9..1840155 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,14 +11,14 @@ SET(CMAKE_BUILD_TYPE Release) add_subdirectory(latlib) -add_executable(heatbath-heatless heatbath.cpp) -set_target_properties(heatbath-heatless PROPERTIES COMPILE_DEFINITIONS "HEATLESS_ALGORITHM") -target_link_libraries(heatbath-heatless o815 gsl gslcblas lat_neigh) +add_executable(heatbath-nor heatbath.cpp) +set_target_properties(heatbath-nor PROPERTIES COMPILE_DEFINITIONS "ALGORITHM_NOR") +target_link_libraries(heatbath-nor o815 gsl gslcblas lat_neigh) -add_executable(heatbath-usualheat heatbath.cpp) -set_target_properties(heatbath-usualheat PROPERTIES COMPILE_DEFINITIONS "USUALHEAT_ALGORITHM") -target_link_libraries(heatbath-usualheat o815 gsl gslcblas lat_neigh) +add_executable(heatbath-r heatbath.cpp) +set_target_properties(heatbath-r PROPERTIES COMPILE_DEFINITIONS "ALGORITHM_R") +target_link_libraries(heatbath-r o815 gsl gslcblas lat_neigh) -add_executable(heatbath-relaxedheat heatbath.cpp) -set_target_properties(heatbath-relaxedheat PROPERTIES COMPILE_DEFINITIONS "RELAXEDHEAT_ALGORITHM") -target_link_libraries(heatbath-relaxedheat o815 gsl gslcblas lat_neigh) +add_executable(heatbath-1mr heatbath.cpp) +set_target_properties(heatbath-1mr PROPERTIES COMPILE_DEFINITIONS "ALGORITHM_1MR") +target_link_libraries(heatbath-1mr o815 gsl gslcblas lat_neigh) diff --git a/heatbath.cpp b/heatbath.cpp index e6a7803..dbfe63a 100644 --- a/heatbath.cpp +++ b/heatbath.cpp @@ -2,15 +2,15 @@ #include "latlib/o815/o815.h" -#ifdef HEATLESS_ALGORITHM -#define ALGORITHM "heatless" -#include "sim-heatless.hpp" -#elif USUALHEAT_ALGORITHM -#define ALGORITHM "usualheat" -#include "sim-usualheat.hpp" -#elif RELAXEDHEAT_ALGORITHM -#define ALGORITHM "relaxedheat" -#include "sim-relaxedheat.hpp" +#ifdef ALGORITHM_NOR +#define ALGORITHM "nor" +#include "sim-nor.hpp" +#elif ALGORITHM_R +#define ALGORITHM "r" +#include "sim-r.hpp" +#elif ALGORITHM_1MR +#define ALGORITHM "1mr" +#include "sim-1mr.hpp" #else #error NO UPDATE-ALGORITHM DEFINED! #endif diff --git a/sim-1mr.hpp b/sim-1mr.hpp new file mode 100644 index 0000000..aa305ff --- /dev/null +++ b/sim-1mr.hpp @@ -0,0 +1,58 @@ +#ifndef SIM_HPP +#define SIM_HPP + +#include +#include +#include + +#include "latlib/neigh.h" + +class sim : public o815::sim { +public: + struct siteconf { + complex phi; + }; + sim(o815 *_O815); + siteconf* conf; + unsigned int LSIZE2; + +private: + void _makeSweep(); + void _newParas(); + + gsl_rng* rangsl; + + neigh *nb; + + void updatePhi (const int& x); +}; + + + +sim::sim(o815 *_O815) : o815::sim( _O815, + sizeof(siteconf)* + (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) { + conf = (siteconf*)confMem; + + rangsl = gsl_rng_alloc(gsl_rng_ranlxs0); + gsl_rng_set(rangsl, time(NULL)); + + LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1]; + + nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]); +} + +void sim::updatePhi (const int& x) +{ + const double r = gsl_rng_uniform(rangsl); + const double theta = gsl_rng_uniform(rangsl) * 2*M_PI; +} + +void sim::_makeSweep() { +} + +void sim::_newParas() { + /* reset variables */ +} + +#endif diff --git a/sim-heatless.hpp b/sim-heatless.hpp deleted file mode 100644 index aa305ff..0000000 --- a/sim-heatless.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef SIM_HPP -#define SIM_HPP - -#include -#include -#include - -#include "latlib/neigh.h" - -class sim : public o815::sim { -public: - struct siteconf { - complex phi; - }; - sim(o815 *_O815); - siteconf* conf; - unsigned int LSIZE2; - -private: - void _makeSweep(); - void _newParas(); - - gsl_rng* rangsl; - - neigh *nb; - - void updatePhi (const int& x); -}; - - - -sim::sim(o815 *_O815) : o815::sim( _O815, - sizeof(siteconf)* - (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) { - conf = (siteconf*)confMem; - - rangsl = gsl_rng_alloc(gsl_rng_ranlxs0); - gsl_rng_set(rangsl, time(NULL)); - - LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1]; - - nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]); -} - -void sim::updatePhi (const int& x) -{ - const double r = gsl_rng_uniform(rangsl); - const double theta = gsl_rng_uniform(rangsl) * 2*M_PI; -} - -void sim::_makeSweep() { -} - -void sim::_newParas() { - /* reset variables */ -} - -#endif diff --git a/sim-nor.hpp b/sim-nor.hpp new file mode 100644 index 0000000..aa305ff --- /dev/null +++ b/sim-nor.hpp @@ -0,0 +1,58 @@ +#ifndef SIM_HPP +#define SIM_HPP + +#include +#include +#include + +#include "latlib/neigh.h" + +class sim : public o815::sim { +public: + struct siteconf { + complex phi; + }; + sim(o815 *_O815); + siteconf* conf; + unsigned int LSIZE2; + +private: + void _makeSweep(); + void _newParas(); + + gsl_rng* rangsl; + + neigh *nb; + + void updatePhi (const int& x); +}; + + + +sim::sim(o815 *_O815) : o815::sim( _O815, + sizeof(siteconf)* + (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) { + conf = (siteconf*)confMem; + + rangsl = gsl_rng_alloc(gsl_rng_ranlxs0); + gsl_rng_set(rangsl, time(NULL)); + + LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1]; + + nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]); +} + +void sim::updatePhi (const int& x) +{ + const double r = gsl_rng_uniform(rangsl); + const double theta = gsl_rng_uniform(rangsl) * 2*M_PI; +} + +void sim::_makeSweep() { +} + +void sim::_newParas() { + /* reset variables */ +} + +#endif diff --git a/sim-r.hpp b/sim-r.hpp new file mode 100644 index 0000000..aa305ff --- /dev/null +++ b/sim-r.hpp @@ -0,0 +1,58 @@ +#ifndef SIM_HPP +#define SIM_HPP + +#include +#include +#include + +#include "latlib/neigh.h" + +class sim : public o815::sim { +public: + struct siteconf { + complex phi; + }; + sim(o815 *_O815); + siteconf* conf; + unsigned int LSIZE2; + +private: + void _makeSweep(); + void _newParas(); + + gsl_rng* rangsl; + + neigh *nb; + + void updatePhi (const int& x); +}; + + + +sim::sim(o815 *_O815) : o815::sim( _O815, + sizeof(siteconf)* + (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) { + conf = (siteconf*)confMem; + + rangsl = gsl_rng_alloc(gsl_rng_ranlxs0); + gsl_rng_set(rangsl, time(NULL)); + + LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1]; + + nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]); +} + +void sim::updatePhi (const int& x) +{ + const double r = gsl_rng_uniform(rangsl); + const double theta = gsl_rng_uniform(rangsl) * 2*M_PI; +} + +void sim::_makeSweep() { +} + +void sim::_newParas() { + /* reset variables */ +} + +#endif diff --git a/sim-relaxedheat.hpp b/sim-relaxedheat.hpp deleted file mode 100644 index aa305ff..0000000 --- a/sim-relaxedheat.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef SIM_HPP -#define SIM_HPP - -#include -#include -#include - -#include "latlib/neigh.h" - -class sim : public o815::sim { -public: - struct siteconf { - complex phi; - }; - sim(o815 *_O815); - siteconf* conf; - unsigned int LSIZE2; - -private: - void _makeSweep(); - void _newParas(); - - gsl_rng* rangsl; - - neigh *nb; - - void updatePhi (const int& x); -}; - - - -sim::sim(o815 *_O815) : o815::sim( _O815, - sizeof(siteconf)* - (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) { - conf = (siteconf*)confMem; - - rangsl = gsl_rng_alloc(gsl_rng_ranlxs0); - gsl_rng_set(rangsl, time(NULL)); - - LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1]; - - nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]); -} - -void sim::updatePhi (const int& x) -{ - const double r = gsl_rng_uniform(rangsl); - const double theta = gsl_rng_uniform(rangsl) * 2*M_PI; -} - -void sim::_makeSweep() { -} - -void sim::_newParas() { - /* reset variables */ -} - -#endif diff --git a/sim-usualheat.hpp b/sim-usualheat.hpp deleted file mode 100644 index aa305ff..0000000 --- a/sim-usualheat.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef SIM_HPP -#define SIM_HPP - -#include -#include -#include - -#include "latlib/neigh.h" - -class sim : public o815::sim { -public: - struct siteconf { - complex phi; - }; - sim(o815 *_O815); - siteconf* conf; - unsigned int LSIZE2; - -private: - void _makeSweep(); - void _newParas(); - - gsl_rng* rangsl; - - neigh *nb; - - void updatePhi (const int& x); -}; - - - -sim::sim(o815 *_O815) : o815::sim( _O815, - sizeof(siteconf)* - (_O815->comargs.lsize[0]*_O815->comargs.lsize[1]) ) { - conf = (siteconf*)confMem; - - rangsl = gsl_rng_alloc(gsl_rng_ranlxs0); - gsl_rng_set(rangsl, time(NULL)); - - LSIZE2 = _O815->comargs.lsize[0] * _O815->comargs.lsize[1]; - - nb = new neigh(2, _O815->comargs.lsize[0], _O815->comargs.lsize[1]); -} - -void sim::updatePhi (const int& x) -{ - const double r = gsl_rng_uniform(rangsl); - const double theta = gsl_rng_uniform(rangsl) * 2*M_PI; -} - -void sim::_makeSweep() { -} - -void sim::_newParas() { - /* reset variables */ -} - -#endif