1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-14 17:55:38 +00:00

Debugging shGordon, works

This commit is contained in:
Guido Cossu 2018-01-19 09:52:45 +00:00
parent 422dbc80cd
commit f61c241c18
3 changed files with 14 additions and 7 deletions

View File

@ -29,9 +29,9 @@ class ScalarImplTypes {
static inline Field projectForce(Field& P){return P;} static inline Field projectForce(Field& P){return P;}
static inline void update_field(Field& P, Field& U, double ep) { static inline void update_field(Field& P, Field& U, double ep) {
std::cout << GridLogDebug << "P:\n" << P << std::endl; //std::cout << GridLogDebug << "P:\n" << P << std::endl;
U += P*ep; U += P*ep;
std::cout << GridLogDebug << "U:\n" << U << std::endl; //std::cout << GridLogDebug << "U:\n" << U << std::endl;
} }
static inline RealD FieldSquareNorm(Field& U) { static inline RealD FieldSquareNorm(Field& U) {
@ -39,15 +39,17 @@ class ScalarImplTypes {
} }
static inline void HotConfiguration(GridParallelRNG &pRNG, Field &U) { static inline void HotConfiguration(GridParallelRNG &pRNG, Field &U) {
gaussian(pRNG, U); random(pRNG, U);
} }
static inline void TepidConfiguration(GridParallelRNG &pRNG, Field &U) { static inline void TepidConfiguration(GridParallelRNG &pRNG, Field &U) {
gaussian(pRNG, U); random(pRNG, U);
U *= 0.01;
} }
static inline void ColdConfiguration(GridParallelRNG &pRNG, Field &U) { static inline void ColdConfiguration(GridParallelRNG &pRNG, Field &U) {
U = 1.0; U = 0.0;
//std::cout << GridLogDebug << "Initial U:\n" << U << std::endl;
} }
static void MomentumSpacePropagator(Field &out, RealD m) static void MomentumSpacePropagator(Field &out, RealD m)

View File

@ -60,12 +60,16 @@ class shGordonAction : public QCD::Action<typename Impl::Field> {
virtual void deriv(const Field &phi, virtual void deriv(const Field &phi,
Field &force) { Field &force) {
//std::cout << GridLogDebug << "Force total before :\n" << force << std::endl;
Field tmp(phi._grid); Field tmp(phi._grid);
tmp = 2.0*QCD::Nd*phi; tmp = 2.0*QCD::Nd*phi;
for (int mu = 0; mu < QCD::Nd; mu++) tmp -= Cshift(phi, mu, 1) + Cshift(phi, mu, -1); for (int mu = 0; mu < QCD::Nd; mu++) tmp -= Cshift(phi, mu, 1) + Cshift(phi, mu, -1);
std::cout << GridLogDebug << "Phi norm : " << norm2(phi) << std::endl;
force+= tmp + 0.5*mass_square/g*(exp(g*phi) - exp(-g*phi)); //std::cout << GridLogDebug << "Phi norm : " << norm2(phi) << std::endl;
force += tmp + 0.5*mass_square/g*(exp(g*phi) - exp(-g*phi));
//std::cout << GridLogDebug << "Force tmp :\n" << tmp << std::endl;
//std::cout << GridLogDebug << "Force total after :\n" << force << std::endl;
} }
}; };

View File

@ -116,6 +116,7 @@ class Integrator {
for (int a = 0; a < as[level].actions.size(); ++a) { for (int a = 0; a < as[level].actions.size(); ++a) {
Field force(U._grid); Field force(U._grid);
force = zero;
conformable(U._grid, Mom._grid); conformable(U._grid, Mom._grid);
Field& Us = Smearer.get_U(as[level].actions.at(a)->is_smeared); Field& Us = Smearer.get_U(as[level].actions.at(a)->is_smeared);
as[level].actions.at(a)->deriv(Us, force); // deriv should NOT include Ta as[level].actions.at(a)->deriv(Us, force); // deriv should NOT include Ta