2016-12-15 18:26:39 +00:00
|
|
|
/*************************************************************************************
|
|
|
|
|
2016-05-04 01:07:00 +01:00
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
2016-12-15 18:26:39 +00:00
|
|
|
Source file: extras/Hadrons/Modules/MGauge/Random.cc
|
2016-05-04 01:07:00 +01:00
|
|
|
|
2017-12-26 13:16:47 +00:00
|
|
|
Copyright (C) 2015-2018
|
2016-05-04 01:07:00 +01:00
|
|
|
|
|
|
|
Author: Antonin Portelli <antonin.portelli@me.com>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
2016-12-15 18:26:39 +00:00
|
|
|
See the full license in the file "LICENSE" in the top level distribution directory
|
|
|
|
*************************************************************************************/
|
2016-12-15 18:21:52 +00:00
|
|
|
/* END LEGAL */
|
2016-05-04 01:07:00 +01:00
|
|
|
|
2016-12-05 04:53:31 +00:00
|
|
|
#include <Grid/Hadrons/Modules/MGauge/Random.hpp>
|
2016-05-04 01:07:00 +01:00
|
|
|
|
|
|
|
using namespace Grid;
|
|
|
|
using namespace Hadrons;
|
2016-12-05 04:53:31 +00:00
|
|
|
using namespace MGauge;
|
2016-05-04 01:07:00 +01:00
|
|
|
|
|
|
|
/******************************************************************************
|
2016-12-14 17:59:45 +00:00
|
|
|
* TRandom implementation *
|
2016-05-04 01:07:00 +01:00
|
|
|
******************************************************************************/
|
|
|
|
// constructor /////////////////////////////////////////////////////////////////
|
2016-12-14 17:59:45 +00:00
|
|
|
TRandom::TRandom(const std::string name)
|
2016-05-12 11:59:28 +01:00
|
|
|
: Module<NoPar>(name)
|
2016-05-04 01:07:00 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
// dependencies/products ///////////////////////////////////////////////////////
|
2016-12-14 17:59:45 +00:00
|
|
|
std::vector<std::string> TRandom::getInput(void)
|
2016-05-04 01:07:00 +01:00
|
|
|
{
|
2017-12-13 19:41:41 +00:00
|
|
|
std::vector<std::string> in;
|
|
|
|
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2016-12-14 17:59:45 +00:00
|
|
|
std::vector<std::string> TRandom::getOutput(void)
|
2016-05-04 01:07:00 +01:00
|
|
|
{
|
|
|
|
std::vector<std::string> out = {getName()};
|
|
|
|
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
2016-05-07 21:19:38 +01:00
|
|
|
// setup ///////////////////////////////////////////////////////////////////////
|
2016-12-14 17:59:45 +00:00
|
|
|
void TRandom::setup(void)
|
2016-05-04 01:07:00 +01:00
|
|
|
{
|
2017-12-13 19:41:41 +00:00
|
|
|
envCreateLat(LatticeGaugeField, getName());
|
2016-05-04 01:07:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// execution ///////////////////////////////////////////////////////////////////
|
2016-12-14 17:59:45 +00:00
|
|
|
void TRandom::execute(void)
|
2016-05-04 01:07:00 +01:00
|
|
|
{
|
2016-05-04 20:17:27 +01:00
|
|
|
LOG(Message) << "Generating random gauge configuration" << std::endl;
|
2017-12-13 19:41:41 +00:00
|
|
|
|
|
|
|
auto &U = envGet(LatticeGaugeField, getName());
|
2016-05-07 21:19:38 +01:00
|
|
|
SU3::HotConfiguration(*env().get4dRng(), U);
|
2016-05-04 01:07:00 +01:00
|
|
|
}
|