From 5fdc05782b4578b21ba66421ec58753c32ec9350 Mon Sep 17 00:00:00 2001 From: Guido Cossu Date: Mon, 27 Mar 2017 10:54:16 +0900 Subject: [PATCH] More in the clover fermion class --- lib/qcd/action/fermion/WilsonCloverFermion.h | 81 +++++++++----------- lib/qcd/action/fermion/WilsonFermion.h | 4 +- 2 files changed, 40 insertions(+), 45 deletions(-) diff --git a/lib/qcd/action/fermion/WilsonCloverFermion.h b/lib/qcd/action/fermion/WilsonCloverFermion.h index 5901cb2f..41131e5d 100644 --- a/lib/qcd/action/fermion/WilsonCloverFermion.h +++ b/lib/qcd/action/fermion/WilsonCloverFermion.h @@ -1,12 +1,13 @@ - /************************************************************************************* +/************************************************************************************* - Grid physics library, www.github.com/paboyle/Grid + Grid physics library, www.github.com/paboyle/Grid Source file: ./lib/qcd/action/fermion/WilsonTMFermion.h - Copyright (C) 2015 + Copyright (C) 2017 Author: paboyle +Author: Guido Cossu This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,53 +25,47 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ - /* END LEGAL */ -#ifndef GRID_QCD_WILSON_TM_FERMION_H -#define GRID_QCD_WILSON_TM_FERMION_H +/* END LEGAL */ +#ifndef GRID_QCD_WILSON_CLOVER_FERMION_H +#define GRID_QCD_WILSON_CLOVER_FERMION_H #include namespace Grid { +namespace QCD { - namespace QCD { +template +class WilsonCloverFermion : public WilsonFermion { +public: + INHERIT_IMPL_TYPES(Impl); - template - class WilsonTMFermion : public WilsonFermion - { - public: - INHERIT_IMPL_TYPES(Impl); - public: +public: + virtual void Instantiatable(void){}; + // Constructors + WilsonCloverFermion(GaugeField &_Umu, GridCartesian &Fgrid, + GridRedBlackCartesian &Hgrid, + RealD _mass, + RealD _csw, + const ImplParams &p = ImplParams()) : WilsonFermion(_Umu, + Fgrid, + Hgrid, + _mass, p) + { + csw = _csw; + } - virtual void Instantiatable(void) {}; - // Constructors - WilsonTMFermion(GaugeField &_Umu, - GridCartesian &Fgrid, - GridRedBlackCartesian &Hgrid, - RealD _mass, - RealD _mu, - const ImplParams &p= ImplParams() - ) : - WilsonFermion(_Umu, - Fgrid, - Hgrid, - _mass,p) + virtual RealD M(const FermionField& in, FermionField& out); + virtual RealD Mdag(const FermionField& in, FermionField& out); - { - mu = _mu; - } + virtual void Mooee(const FermionField &in, FermionField &out); + virtual void MooeeDag(const FermionField &in, FermionField &out); + virtual void MooeeInv(const FermionField &in, FermionField &out); + virtual void MooeeInvDag(const FermionField &in, FermionField &out); +private: + RealD csw; // Clover coefficient +}; +} +} - // allow override for twisted mass and clover - virtual void Mooee(const FermionField &in, FermionField &out) ; - virtual void MooeeDag(const FermionField &in, FermionField &out) ; - virtual void MooeeInv(const FermionField &in, FermionField &out) ; - virtual void MooeeInvDag(const FermionField &in, FermionField &out) ; - - private: - RealD mu; // TwistedMass parameter - - }; - -}} - -#endif +#endif // GRID_QCD_WILSON_CLOVER_FERMION_H diff --git a/lib/qcd/action/fermion/WilsonFermion.h b/lib/qcd/action/fermion/WilsonFermion.h index 933be732..50f4f884 100644 --- a/lib/qcd/action/fermion/WilsonFermion.h +++ b/lib/qcd/action/fermion/WilsonFermion.h @@ -65,8 +65,8 @@ class WilsonFermion : public WilsonKernels, public WilsonFermionStatic { // override multiply; cut number routines if pass dagger argument // and also make interface more uniformly consistent ////////////////////////////////////////////////////////////////// - RealD M(const FermionField &in, FermionField &out); - RealD Mdag(const FermionField &in, FermionField &out); + virtual RealD M(const FermionField &in, FermionField &out); + virtual RealD Mdag(const FermionField &in, FermionField &out); ///////////////////////////////////////////////////////// // half checkerboard operations