1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Hadrons: env function to get volume in double

This commit is contained in:
Antonin Portelli 2018-05-28 11:39:17 +02:00
parent 255d4992e1
commit e3164d4c7b
2 changed files with 7 additions and 8 deletions

View File

@ -49,11 +49,10 @@ Environment::Environment(void)
dim_, GridDefaultSimd(nd_, vComplex::Nsimd()),
GridDefaultMpi()));
gridRb4d_.reset(SpaceTimeGrid::makeFourDimRedBlackGrid(grid4d_.get()));
auto loc = getGrid()->LocalDimensions();
locVol_ = 1;
for (unsigned int d = 0; d < loc.size(); ++d)
vol_ = 1.;
for (auto d: dim_)
{
locVol_ *= loc[d];
vol_ *= d;
}
rng4d_.reset(new GridParallelRNG(grid4d_.get()));
}
@ -190,9 +189,9 @@ int Environment::getDim(const unsigned int mu) const
return dim_[mu];
}
unsigned long int Environment::getLocalVolume(void) const
double Environment::getVolume(void) const
{
return locVol_;
return vol_;
}
// random number generator /////////////////////////////////////////////////////

View File

@ -94,8 +94,8 @@ public:
const unsigned int Ls = 1) const;
std::vector<int> getDim(void) const;
int getDim(const unsigned int mu) const;
unsigned long int getLocalVolume(void) const;
unsigned int getNd(void) const;
double getVolume(void) const;
// random number generator
void setSeed(const std::vector<int> &seed);
GridParallelRNG * get4dRng(void) const;
@ -155,7 +155,7 @@ public:
void printContent(void) const;
private:
// general
unsigned long int locVol_;
double vol_;
bool protect_{true};
// grids
std::vector<int> dim_;