mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-14 01:35:36 +00:00
scalar: lambda/4! convention
This commit is contained in:
parent
0af740dc15
commit
7d7220cbd7
@ -81,7 +81,7 @@ namespace Grid {
|
|||||||
phiStencil.HaloExchange(p, compressor);
|
phiStencil.HaloExchange(p, compressor);
|
||||||
Field action(p._grid), pshift(p._grid), phisquared(p._grid);
|
Field action(p._grid), pshift(p._grid), phisquared(p._grid);
|
||||||
phisquared = p*p;
|
phisquared = p*p;
|
||||||
action = (2.0*Ndim + mass_square)*phisquared + lambda*phisquared*phisquared;
|
action = (2.0*Ndim + mass_square)*phisquared + lambda/24.*phisquared*phisquared;
|
||||||
for (int mu = 0; mu < Ndim; mu++) {
|
for (int mu = 0; mu < Ndim; mu++) {
|
||||||
// pshift = Cshift(p, mu, +1); // not efficient, implement with stencils
|
// pshift = Cshift(p, mu, +1); // not efficient, implement with stencils
|
||||||
parallel_for (int i = 0; i < p._grid->oSites(); i++) {
|
parallel_for (int i = 0; i < p._grid->oSites(); i++) {
|
||||||
@ -113,7 +113,7 @@ namespace Grid {
|
|||||||
|
|
||||||
virtual void deriv(const Field &p, Field &force) {
|
virtual void deriv(const Field &p, Field &force) {
|
||||||
assert(p._grid->Nd() == Ndim);
|
assert(p._grid->Nd() == Ndim);
|
||||||
force = (2.0*Ndim + mass_square)*p + 2.0*lambda*p*p*p;
|
force = (2.0*Ndim + mass_square)*p + lambda/12.*p*p*p;
|
||||||
// move this outside
|
// move this outside
|
||||||
static Stencil phiStencil(p._grid, npoint, 0, directions, displacements);
|
static Stencil phiStencil(p._grid, npoint, 0, directions, displacements);
|
||||||
phiStencil.HaloExchange(p, compressor);
|
phiStencil.HaloExchange(p, compressor);
|
||||||
|
@ -45,7 +45,7 @@ using namespace Grid;
|
|||||||
using namespace Grid::QCD;
|
using namespace Grid::QCD;
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
class MagLogger : public HmcObservable<typename Impl::Field> {
|
class MagMeas : public HmcObservable<typename Impl::Field> {
|
||||||
public:
|
public:
|
||||||
typedef typename Impl::Field Field;
|
typedef typename Impl::Field Field;
|
||||||
typedef typename Impl::Simd::scalar_type Trace;
|
typedef typename Impl::Simd::scalar_type Trace;
|
||||||
@ -72,13 +72,13 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
class MagMod: public ObservableModule<MagLogger<Impl>, NoParameters>{
|
class MagMod: public ObservableModule<MagMeas<Impl>, NoParameters>{
|
||||||
typedef ObservableModule<MagLogger<Impl>, NoParameters> ObsBase;
|
typedef ObservableModule<MagMeas<Impl>, NoParameters> ObsBase;
|
||||||
using ObsBase::ObsBase; // for constructors
|
using ObsBase::ObsBase; // for constructors
|
||||||
|
|
||||||
// acquire resource
|
// acquire resource
|
||||||
virtual void initialize(){
|
virtual void initialize(){
|
||||||
this->ObservablePtr.reset(new MagLogger<Impl>());
|
this->ObservablePtr.reset(new MagMeas<Impl>());
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
MagMod(): ObsBase(NoParameters()){}
|
MagMod(): ObsBase(NoParameters()){}
|
||||||
|
Loading…
Reference in New Issue
Block a user