From b1d3d1f1a97310e1643d83e1f12778a51e966444 Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Tue, 5 Mar 2019 16:16:30 +0000 Subject: [PATCH 1/3] add gauge transformation matrix as output to module MGauge/GaugeFix --- Hadrons/Modules/MGauge/GaugeFix.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Hadrons/Modules/MGauge/GaugeFix.hpp b/Hadrons/Modules/MGauge/GaugeFix.hpp index 87822a7e..6c1b40e6 100644 --- a/Hadrons/Modules/MGauge/GaugeFix.hpp +++ b/Hadrons/Modules/MGauge/GaugeFix.hpp @@ -94,7 +94,7 @@ std::vector TGaugeFix::getInput(void) template std::vector TGaugeFix::getOutput(void) { - std::vector out = {getName()}; + std::vector out = {getName(), getName()+"_xform"}; return out; } @@ -103,6 +103,7 @@ template void TGaugeFix::setup(void) { envCreateLat(GaugeField, getName()); + envCreateLat(LatticeColourMatrix, getName()+"_xform"); } @@ -116,6 +117,7 @@ void TGaugeFix::execute(void) LOG(Message) << par().gauge << std::endl; auto &U = envGet(GaugeField, par().gauge); auto &Umu = envGet(GaugeField, getName()); + auto &xform = envGet(LatticeColourMatrix, getName()+"_xform"); LOG(Message) << "Gauge Field fetched" << std::endl; //do we allow maxiter etc to be user set? Real alpha = par().alpha; @@ -123,7 +125,7 @@ void TGaugeFix::execute(void) Real Omega_tol = par().Omega_tol; Real Phi_tol = par().Phi_tol; bool Fourier = par().Fourier; - FourierAcceleratedGaugeFixer::SteepestDescentGaugeFix(U,alpha,maxiter,Omega_tol,Phi_tol,Fourier); + FourierAcceleratedGaugeFixer::SteepestDescentGaugeFix(U,xform,alpha,maxiter,Omega_tol,Phi_tol,Fourier); Umu = U; LOG(Message) << "Gauge Fixed" << std::endl; } From 63001d3fa6c10d630a312dd05b4a606a75ae93a0 Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Fri, 15 Mar 2019 13:04:00 +0000 Subject: [PATCH 2/3] fix bug: MGauge::GaugeFix should not modify its input --- Hadrons/Modules/MGauge/GaugeFix.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hadrons/Modules/MGauge/GaugeFix.hpp b/Hadrons/Modules/MGauge/GaugeFix.hpp index 6c1b40e6..c74cded5 100644 --- a/Hadrons/Modules/MGauge/GaugeFix.hpp +++ b/Hadrons/Modules/MGauge/GaugeFix.hpp @@ -125,8 +125,8 @@ void TGaugeFix::execute(void) Real Omega_tol = par().Omega_tol; Real Phi_tol = par().Phi_tol; bool Fourier = par().Fourier; - FourierAcceleratedGaugeFixer::SteepestDescentGaugeFix(U,xform,alpha,maxiter,Omega_tol,Phi_tol,Fourier); Umu = U; + FourierAcceleratedGaugeFixer::SteepestDescentGaugeFix(Umu,xform,alpha,maxiter,Omega_tol,Phi_tol,Fourier); LOG(Message) << "Gauge Fixed" << std::endl; } From 72f959c0b81c9aaaf378a107060508a36d8ba64c Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Fri, 15 Mar 2019 13:13:13 +0000 Subject: [PATCH 3/3] MGauge::GaugeFix use standard convention for fields --- Hadrons/Modules/MGauge/GaugeFix.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Hadrons/Modules/MGauge/GaugeFix.hpp b/Hadrons/Modules/MGauge/GaugeFix.hpp index c74cded5..57b1e082 100644 --- a/Hadrons/Modules/MGauge/GaugeFix.hpp +++ b/Hadrons/Modules/MGauge/GaugeFix.hpp @@ -7,6 +7,7 @@ Source file: Hadrons/Modules/MGauge/GaugeFix.hpp Copyright (C) 2015-2019 Author: Antonin Portelli +Author: Nils Asmussen Author: Peter Boyle This program is free software; you can redistribute it and/or modify @@ -58,6 +59,7 @@ class TGaugeFix: public Module { public: GAUGE_TYPE_ALIASES(GImpl,); + typedef typename GImpl::GaugeLinkField GaugeMat; public: // constructor TGaugeFix(const std::string name); @@ -103,7 +105,7 @@ template void TGaugeFix::setup(void) { envCreateLat(GaugeField, getName()); - envCreateLat(LatticeColourMatrix, getName()+"_xform"); + envCreateLat(GaugeMat, getName()+"_xform"); } @@ -117,7 +119,7 @@ void TGaugeFix::execute(void) LOG(Message) << par().gauge << std::endl; auto &U = envGet(GaugeField, par().gauge); auto &Umu = envGet(GaugeField, getName()); - auto &xform = envGet(LatticeColourMatrix, getName()+"_xform"); + auto &xform = envGet(GaugeMat, getName()+"_xform"); LOG(Message) << "Gauge Field fetched" << std::endl; //do we allow maxiter etc to be user set? Real alpha = par().alpha;