Grid 0.7.0
plaquette.h
Go to the documentation of this file.
1/*************************************************************************************
2
3Grid physics library, www.github.com/paboyle/Grid
4
5Source file: ./lib/qcd/modules/plaquette.h
6
7Copyright (C) 2017
8
9Author: Guido Cossu <guido.cossu@ed.ac.uk>
10
11This program is free software; you can redistribute it and/or modify
12it under the terms of the GNU General Public License as published by
13the Free Software Foundation; either version 2 of the License, or
14(at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along
22with this program; if not, write to the Free Software Foundation, Inc.,
2351 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25See the full license in the file "LICENSE" in the top level distribution
26directory
27*************************************************************************************/
28 /* END LEGAL */
29
30#pragma once
31
33
34// this is only defined for a gauge theory
35template <class Impl>
36class PlaquetteLogger : public HmcObservable<typename Impl::Field> {
37public:
38 // here forces the Impl to be of gauge fields
39 // if not the compiler will complain
41
42 // necessary for HmcObservable compatibility
43 typedef typename Impl::Field Field;
44
45 virtual void TrajectoryComplete(int traj,
46 ConfigurationBase<Field> &SmartConfig,
47 GridSerialRNG &sRNG,
48 GridParallelRNG &pRNG)
49 {
50 std::cout << GridLogMessage << "+++++++++++++++++++"<<std::endl;
51 std::cout << GridLogMessage << "Unsmeared plaquette"<<std::endl;
52 TrajectoryComplete(traj,SmartConfig.get_U(false),sRNG,pRNG); // Unsmeared observable
53 std::cout << GridLogMessage << "Smeared plaquette"<<std::endl;
54 TrajectoryComplete(traj,SmartConfig.get_U(true),sRNG,pRNG); // Unsmeared observable
55 std::cout << GridLogMessage << "+++++++++++++++++++"<<std::endl;
56 };
57 void TrajectoryComplete(int traj,
58 Field &U,
59 GridSerialRNG &sRNG,
60 GridParallelRNG &pRNG) {
61
63
64 int def_prec = std::cout.precision();
65
66 std::cout << GridLogMessage
67 << std::setprecision(std::numeric_limits<Real>::digits10 + 1)
68 << "Plaquette: [ " << traj << " ] "<< plaq << std::endl;
69
70 std::cout.precision(def_prec);
71
72 }
73};
74
76
77
GridLogger GridLogMessage(1, "Message", GridLogColours, "NORMAL")
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
double RealD
Definition Simd.h:61
static INTERNAL_PRECISION U
Definition Zolotarev.cc:230
Base class for "smart configuration", a container for a gauge configuration holding unsmeared and sme...
Definition ActionBase.h:51
virtual Field & get_U(bool smeared=false)=0
virtual void TrajectoryComplete(int traj, ConfigurationBase< Field > &SmartConfig, GridSerialRNG &sRNG, GridParallelRNG &pRNG)
Definition plaquette.h:45
INHERIT_GIMPL_TYPES(Impl)
Impl::Field Field
Definition plaquette.h:43
void TrajectoryComplete(int traj, Field &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG)
Definition plaquette.h:57
static RealD avgPlaquette(const GaugeLorentz &Umu)