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