1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-17 15:27:06 +01:00

_grid becomes private ; use Grid()§

This commit is contained in:
paboyle
2018-01-27 00:04:12 +00:00
parent 3f9654e397
commit c4f82e072b
116 changed files with 731 additions and 728 deletions

View File

@ -65,8 +65,8 @@ public:
virtual void deriv(const Field &p,
Field &force) {
Field tmp(p._grid);
Field p2(p._grid);
Field tmp(p.Grid());
Field p2(p.Grid());
ScalarObs<Impl>::phisquared(p2, p);
tmp = -(Cshift(p, 0, -1) + Cshift(p, 0, 1));
for (int mu = 1; mu < Nd; mu++) tmp -= Cshift(p, mu, -1) + Cshift(p, mu, 1);

View File

@ -48,7 +48,7 @@ public:
static void MomentumSpacePropagator(Field &out, RealD m)
{
GridBase *grid = out._grid;
GridBase *grid = out.Grid();
Field kmu(grid), one(grid);
const unsigned int nd = grid->_ndimension;
std::vector<int> &l = grid->_fdimensions;
@ -69,8 +69,8 @@ public:
static void FreePropagator(const Field &in, Field &out,
const Field &momKernel)
{
FFT fft((GridCartesian *)in._grid);
Field inFT(in._grid);
FFT fft((GridCartesian *)in.Grid());
Field inFT(in.Grid());
fft.FFT_all_dim(inFT, in, FFT::forward);
inFT = inFT*momKernel;
@ -79,7 +79,7 @@ public:
static void FreePropagator(const Field &in, Field &out, RealD m)
{
Field momKernel(in._grid);
Field momKernel(in.Grid());
MomentumSpacePropagator(momKernel, m);
FreePropagator(in, out, momKernel);

View File

@ -74,15 +74,15 @@ public:
virtual void refresh(const Field &U, GridParallelRNG &pRNG) {}
virtual RealD S(const Field &p) {
assert(p._grid->Nd() == Ndim);
static Stencil phiStencil(p._grid, npoint, 0, directions, displacements);
assert(p.Grid()->Nd() == Ndim);
static Stencil phiStencil(p.Grid(), npoint, 0, directions, displacements);
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;
action = (2.0*Ndim + mass_square)*phisquared - lambda/24.*phisquared*phisquared;
for (int mu = 0; mu < Ndim; mu++) {
// 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++) {
int permute_type;
StencilEntry *SE;
vobj temp2;
@ -110,15 +110,15 @@ public:
};
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 - lambda/12.*p*p*p;
// 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);
//for (int mu = 0; mu < Nd; mu++) force -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
for (int point = 0; point < npoint; point++) {
parallel_for (int i = 0; i < p._grid->oSites(); i++) {
parallel_for (int i = 0; i < p.Grid()->oSites(); i++) {
const vobj *temp;
vobj temp2;
int permute_type;