1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

Hadrons: random vector utility module I/O

This commit is contained in:
Antonin Portelli 2019-02-10 21:25:25 +00:00
parent f80c548365
commit 7672bb6434

View File

@ -31,6 +31,7 @@ See the full license in the file "LICENSE" in the top level distribution directo
#include <Hadrons/Global.hpp> #include <Hadrons/Global.hpp>
#include <Hadrons/Module.hpp> #include <Hadrons/Module.hpp>
#include <Hadrons/ModuleFactory.hpp> #include <Hadrons/ModuleFactory.hpp>
#include <Hadrons/A2AVectors.hpp>
BEGIN_HADRONS_NAMESPACE BEGIN_HADRONS_NAMESPACE
@ -44,7 +45,9 @@ class RandomVectorsPar: Serializable
public: public:
GRID_SERIALIZABLE_CLASS_MEMBERS(RandomVectorsPar, GRID_SERIALIZABLE_CLASS_MEMBERS(RandomVectorsPar,
unsigned int, size, unsigned int, size,
unsigned int, Ls); unsigned int, Ls,
std::string, output,
bool, multiFile);
}; };
template <typename Field> template <typename Field>
@ -119,6 +122,11 @@ void TRandomVectors<Field>::execute(void)
{ {
random(rng4d(), vec[i]); random(rng4d(), vec[i]);
} }
// I/O if necessary
if (!par().output.empty())
{
A2AVectorsIo::write(par().output, vec, par().multiFile, vm().getTrajectory());
}
} }
END_MODULE_NAMESPACE END_MODULE_NAMESPACE