From: Alexander Schmidt Date: Thu, 28 Nov 2013 08:23:55 +0000 (+0100) Subject: Added 0 algorithms. X-Git-Url: http://git.treefish.org/~alex/phys/heatbath.git/commitdiff_plain/42525a1e9b53ed082fbacce84caf8cff6b4219bc?ds=sidebyside Added 0 algorithms. --- diff --git a/.gitignore b/.gitignore index 8e57972..50f1688 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ heatbath-AhbMor heatbath-AorMor heatbath-AorMhb heatbath-metro +heatbath-A0Mhb +heatbath-A0Mor +heatbath-AhbM0 +heatbath-AorM0 diff --git a/CMakeLists.txt b/CMakeLists.txt index d631271..c07148c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,3 +35,19 @@ target_link_libraries(heatbath-AorMhb o815 gsl gslcblas lat_neigh) add_executable(heatbath-AorMor heatbath.cpp) set_target_properties(heatbath-AorMor PROPERTIES COMPILE_DEFINITIONS "ALGORITHM_AORMOR") target_link_libraries(heatbath-AorMor o815 gsl gslcblas lat_neigh) + +add_executable(heatbath-AorM0 heatbath.cpp) +set_target_properties(heatbath-AorM0 PROPERTIES COMPILE_DEFINITIONS "ALGORITHM_AORM0") +target_link_libraries(heatbath-AorM0 o815 gsl gslcblas lat_neigh) + +add_executable(heatbath-AhbM0 heatbath.cpp) +set_target_properties(heatbath-AhbM0 PROPERTIES COMPILE_DEFINITIONS "ALGORITHM_AHBM0") +target_link_libraries(heatbath-AhbM0 o815 gsl gslcblas lat_neigh) + +add_executable(heatbath-A0Mor heatbath.cpp) +set_target_properties(heatbath-A0Mor PROPERTIES COMPILE_DEFINITIONS "ALGORITHM_A0MOR") +target_link_libraries(heatbath-A0Mor o815 gsl gslcblas lat_neigh) + +add_executable(heatbath-A0Mhb heatbath.cpp) +set_target_properties(heatbath-A0Mhb PROPERTIES COMPILE_DEFINITIONS "ALGORITHM_A0MHB") +target_link_libraries(heatbath-A0Mhb o815 gsl gslcblas lat_neigh) diff --git a/heatbath.cpp b/heatbath.cpp index 9744b33..8464a05 100644 --- a/heatbath.cpp +++ b/heatbath.cpp @@ -17,6 +17,18 @@ #elif ALGORITHM_AORMOR #include "sim-nonmetro.hpp" #define ALGORITHM "AorMor" +#elif ALGORITHM_AORM0 +#include "sim-nonmetro.hpp" +#define ALGORITHM "AorM0" +#elif ALGORITHM_AHBM0 +#include "sim-nonmetro.hpp" +#define ALGORITHM "AhbM0" +#elif ALGORITHM_A0MOR +#include "sim-nonmetro.hpp" +#define ALGORITHM "A0Mor" +#elif ALGORITHM_A0MHB +#include "sim-nonmetro.hpp" +#define ALGORITHM "A0Mhb" #else #error NO UPDATE-ALGORITHM DEFINED! #endif diff --git a/sim-nonmetro.hpp b/sim-nonmetro.hpp index 9eb818b..064a7bb 100644 --- a/sim-nonmetro.hpp +++ b/sim-nonmetro.hpp @@ -53,18 +53,18 @@ void sim::updatePhi (const int& x) for (int nu=0; nu<4; nu++) V += conf[ (*nb)[x*4+nu] ].phi; -#if defined(ALGORITHM_AHBMHB) || defined(ALGORITHM_AHBMOR) +#if defined(ALGORITHM_AHBMHB) || defined(ALGORITHM_AHBMOR) || defined(ALGORITHM_AHBM0) Y = polar( abs(Y), gsl_rng_uniform(rangsl) * 2*M_PI ); -#elif defined(ALGORITHM_AORMHB) || defined(ALGORITHM_AORMOR) +#elif defined(ALGORITHM_AORMHB) || defined(ALGORITHM_AORMOR) || defined(ALGORITHM_AORM0) const double V2diff = pow(real(V), 2) - pow(imag(V), 2); const double Vprod = real(V)*imag(V); Y = complex ( + real(Y) * V2diff + 2 * imag(Y) * Vprod, - imag(Y) * V2diff + 2 * real(Y) * Vprod ) / norm(V); #endif -#if defined(ALGORITHM_AHBMHB) || defined(ALGORITHM_AORMHB) +#if defined(ALGORITHM_AHBMHB) || defined(ALGORITHM_AORMHB) || defined(ALGORITHM_A0MHB) Y = polar( magnYOfR( gsl_rng_uniform(rangsl) ), arg(Y) ); -#elif defined(ALGORITHM_AHBMOR) || defined(ALGORITHM_AORMOR) +#elif defined(ALGORITHM_AHBMOR) || defined(ALGORITHM_AORMOR) || defined(ALGORITHM_A0MOR) Y = polar( magnYOfR( 1 - exp(-norm(Y)) ), arg(Y) ); //!!!! #endif }