mirror of
https://github.com/paboyle/Grid.git
synced 2025-07-30 11:17:07 +01:00
Merge remote-tracking branch 'upstream/feature/hadrons' into feature/hadrons
This commit is contained in:
35
extras/Hadrons/Modules/MAction/DWF.cc
Normal file
35
extras/Hadrons/Modules/MAction/DWF.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MAction/DWF.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MAction/DWF.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MAction;
|
||||
|
||||
template class Grid::Hadrons::MAction::TDWF<FIMPL>;
|
||||
|
@@ -61,7 +61,7 @@ public:
|
||||
// constructor
|
||||
TDWF(const std::string name);
|
||||
// destructor
|
||||
virtual ~TDWF(void) = default;
|
||||
virtual ~TDWF(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -72,7 +72,8 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(DWF, TDWF<FIMPL>, MAction);
|
||||
extern template class TDWF<FIMPL>;
|
||||
MODULE_REGISTER_TMP(DWF, TDWF<FIMPL>, MAction);
|
||||
|
||||
/******************************************************************************
|
||||
* DWF template implementation *
|
||||
|
35
extras/Hadrons/Modules/MAction/Wilson.cc
Normal file
35
extras/Hadrons/Modules/MAction/Wilson.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MAction/Wilson.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MAction/Wilson.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MAction;
|
||||
|
||||
template class Grid::Hadrons::MAction::TWilson<FIMPL>;
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
// constructor
|
||||
TWilson(const std::string name);
|
||||
// destructor
|
||||
virtual ~TWilson(void) = default;
|
||||
virtual ~TWilson(void) {};
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -70,7 +70,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Wilson, TWilson<FIMPL>, MAction);
|
||||
MODULE_REGISTER_TMP(Wilson, TWilson<FIMPL>, MAction);
|
||||
|
||||
/******************************************************************************
|
||||
* TWilson template implementation *
|
||||
|
35
extras/Hadrons/Modules/MAction/WilsonClover.cc
Normal file
35
extras/Hadrons/Modules/MAction/WilsonClover.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MAction/WilsonClover.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MAction/WilsonClover.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MAction;
|
||||
|
||||
template class Grid::Hadrons::MAction::TWilsonClover<FIMPL>;
|
||||
|
@@ -64,7 +64,7 @@ public:
|
||||
// constructor
|
||||
TWilsonClover(const std::string name);
|
||||
// destructor
|
||||
virtual ~TWilsonClover(void) = default;
|
||||
virtual ~TWilsonClover(void) {};
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(WilsonClover, TWilsonClover<FIMPL>, MAction);
|
||||
MODULE_REGISTER_TMP(WilsonClover, TWilsonClover<FIMPL>, MAction);
|
||||
|
||||
/******************************************************************************
|
||||
* TWilsonClover template implementation *
|
||||
|
35
extras/Hadrons/Modules/MAction/ZMobiusDWF.cc
Normal file
35
extras/Hadrons/Modules/MAction/ZMobiusDWF.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MAction/ZMobiusDWF.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MAction/ZMobiusDWF.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MAction;
|
||||
|
||||
template class Grid::Hadrons::MAction::TZMobiusDWF<ZFIMPL>;
|
||||
|
@@ -62,7 +62,7 @@ public:
|
||||
// constructor
|
||||
TZMobiusDWF(const std::string name);
|
||||
// destructor
|
||||
virtual ~TZMobiusDWF(void) = default;
|
||||
virtual ~TZMobiusDWF(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(ZMobiusDWF, TZMobiusDWF<ZFIMPL>, MAction);
|
||||
MODULE_REGISTER_TMP(ZMobiusDWF, TZMobiusDWF<ZFIMPL>, MAction);
|
||||
|
||||
/******************************************************************************
|
||||
* TZMobiusDWF implementation *
|
||||
|
35
extras/Hadrons/Modules/MContraction/Baryon.cc
Normal file
35
extras/Hadrons/Modules/MContraction/Baryon.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MContraction/Baryon.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MContraction/Baryon.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MContraction;
|
||||
|
||||
template class Grid::Hadrons::MContraction::TBaryon<FIMPL,FIMPL,FIMPL>;
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
// constructor
|
||||
TBaryon(const std::string name);
|
||||
// destructor
|
||||
virtual ~TBaryon(void) = default;
|
||||
virtual ~TBaryon(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -79,7 +79,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Baryon, ARG(TBaryon<FIMPL, FIMPL, FIMPL>), MContraction);
|
||||
MODULE_REGISTER_TMP(Baryon, ARG(TBaryon<FIMPL, FIMPL, FIMPL>), MContraction);
|
||||
|
||||
/******************************************************************************
|
||||
* TBaryon implementation *
|
||||
|
35
extras/Hadrons/Modules/MContraction/DiscLoop.cc
Normal file
35
extras/Hadrons/Modules/MContraction/DiscLoop.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MContraction/DiscLoop.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MContraction/DiscLoop.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MContraction;
|
||||
|
||||
template class Grid::Hadrons::MContraction::TDiscLoop<FIMPL>;
|
||||
|
@@ -65,7 +65,7 @@ public:
|
||||
// constructor
|
||||
TDiscLoop(const std::string name);
|
||||
// destructor
|
||||
virtual ~TDiscLoop(void) = default;
|
||||
virtual ~TDiscLoop(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -76,7 +76,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(DiscLoop, TDiscLoop<FIMPL>, MContraction);
|
||||
MODULE_REGISTER_TMP(DiscLoop, TDiscLoop<FIMPL>, MContraction);
|
||||
|
||||
/******************************************************************************
|
||||
* TDiscLoop implementation *
|
||||
|
35
extras/Hadrons/Modules/MContraction/Gamma3pt.cc
Normal file
35
extras/Hadrons/Modules/MContraction/Gamma3pt.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MContraction/Gamma3pt.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MContraction/Gamma3pt.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MContraction;
|
||||
|
||||
template class Grid::Hadrons::MContraction::TGamma3pt<FIMPL,FIMPL,FIMPL>;
|
||||
|
@@ -96,7 +96,7 @@ public:
|
||||
// constructor
|
||||
TGamma3pt(const std::string name);
|
||||
// destructor
|
||||
virtual ~TGamma3pt(void) = default;
|
||||
virtual ~TGamma3pt(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -107,7 +107,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Gamma3pt, ARG(TGamma3pt<FIMPL, FIMPL, FIMPL>), MContraction);
|
||||
MODULE_REGISTER_TMP(Gamma3pt, ARG(TGamma3pt<FIMPL, FIMPL, FIMPL>), MContraction);
|
||||
|
||||
/******************************************************************************
|
||||
* TGamma3pt implementation *
|
||||
|
35
extras/Hadrons/Modules/MContraction/Meson.cc
Normal file
35
extras/Hadrons/Modules/MContraction/Meson.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MContraction/Meson.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MContraction/Meson.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MContraction;
|
||||
|
||||
template class Grid::Hadrons::MContraction::TMeson<FIMPL,FIMPL>;
|
||||
|
@@ -90,7 +90,7 @@ public:
|
||||
// constructor
|
||||
TMeson(const std::string name);
|
||||
// destructor
|
||||
virtual ~TMeson(void) = default;
|
||||
virtual ~TMeson(void) {};
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -102,7 +102,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Meson, ARG(TMeson<FIMPL, FIMPL>), MContraction);
|
||||
MODULE_REGISTER_TMP(Meson, ARG(TMeson<FIMPL, FIMPL>), MContraction);
|
||||
|
||||
/******************************************************************************
|
||||
* TMeson implementation *
|
||||
|
35
extras/Hadrons/Modules/MContraction/WardIdentity.cc
Normal file
35
extras/Hadrons/Modules/MContraction/WardIdentity.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MContraction/WardIdentity.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MContraction/WardIdentity.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MContraction;
|
||||
|
||||
template class Grid::Hadrons::MContraction::TWardIdentity<FIMPL>;
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
// constructor
|
||||
TWardIdentity(const std::string name);
|
||||
// destructor
|
||||
virtual ~TWardIdentity(void) = default;
|
||||
virtual ~TWardIdentity(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -84,7 +84,7 @@ private:
|
||||
unsigned int Ls_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(WardIdentity, TWardIdentity<FIMPL>, MContraction);
|
||||
MODULE_REGISTER_TMP(WardIdentity, TWardIdentity<FIMPL>, MContraction);
|
||||
|
||||
/******************************************************************************
|
||||
* TWardIdentity implementation *
|
||||
|
@@ -97,7 +97,7 @@ public:\
|
||||
/* constructor */ \
|
||||
T##modname(const std::string name);\
|
||||
/* destructor */ \
|
||||
virtual ~T##modname(void) = default;\
|
||||
virtual ~T##modname(void) {};\
|
||||
/* dependency relation */ \
|
||||
virtual std::vector<std::string> getInput(void);\
|
||||
virtual std::vector<std::string> getOutput(void);\
|
||||
@@ -109,7 +109,7 @@ protected:\
|
||||
/* execution */ \
|
||||
virtual void execute(void);\
|
||||
};\
|
||||
MODULE_REGISTER_NS(modname, T##modname, MContraction);
|
||||
MODULE_REGISTER(modname, T##modname, MContraction);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
35
extras/Hadrons/Modules/MFermion/GaugeProp.cc
Normal file
35
extras/Hadrons/Modules/MFermion/GaugeProp.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MFermion/GaugeProp.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MFermion/GaugeProp.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MFermion;
|
||||
|
||||
template class Grid::Hadrons::MFermion::TGaugeProp<FIMPL>;
|
||||
|
@@ -81,7 +81,7 @@ public:
|
||||
// constructor
|
||||
TGaugeProp(const std::string name);
|
||||
// destructor
|
||||
virtual ~TGaugeProp(void) = default;
|
||||
virtual ~TGaugeProp(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -95,7 +95,7 @@ private:
|
||||
SolverFn *solver_{nullptr};
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(GaugeProp, TGaugeProp<FIMPL>, MFermion);
|
||||
MODULE_REGISTER_TMP(GaugeProp, TGaugeProp<FIMPL>, MFermion);
|
||||
/******************************************************************************
|
||||
* TGaugeProp implementation *
|
||||
******************************************************************************/
|
||||
|
@@ -4,9 +4,11 @@ Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MGauge/FundtoHirep.cc
|
||||
|
||||
Copyright (C) 2015
|
||||
Copyright (C) 2016
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
Author: Antonin Portelli <antonin.portelli@me.com>
|
||||
Author: Guido Cossu <guido.cossu@ed.ac.uk>
|
||||
Author: pretidav <david.preti@csic.es>
|
||||
|
||||
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
|
||||
@@ -42,7 +44,8 @@ TFundtoHirep<Rep>::TFundtoHirep(const std::string name)
|
||||
template <class Rep>
|
||||
std::vector<std::string> TFundtoHirep<Rep>::getInput(void)
|
||||
{
|
||||
std::vector<std::string> in;
|
||||
std::vector<std::string> in = {par().gaugeconf};
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
@@ -50,6 +53,7 @@ template <class Rep>
|
||||
std::vector<std::string> TFundtoHirep<Rep>::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -57,19 +61,19 @@ std::vector<std::string> TFundtoHirep<Rep>::getOutput(void)
|
||||
template <typename Rep>
|
||||
void TFundtoHirep<Rep>::setup(void)
|
||||
{
|
||||
envCreateLat(typename Rep::LatticeField, getName());
|
||||
envCreateLat(Rep::LatticeField, getName());
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
template <class Rep>
|
||||
void TFundtoHirep<Rep>::execute(void)
|
||||
{
|
||||
auto &U = *env().template getObject<LatticeGaugeField>(par().gaugeconf);
|
||||
LOG(Message) << "Transforming Representation" << std::endl;
|
||||
|
||||
auto &U = envGet(LatticeGaugeField, par().gaugeconf);
|
||||
auto &URep = envGet(Rep::LatticeField, getName());
|
||||
|
||||
Rep TargetRepresentation(U._grid);
|
||||
TargetRepresentation.update_representation(U);
|
||||
|
||||
auto &URep = envGet(typename Rep::LatticeField, getName());
|
||||
URep = TargetRepresentation.U;
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ public:
|
||||
// constructor
|
||||
TFundtoHirep(const std::string name);
|
||||
// destructor
|
||||
virtual ~TFundtoHirep(void) = default;
|
||||
virtual ~TFundtoHirep(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -65,9 +65,9 @@ public:
|
||||
void execute(void);
|
||||
};
|
||||
|
||||
//MODULE_REGISTER_NS(FundtoAdjoint, TFundtoHirep<AdjointRepresentation>, MGauge);
|
||||
//MODULE_REGISTER_NS(FundtoTwoIndexSym, TFundtoHirep<TwoIndexSymmetricRepresentation>, MGauge);
|
||||
//MODULE_REGISTER_NS(FundtoTwoIndexAsym, TFundtoHirep<TwoIndexAntiSymmetricRepresentation>, MGauge);
|
||||
//MODULE_REGISTER_TMP(FundtoAdjoint, TFundtoHirep<AdjointRepresentation>, MGauge);
|
||||
//MODULE_REGISTER_TMP(FundtoTwoIndexSym, TFundtoHirep<TwoIndexSymmetricRepresentation>, MGauge);
|
||||
//MODULE_REGISTER_TMP(FundtoTwoIndexAsym, TFundtoHirep<TwoIndexAntiSymmetricRepresentation>, MGauge);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
// constructor
|
||||
TRandom(const std::string name);
|
||||
// destructor
|
||||
virtual ~TRandom(void) = default;
|
||||
virtual ~TRandom(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -57,7 +57,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Random, TRandom, MGauge);
|
||||
MODULE_REGISTER(Random, TRandom, MGauge);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
@@ -7,6 +7,7 @@ Source file: extras/Hadrons/Modules/MGauge/StochEm.cc
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
Author: Antonin Portelli <antonin.portelli@me.com>
|
||||
Author: Vera Guelpers <vmg1n14@soton.ac.uk>
|
||||
|
||||
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
|
||||
|
@@ -57,7 +57,7 @@ public:
|
||||
// constructor
|
||||
TStochEm(const std::string name);
|
||||
// destructor
|
||||
virtual ~TStochEm(void) = default;
|
||||
virtual ~TStochEm(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -70,7 +70,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(StochEm, TStochEm, MGauge);
|
||||
MODULE_REGISTER(StochEm, TStochEm, MGauge);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
// constructor
|
||||
TUnit(const std::string name);
|
||||
// destructor
|
||||
virtual ~TUnit(void) = default;
|
||||
virtual ~TUnit(void) {};
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -57,7 +57,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Unit, TUnit, MGauge);
|
||||
MODULE_REGISTER(Unit, TUnit, MGauge);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
40
extras/Hadrons/Modules/MIO/LoadBinary.cc
Normal file
40
extras/Hadrons/Modules/MIO/LoadBinary.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MIO/LoadBinary.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MIO/LoadBinary.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MIO;
|
||||
|
||||
template class Grid::Hadrons::MIO::TLoadBinary<GIMPL>;
|
||||
template class Grid::Hadrons::MIO::TLoadBinary<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MIO::TLoadBinary<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MIO::TLoadBinary<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MIO::TLoadBinary<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MIO::TLoadBinary<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -61,7 +61,7 @@ public:
|
||||
// constructor
|
||||
TLoadBinary(const std::string name);
|
||||
// destructor
|
||||
virtual ~TLoadBinary(void) = default;
|
||||
virtual ~TLoadBinary(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -71,12 +71,12 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(LoadBinary, TLoadBinary<GIMPL>, MIO);
|
||||
MODULE_REGISTER_NS(LoadBinaryScalarSU2, TLoadBinary<ScalarNxNAdjImplR<2>>, MIO);
|
||||
MODULE_REGISTER_NS(LoadBinaryScalarSU3, TLoadBinary<ScalarNxNAdjImplR<3>>, MIO);
|
||||
MODULE_REGISTER_NS(LoadBinaryScalarSU4, TLoadBinary<ScalarNxNAdjImplR<4>>, MIO);
|
||||
MODULE_REGISTER_NS(LoadBinaryScalarSU5, TLoadBinary<ScalarNxNAdjImplR<5>>, MIO);
|
||||
MODULE_REGISTER_NS(LoadBinaryScalarSU6, TLoadBinary<ScalarNxNAdjImplR<6>>, MIO);
|
||||
MODULE_REGISTER_TMP(LoadBinary, TLoadBinary<GIMPL>, MIO);
|
||||
MODULE_REGISTER_TMP(LoadBinaryScalarSU2, TLoadBinary<ScalarNxNAdjImplR<2>>, MIO);
|
||||
MODULE_REGISTER_TMP(LoadBinaryScalarSU3, TLoadBinary<ScalarNxNAdjImplR<3>>, MIO);
|
||||
MODULE_REGISTER_TMP(LoadBinaryScalarSU4, TLoadBinary<ScalarNxNAdjImplR<4>>, MIO);
|
||||
MODULE_REGISTER_TMP(LoadBinaryScalarSU5, TLoadBinary<ScalarNxNAdjImplR<5>>, MIO);
|
||||
MODULE_REGISTER_TMP(LoadBinaryScalarSU6, TLoadBinary<ScalarNxNAdjImplR<6>>, MIO);
|
||||
|
||||
/******************************************************************************
|
||||
* TLoadBinary implementation *
|
||||
|
35
extras/Hadrons/Modules/MIO/LoadCoarseEigenPack.cc
Normal file
35
extras/Hadrons/Modules/MIO/LoadCoarseEigenPack.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MIO/LoadCoarseEigenPack.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MIO/LoadCoarseEigenPack.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MIO;
|
||||
|
||||
template class Grid::Hadrons::MIO::TLoadCoarseEigenPack<CoarseFermionEigenPack<FIMPL,HADRONS_DEFAULT_LANCZOS_NBASIS>>;
|
||||
|
134
extras/Hadrons/Modules/MIO/LoadCoarseEigenPack.hpp
Normal file
134
extras/Hadrons/Modules/MIO/LoadCoarseEigenPack.hpp
Normal file
@@ -0,0 +1,134 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MIO/LoadCoarseEigenPack.hpp
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#ifndef Hadrons_MIO_LoadCoarseEigenPack_hpp_
|
||||
#define Hadrons_MIO_LoadCoarseEigenPack_hpp_
|
||||
|
||||
#include <Grid/Hadrons/Global.hpp>
|
||||
#include <Grid/Hadrons/Module.hpp>
|
||||
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||
#include <Grid/Hadrons/EigenPack.hpp>
|
||||
|
||||
BEGIN_HADRONS_NAMESPACE
|
||||
|
||||
/******************************************************************************
|
||||
* Load local coherence eigen vectors/values package *
|
||||
******************************************************************************/
|
||||
BEGIN_MODULE_NAMESPACE(MIO)
|
||||
|
||||
class LoadCoarseEigenPackPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LoadCoarseEigenPackPar,
|
||||
std::string, filestem,
|
||||
unsigned int, sizeFine,
|
||||
unsigned int, sizeCoarse,
|
||||
unsigned int, Ls,
|
||||
std::vector<int>, blockSize);
|
||||
};
|
||||
|
||||
template <typename Pack>
|
||||
class TLoadCoarseEigenPack: public Module<LoadCoarseEigenPackPar>
|
||||
{
|
||||
public:
|
||||
typedef CoarseEigenPack<typename Pack::Field, typename Pack::CoarseField> BasePack;
|
||||
template <typename vtype>
|
||||
using iImplScalar = iScalar<iScalar<iScalar<vtype>>>;
|
||||
typedef iImplScalar<typename Pack::Field::vector_type> SiteComplex;
|
||||
public:
|
||||
// constructor
|
||||
TLoadCoarseEigenPack(const std::string name);
|
||||
// destructor
|
||||
virtual ~TLoadCoarseEigenPack(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_TMP(LoadCoarseFermionEigenPack, ARG(TLoadCoarseEigenPack<CoarseFermionEigenPack<FIMPL, HADRONS_DEFAULT_LANCZOS_NBASIS>>), MIO);
|
||||
|
||||
/******************************************************************************
|
||||
* TLoadCoarseEigenPack implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
template <typename Pack>
|
||||
TLoadCoarseEigenPack<Pack>::TLoadCoarseEigenPack(const std::string name)
|
||||
: Module<LoadCoarseEigenPackPar>(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
template <typename Pack>
|
||||
std::vector<std::string> TLoadCoarseEigenPack<Pack>::getInput(void)
|
||||
{
|
||||
std::vector<std::string> in;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
template <typename Pack>
|
||||
std::vector<std::string> TLoadCoarseEigenPack<Pack>::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
template <typename Pack>
|
||||
void TLoadCoarseEigenPack<Pack>::setup(void)
|
||||
{
|
||||
env().createGrid(par().Ls);
|
||||
env().createCoarseGrid(par().blockSize, par().Ls);
|
||||
envCreateDerived(BasePack, Pack, getName(), par().Ls, par().sizeFine,
|
||||
par().sizeCoarse, env().getRbGrid(par().Ls),
|
||||
env().getCoarseGrid(par().blockSize, par().Ls));
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
template <typename Pack>
|
||||
void TLoadCoarseEigenPack<Pack>::execute(void)
|
||||
{
|
||||
auto cg = env().getCoarseGrid(par().blockSize, par().Ls);
|
||||
auto &epack = envGetDerived(BasePack, Pack, getName());
|
||||
Lattice<SiteComplex> dummy(cg);
|
||||
|
||||
epack.read(par().filestem, vm().getTrajectory());
|
||||
LOG(Message) << "Block Gramm-Schmidt pass 1"<< std::endl;
|
||||
blockOrthogonalise(dummy, epack.evec);
|
||||
LOG(Message) << "Block Gramm-Schmidt pass 2"<< std::endl;
|
||||
blockOrthogonalise(dummy, epack.evec);
|
||||
}
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
||||
#endif // Hadrons_MIO_LoadCoarseEigenPack_hpp_
|
35
extras/Hadrons/Modules/MIO/LoadEigenPack.cc
Normal file
35
extras/Hadrons/Modules/MIO/LoadEigenPack.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MIO/LoadEigenPack.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MIO/LoadEigenPack.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MIO;
|
||||
|
||||
template class Grid::Hadrons::MIO::TLoadEigenPack<FermionEigenPack<FIMPL>>;
|
||||
|
122
extras/Hadrons/Modules/MIO/LoadEigenPack.hpp
Normal file
122
extras/Hadrons/Modules/MIO/LoadEigenPack.hpp
Normal file
@@ -0,0 +1,122 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MIO/LoadEigenPack.hpp
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#ifndef Hadrons_MIO_LoadEigenPack_hpp_
|
||||
#define Hadrons_MIO_LoadEigenPack_hpp_
|
||||
|
||||
#include <Grid/Hadrons/Global.hpp>
|
||||
#include <Grid/Hadrons/Module.hpp>
|
||||
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||
#include <Grid/Hadrons/EigenPack.hpp>
|
||||
|
||||
BEGIN_HADRONS_NAMESPACE
|
||||
|
||||
/******************************************************************************
|
||||
* Load eigen vectors/values package *
|
||||
******************************************************************************/
|
||||
BEGIN_MODULE_NAMESPACE(MIO)
|
||||
|
||||
class LoadEigenPackPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LoadEigenPackPar,
|
||||
std::string, filestem,
|
||||
unsigned int, size,
|
||||
unsigned int, Ls);
|
||||
};
|
||||
|
||||
template <typename Pack>
|
||||
class TLoadEigenPack: public Module<LoadEigenPackPar>
|
||||
{
|
||||
public:
|
||||
typedef EigenPack<typename Pack::Field> BasePack;
|
||||
public:
|
||||
// constructor
|
||||
TLoadEigenPack(const std::string name);
|
||||
// destructor
|
||||
virtual ~TLoadEigenPack(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_TMP(LoadFermionEigenPack, TLoadEigenPack<FermionEigenPack<FIMPL>>, MIO);
|
||||
|
||||
/******************************************************************************
|
||||
* TLoadEigenPack implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
template <typename Pack>
|
||||
TLoadEigenPack<Pack>::TLoadEigenPack(const std::string name)
|
||||
: Module<LoadEigenPackPar>(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
template <typename Pack>
|
||||
std::vector<std::string> TLoadEigenPack<Pack>::getInput(void)
|
||||
{
|
||||
std::vector<std::string> in;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
template <typename Pack>
|
||||
std::vector<std::string> TLoadEigenPack<Pack>::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
template <typename Pack>
|
||||
void TLoadEigenPack<Pack>::setup(void)
|
||||
{
|
||||
env().createGrid(par().Ls);
|
||||
envCreateDerived(BasePack, Pack, getName(), par().Ls, par().size,
|
||||
env().getRbGrid(par().Ls));
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
template <typename Pack>
|
||||
void TLoadEigenPack<Pack>::execute(void)
|
||||
{
|
||||
auto &epack = envGetDerived(BasePack, Pack, getName());
|
||||
|
||||
epack.read(par().filestem, vm().getTrajectory());
|
||||
epack.eval.resize(par().size);
|
||||
}
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
||||
#endif // Hadrons_MIO_LoadEigenPack_hpp_
|
@@ -52,7 +52,7 @@ public:
|
||||
// constructor
|
||||
TLoadNersc(const std::string name);
|
||||
// destructor
|
||||
virtual ~TLoadNersc(void) = default;
|
||||
virtual ~TLoadNersc(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(LoadNersc, TLoadNersc, MIO);
|
||||
MODULE_REGISTER(LoadNersc, TLoadNersc, MIO);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
35
extras/Hadrons/Modules/MLoop/NoiseLoop.cc
Normal file
35
extras/Hadrons/Modules/MLoop/NoiseLoop.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MLoop/NoiseLoop.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MLoop/NoiseLoop.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MLoop;
|
||||
|
||||
template class Grid::Hadrons::MLoop::TNoiseLoop<FIMPL>;
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
// constructor
|
||||
TNoiseLoop(const std::string name);
|
||||
// destructor
|
||||
virtual ~TNoiseLoop(void) = default;
|
||||
virtual ~TNoiseLoop(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -82,7 +82,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(NoiseLoop, TNoiseLoop<FIMPL>, MLoop);
|
||||
MODULE_REGISTER_TMP(NoiseLoop, TNoiseLoop<FIMPL>, MLoop);
|
||||
|
||||
/******************************************************************************
|
||||
* TNoiseLoop implementation *
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
// constructor
|
||||
TChargedProp(const std::string name);
|
||||
// destructor
|
||||
virtual ~TChargedProp(void) = default;
|
||||
virtual ~TChargedProp(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
std::vector<ScalarField *> phase_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(ChargedProp, TChargedProp, MScalar);
|
||||
MODULE_REGISTER(ChargedProp, TChargedProp, MScalar);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
@@ -56,7 +56,7 @@ public:
|
||||
// constructor
|
||||
TFreeProp(const std::string name);
|
||||
// destructor
|
||||
virtual ~TFreeProp(void) = default;
|
||||
virtual ~TFreeProp(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -70,7 +70,7 @@ private:
|
||||
bool freePropDone_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(FreeProp, TFreeProp, MScalar);
|
||||
MODULE_REGISTER(FreeProp, TFreeProp, MScalar);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
39
extras/Hadrons/Modules/MScalarSUN/Div.cc
Normal file
39
extras/Hadrons/Modules/MScalarSUN/Div.cc
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/Div.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/Div.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TDiv<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TDiv<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TDiv<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TDiv<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TDiv<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
// constructor
|
||||
TDiv(const std::string name);
|
||||
// destructor
|
||||
virtual ~TDiv(void) = default;
|
||||
virtual ~TDiv(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -76,11 +76,11 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(DivSU2, TDiv<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(DivSU3, TDiv<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(DivSU4, TDiv<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(DivSU5, TDiv<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(DivSU6, TDiv<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(DivSU2, TDiv<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(DivSU3, TDiv<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(DivSU4, TDiv<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(DivSU5, TDiv<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(DivSU6, TDiv<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TDiv implementation *
|
||||
@@ -126,7 +126,7 @@ void TDiv<SImpl>::execute(void)
|
||||
LOG(Message) << "Computing the " << par().type << " divergence of [";
|
||||
for (unsigned int mu = 0; mu < nd; ++mu)
|
||||
{
|
||||
std::cout << par().op[mu] << ((mu == nd - 1) ? "]" : ", ");
|
||||
std::cout << "'" << par().op[mu] << ((mu == nd - 1) ? "']" : "', ");
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
|
39
extras/Hadrons/Modules/MScalarSUN/EMT.cc
Normal file
39
extras/Hadrons/Modules/MScalarSUN/EMT.cc
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/EMT.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/EMT.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TEMT<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TEMT<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TEMT<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TEMT<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TEMT<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -64,7 +64,7 @@ public:
|
||||
// constructor
|
||||
TEMT(const std::string name);
|
||||
// destructor
|
||||
virtual ~TEMT(void) = default;
|
||||
virtual ~TEMT(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -74,11 +74,11 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(EMTSU2, TEMT<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(EMTSU3, TEMT<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(EMTSU4, TEMT<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(EMTSU5, TEMT<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(EMTSU6, TEMT<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(EMTSU2, TEMT<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(EMTSU3, TEMT<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(EMTSU4, TEMT<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(EMTSU5, TEMT<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(EMTSU6, TEMT<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TEMT implementation *
|
||||
@@ -99,8 +99,12 @@ std::vector<std::string> TEMT<SImpl>::getInput(void)
|
||||
for (unsigned int nu = mu; nu < env().getNd(); ++nu)
|
||||
{
|
||||
in.push_back(varName(par().kinetic, mu, nu));
|
||||
in.push_back(varName(par().improvement, mu, nu));
|
||||
if (!par().improvement.empty())
|
||||
{
|
||||
in.push_back(varName(par().improvement, mu, nu));
|
||||
}
|
||||
}
|
||||
in.push_back(varName(par().kinetic, "sum"));
|
||||
in.push_back(varName(par().phiPow, 2));
|
||||
in.push_back(varName(par().phiPow, 4));
|
||||
|
||||
@@ -130,7 +134,6 @@ void TEMT<SImpl>::setup(void)
|
||||
{
|
||||
envCreateLat(ComplexField, varName(getName(), mu, nu));
|
||||
}
|
||||
envTmpLat(ComplexField, "sumkin");
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
@@ -140,32 +143,36 @@ void TEMT<SImpl>::execute(void)
|
||||
LOG(Message) << "Computing energy-momentum tensor" << std::endl;
|
||||
LOG(Message) << " kinetic terms: '" << par().kinetic << "'" << std::endl;
|
||||
LOG(Message) << " tr(phi^n): '" << par().phiPow << "'" << std::endl;
|
||||
LOG(Message) << " improvement: '" << par().improvement << "'" << std::endl;
|
||||
if (!par().improvement.empty())
|
||||
{
|
||||
LOG(Message) << " improvement: '" << par().improvement << "'" << std::endl;
|
||||
}
|
||||
LOG(Message) << " m^2= " << par().m2 << std::endl;
|
||||
LOG(Message) << " lambda= " << par().lambda << std::endl;
|
||||
LOG(Message) << " g= " << par().g << std::endl;
|
||||
LOG(Message) << " xi= " << par().xi << std::endl;
|
||||
if (!par().improvement.empty())
|
||||
{
|
||||
LOG(Message) << " xi= " << par().xi << std::endl;
|
||||
}
|
||||
|
||||
const unsigned int N = SImpl::Group::Dimension;
|
||||
auto &trphi2 = envGet(ComplexField, varName(par().phiPow, 2));
|
||||
auto &trphi4 = envGet(ComplexField, varName(par().phiPow, 4));
|
||||
auto &sumkin = envGet(ComplexField, varName(par().kinetic, "sum"));
|
||||
|
||||
envGetTmp(ComplexField, sumkin);
|
||||
sumkin = zero;
|
||||
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
||||
{
|
||||
auto &trkin = envGet(ComplexField, varName(par().kinetic, mu, mu));
|
||||
|
||||
sumkin += trkin;
|
||||
}
|
||||
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
||||
for (unsigned int nu = mu; nu < env().getNd(); ++nu)
|
||||
{
|
||||
auto &out = envGet(ComplexField, varName(getName(), mu, nu));
|
||||
auto &trkin = envGet(ComplexField, varName(par().kinetic, mu, nu));
|
||||
auto &imp = envGet(ComplexField, varName(par().improvement, mu, nu));
|
||||
|
||||
out = 2.*trkin;
|
||||
if (!par().improvement.empty())
|
||||
{
|
||||
auto &imp = envGet(ComplexField, varName(par().improvement, mu, nu));
|
||||
|
||||
out = 2.*trkin + par().xi*imp;
|
||||
out += par().xi*imp;
|
||||
}
|
||||
if (mu == nu)
|
||||
{
|
||||
out -= sumkin + par().m2*trphi2 + par().lambda*trphi4;
|
||||
|
38
extras/Hadrons/Modules/MScalarSUN/Grad.cc
Normal file
38
extras/Hadrons/Modules/MScalarSUN/Grad.cc
Normal file
@@ -0,0 +1,38 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/Grad.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/Grad.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TGrad<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TGrad<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TGrad<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TGrad<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TGrad<ScalarNxNAdjImplR<6>>;
|
165
extras/Hadrons/Modules/MScalarSUN/Grad.hpp
Normal file
165
extras/Hadrons/Modules/MScalarSUN/Grad.hpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/Grad.hpp
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#ifndef Hadrons_MScalarSUN_Grad_hpp_
|
||||
#define Hadrons_MScalarSUN_Grad_hpp_
|
||||
|
||||
#include <Grid/Hadrons/Global.hpp>
|
||||
#include <Grid/Hadrons/Module.hpp>
|
||||
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/Utils.hpp>
|
||||
|
||||
BEGIN_HADRONS_NAMESPACE
|
||||
|
||||
/******************************************************************************
|
||||
* Gradient of a complex field *
|
||||
******************************************************************************/
|
||||
BEGIN_MODULE_NAMESPACE(MScalarSUN)
|
||||
|
||||
class GradPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(GradPar,
|
||||
std::string, op,
|
||||
DiffType, type,
|
||||
std::string, output);
|
||||
};
|
||||
|
||||
template <typename SImpl>
|
||||
class TGrad: public Module<GradPar>
|
||||
{
|
||||
public:
|
||||
typedef typename SImpl::Field Field;
|
||||
typedef typename SImpl::ComplexField ComplexField;
|
||||
class Result: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
||||
DiffType, type,
|
||||
Complex, value);
|
||||
};
|
||||
public:
|
||||
// constructor
|
||||
TGrad(const std::string name);
|
||||
// destructor
|
||||
virtual ~TGrad(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_TMP(GradSU2, TGrad<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(GradSU3, TGrad<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(GradSU4, TGrad<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(GradSU5, TGrad<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(GradSU6, TGrad<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TGrad implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
template <typename SImpl>
|
||||
TGrad<SImpl>::TGrad(const std::string name)
|
||||
: Module<GradPar>(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
template <typename SImpl>
|
||||
std::vector<std::string> TGrad<SImpl>::getInput(void)
|
||||
{
|
||||
std::vector<std::string> in = {par().op};
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
template <typename SImpl>
|
||||
std::vector<std::string> TGrad<SImpl>::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out;
|
||||
const auto nd = env().getNd();
|
||||
|
||||
for (unsigned int mu = 0; mu < nd; ++mu)
|
||||
{
|
||||
out.push_back(varName(getName(), mu));
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
template <typename SImpl>
|
||||
void TGrad<SImpl>::setup(void)
|
||||
{
|
||||
const auto nd = env().getNd();
|
||||
|
||||
for (unsigned int mu = 0; mu < nd; ++mu)
|
||||
{
|
||||
envCreateLat(ComplexField, varName(getName(), mu));
|
||||
}
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
template <typename SImpl>
|
||||
void TGrad<SImpl>::execute(void)
|
||||
{
|
||||
const auto nd = env().getNd();
|
||||
|
||||
LOG(Message) << "Computing the " << par().type << " gradient of '"
|
||||
<< par().op << "'" << std::endl;
|
||||
|
||||
std::vector<Result> result;
|
||||
auto &op = envGet(ComplexField, par().op);
|
||||
|
||||
for (unsigned int mu = 0; mu < nd; ++mu)
|
||||
{
|
||||
auto &der = envGet(ComplexField, varName(getName(), mu));
|
||||
|
||||
dmu(der, op, mu, par().type);
|
||||
if (!par().output.empty())
|
||||
{
|
||||
Result r;
|
||||
|
||||
r.type = par().type;
|
||||
r.value = TensorRemove(sum(der));
|
||||
result.push_back(r);
|
||||
}
|
||||
}
|
||||
if (result.size() > 0)
|
||||
{
|
||||
saveResult(par().output, "grad", result);
|
||||
}
|
||||
}
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
||||
#endif // Hadrons_MScalarSUN_Grad_hpp_
|
39
extras/Hadrons/Modules/MScalarSUN/ShiftProbe.cc
Normal file
39
extras/Hadrons/Modules/MScalarSUN/ShiftProbe.cc
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/ShiftProbe.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/ShiftProbe.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TShiftProbe<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TShiftProbe<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TShiftProbe<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TShiftProbe<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TShiftProbe<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -69,7 +69,7 @@ public:
|
||||
// constructor
|
||||
TShiftProbe(const std::string name);
|
||||
// destructor
|
||||
virtual ~TShiftProbe(void) = default;
|
||||
virtual ~TShiftProbe(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -79,11 +79,11 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(ShiftProbeSU2, TShiftProbe<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(ShiftProbeSU3, TShiftProbe<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(ShiftProbeSU4, TShiftProbe<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(ShiftProbeSU5, TShiftProbe<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(ShiftProbeSU6, TShiftProbe<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(ShiftProbeSU2, TShiftProbe<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(ShiftProbeSU3, TShiftProbe<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(ShiftProbeSU4, TShiftProbe<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(ShiftProbeSU5, TShiftProbe<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(ShiftProbeSU6, TShiftProbe<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TShiftProbe implementation *
|
||||
@@ -116,7 +116,7 @@ template <typename SImpl>
|
||||
void TShiftProbe<SImpl>::setup(void)
|
||||
{
|
||||
envTmpLat(Field, "acc");
|
||||
envCacheLat(ComplexField, getName());
|
||||
envCreateLat(ComplexField, getName());
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
@@ -159,7 +159,7 @@ void TShiftProbe<SImpl>::execute(void)
|
||||
acc *= Cshift(phi, shift[i].first, shift[i].second);
|
||||
}
|
||||
}
|
||||
probe = sign*trace(acc);
|
||||
probe = real(sign*trace(acc));
|
||||
}
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
39
extras/Hadrons/Modules/MScalarSUN/TrKinetic.cc
Normal file
39
extras/Hadrons/Modules/MScalarSUN/TrKinetic.cc
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/TrKinetic.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/TrKinetic.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TTrKinetic<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrKinetic<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrKinetic<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrKinetic<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrKinetic<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
// constructor
|
||||
TTrKinetic(const std::string name);
|
||||
// destructor
|
||||
virtual ~TTrKinetic(void) = default;
|
||||
virtual ~TTrKinetic(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -76,11 +76,11 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(TrKineticSU2, TTrKinetic<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrKineticSU3, TTrKinetic<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrKineticSU4, TTrKinetic<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrKineticSU5, TTrKinetic<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrKineticSU6, TTrKinetic<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrKineticSU2, TTrKinetic<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrKineticSU3, TTrKinetic<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrKineticSU4, TTrKinetic<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrKineticSU5, TTrKinetic<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrKineticSU6, TTrKinetic<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TTrKinetic implementation *
|
||||
@@ -110,6 +110,7 @@ std::vector<std::string> TTrKinetic<SImpl>::getOutput(void)
|
||||
{
|
||||
out.push_back(varName(getName(), mu, nu));
|
||||
}
|
||||
out.push_back(varName(getName(), "sum"));
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -123,6 +124,7 @@ void TTrKinetic<SImpl>::setup(void)
|
||||
{
|
||||
envCreateLat(ComplexField, varName(getName(), mu, nu));
|
||||
}
|
||||
envCreateLat(ComplexField, varName(getName(), "sum"));
|
||||
envTmp(std::vector<Field>, "der", 1, env().getNd(), env().getGrid());
|
||||
}
|
||||
|
||||
@@ -134,9 +136,11 @@ void TTrKinetic<SImpl>::execute(void)
|
||||
<< " derivative" << std::endl;
|
||||
|
||||
std::vector<Result> result;
|
||||
auto &phi = envGet(Field, par().field);
|
||||
auto &phi = envGet(Field, par().field);
|
||||
auto &sumkin = envGet(ComplexField, varName(getName(), "sum"));
|
||||
|
||||
envGetTmp(std::vector<Field>, der);
|
||||
sumkin = zero;
|
||||
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
||||
{
|
||||
dmu(der[mu], phi, mu, par().type);
|
||||
@@ -147,8 +151,17 @@ void TTrKinetic<SImpl>::execute(void)
|
||||
auto &out = envGet(ComplexField, varName(getName(), mu, nu));
|
||||
|
||||
out = -trace(der[mu]*der[nu]);
|
||||
if (!par().output.empty())
|
||||
if (mu == nu)
|
||||
{
|
||||
sumkin += out;
|
||||
}
|
||||
}
|
||||
if (!par().output.empty())
|
||||
{
|
||||
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
||||
for (unsigned int nu = mu; nu < env().getNd(); ++nu)
|
||||
{
|
||||
auto &out = envGet(ComplexField, varName(getName(), mu, nu));
|
||||
Result r;
|
||||
|
||||
r.op = "tr(d_" + std::to_string(mu) + "phi*d_"
|
||||
@@ -156,6 +169,13 @@ void TTrKinetic<SImpl>::execute(void)
|
||||
r.value = TensorRemove(sum(out));
|
||||
result.push_back(r);
|
||||
}
|
||||
{
|
||||
Result r;
|
||||
|
||||
r.op = "sum_mu tr(d_mu phi*d_mu phi)";
|
||||
r.value = TensorRemove(sum(sumkin));
|
||||
result.push_back(r);
|
||||
}
|
||||
}
|
||||
if (result.size() > 0)
|
||||
{
|
||||
|
39
extras/Hadrons/Modules/MScalarSUN/TrMag.cc
Normal file
39
extras/Hadrons/Modules/MScalarSUN/TrMag.cc
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/TrMag.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/TrMag.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TTrMag<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrMag<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrMag<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrMag<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrMag<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
// constructor
|
||||
TTrMag(const std::string name);
|
||||
// destructor
|
||||
virtual ~TTrMag(void) = default;
|
||||
virtual ~TTrMag(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -76,11 +76,11 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(TrMagSU2, TTrMag<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrMagSU3, TTrMag<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrMagSU4, TTrMag<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrMagSU5, TTrMag<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrMagSU6, TTrMag<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrMagSU2, TTrMag<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrMagSU3, TTrMag<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrMagSU4, TTrMag<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrMagSU5, TTrMag<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrMagSU6, TTrMag<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TTrMag implementation *
|
||||
|
39
extras/Hadrons/Modules/MScalarSUN/TrPhi.cc
Normal file
39
extras/Hadrons/Modules/MScalarSUN/TrPhi.cc
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/TrPhi.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/TrPhi.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TTrPhi<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrPhi<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrPhi<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrPhi<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTrPhi<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
// constructor
|
||||
TTrPhi(const std::string name);
|
||||
// destructor
|
||||
virtual ~TTrPhi(void) = default;
|
||||
virtual ~TTrPhi(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -76,11 +76,11 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(TrPhiSU2, TTrPhi<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrPhiSU3, TTrPhi<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrPhiSU4, TTrPhi<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrPhiSU5, TTrPhi<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TrPhiSU6, TTrPhi<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrPhiSU2, TTrPhi<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrPhiSU3, TTrPhi<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrPhiSU4, TTrPhi<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrPhiSU5, TTrPhi<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TrPhiSU6, TTrPhi<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TTrPhi implementation *
|
||||
|
39
extras/Hadrons/Modules/MScalarSUN/TransProj.cc
Normal file
39
extras/Hadrons/Modules/MScalarSUN/TransProj.cc
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/TransProj.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/TransProj.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TTransProj<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTransProj<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTransProj<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTransProj<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTransProj<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
// constructor
|
||||
TTransProj(const std::string name);
|
||||
// destructor
|
||||
virtual ~TTransProj(void) = default;
|
||||
virtual ~TTransProj(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -77,11 +77,11 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(TransProjSU2, TTransProj<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TransProjSU3, TTransProj<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TransProjSU4, TTransProj<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TransProjSU5, TTransProj<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TransProjSU6, TTransProj<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TransProjSU2, TTransProj<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TransProjSU3, TTransProj<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TransProjSU4, TTransProj<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TransProjSU5, TTransProj<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TransProjSU6, TTransProj<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TTransProj implementation *
|
||||
|
39
extras/Hadrons/Modules/MScalarSUN/TwoPoint.cc
Normal file
39
extras/Hadrons/Modules/MScalarSUN/TwoPoint.cc
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MScalarSUN/TwoPoint.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/TwoPoint.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MScalarSUN;
|
||||
|
||||
template class Grid::Hadrons::MScalarSUN::TTwoPoint<ScalarNxNAdjImplR<2>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTwoPoint<ScalarNxNAdjImplR<3>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTwoPoint<ScalarNxNAdjImplR<4>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTwoPoint<ScalarNxNAdjImplR<5>>;
|
||||
template class Grid::Hadrons::MScalarSUN::TTwoPoint<ScalarNxNAdjImplR<6>>;
|
||||
|
@@ -43,8 +43,10 @@ BEGIN_MODULE_NAMESPACE(MScalarSUN)
|
||||
class TwoPointPar: Serializable
|
||||
{
|
||||
public:
|
||||
typedef std::pair<std::string, std::string> OpPair;
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(TwoPointPar,
|
||||
std::vector<std::string>, op,
|
||||
std::vector<OpPair>, op,
|
||||
std::vector<std::string>, mom,
|
||||
std::string, output);
|
||||
};
|
||||
|
||||
@@ -52,21 +54,24 @@ template <typename SImpl>
|
||||
class TTwoPoint: public Module<TwoPointPar>
|
||||
{
|
||||
public:
|
||||
typedef typename SImpl::Field Field;
|
||||
typedef typename SImpl::ComplexField ComplexField;
|
||||
typedef typename SImpl::Field Field;
|
||||
typedef typename SImpl::ComplexField ComplexField;
|
||||
typedef std::vector<TComplex> SlicedOp;
|
||||
|
||||
class Result: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
||||
std::string, sink,
|
||||
std::string, source,
|
||||
std::vector<int>, mom,
|
||||
std::vector<Complex>, data);
|
||||
};
|
||||
public:
|
||||
// constructor
|
||||
TTwoPoint(const std::string name);
|
||||
// destructor
|
||||
virtual ~TTwoPoint(void) = default;
|
||||
virtual ~TTwoPoint(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -79,13 +84,15 @@ private:
|
||||
template <class SinkSite, class SourceSite>
|
||||
std::vector<Complex> makeTwoPoint(const std::vector<SinkSite> &sink,
|
||||
const std::vector<SourceSite> &source);
|
||||
private:
|
||||
std::vector<std::vector<int>> mom_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(TwoPointSU2, TTwoPoint<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TwoPointSU3, TTwoPoint<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TwoPointSU4, TTwoPoint<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TwoPointSU5, TTwoPoint<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_NS(TwoPointSU6, TTwoPoint<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TwoPointSU2, TTwoPoint<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TwoPointSU3, TTwoPoint<ScalarNxNAdjImplR<3>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TwoPointSU4, TTwoPoint<ScalarNxNAdjImplR<4>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TwoPointSU5, TTwoPoint<ScalarNxNAdjImplR<5>>, MScalarSUN);
|
||||
MODULE_REGISTER_TMP(TwoPointSU6, TTwoPoint<ScalarNxNAdjImplR<6>>, MScalarSUN);
|
||||
|
||||
/******************************************************************************
|
||||
* TTwoPoint implementation *
|
||||
@@ -100,7 +107,20 @@ TTwoPoint<SImpl>::TTwoPoint(const std::string name)
|
||||
template <typename SImpl>
|
||||
std::vector<std::string> TTwoPoint<SImpl>::getInput(void)
|
||||
{
|
||||
return par().op;
|
||||
std::vector<std::string> in;
|
||||
std::set<std::string> ops;
|
||||
|
||||
for (auto &p: par().op)
|
||||
{
|
||||
ops.insert(p.first);
|
||||
ops.insert(p.second);
|
||||
}
|
||||
for (auto &o: ops)
|
||||
{
|
||||
in.push_back(o);
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
template <typename SImpl>
|
||||
@@ -115,39 +135,78 @@ std::vector<std::string> TTwoPoint<SImpl>::getOutput(void)
|
||||
template <typename SImpl>
|
||||
void TTwoPoint<SImpl>::setup(void)
|
||||
{
|
||||
const unsigned int nt = env().getDim().back();
|
||||
envTmp(std::vector<std::vector<TComplex>>, "slicedOp", 1, par().op.size(),
|
||||
std::vector<TComplex>(nt));
|
||||
const unsigned int nd = env().getDim().size();
|
||||
|
||||
mom_.resize(par().mom.size());
|
||||
for (unsigned int i = 0; i < mom_.size(); ++i)
|
||||
{
|
||||
mom_[i] = strToVec<int>(par().mom[i]);
|
||||
if (mom_[i].size() != nd - 1)
|
||||
{
|
||||
HADRON_ERROR(Size, "momentum number of components different from "
|
||||
+ std::to_string(nd-1));
|
||||
}
|
||||
}
|
||||
envTmpLat(ComplexField, "ftBuf");
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
template <typename SImpl>
|
||||
void TTwoPoint<SImpl>::execute(void)
|
||||
{
|
||||
LOG(Message) << "Computing 2-point functions for operators:" << std::endl;
|
||||
for (auto &o: par().op)
|
||||
LOG(Message) << "Computing 2-point functions" << std::endl;
|
||||
for (auto &p: par().op)
|
||||
{
|
||||
LOG(Message) << " '" << o << "'" << std::endl;
|
||||
LOG(Message) << " <" << p.first << " " << p.second << ">" << std::endl;
|
||||
}
|
||||
|
||||
const unsigned int nd = env().getDim().size();
|
||||
std::vector<Result> result;
|
||||
|
||||
envGetTmp(std::vector<std::vector<TComplex>>, slicedOp);
|
||||
for (unsigned int i = 0; i < par().op.size(); ++i)
|
||||
{
|
||||
auto &op = envGet(ComplexField, par().op[i]);
|
||||
const unsigned int nd = env().getDim().size();
|
||||
const unsigned int nt = env().getDim().back();
|
||||
const unsigned int nop = par().op.size();
|
||||
const unsigned int nmom = mom_.size();
|
||||
std::vector<int> dMask(nd, 1);
|
||||
std::set<std::string> ops;
|
||||
std::vector<Result> result;
|
||||
std::map<std::string, std::vector<SlicedOp>> slicedOp;
|
||||
FFT fft(env().getGrid());
|
||||
|
||||
sliceSum(op, slicedOp[i], nd - 1);
|
||||
envGetTmp(ComplexField, ftBuf);
|
||||
dMask[nd - 1] = 0;
|
||||
for (auto &p: par().op)
|
||||
{
|
||||
ops.insert(p.first);
|
||||
ops.insert(p.second);
|
||||
}
|
||||
for (unsigned int i = 0; i < par().op.size(); ++i)
|
||||
for (unsigned int j = 0; j < par().op.size(); ++j)
|
||||
for (auto &o: ops)
|
||||
{
|
||||
auto &op = envGet(ComplexField, o);
|
||||
|
||||
slicedOp[o].resize(nmom);
|
||||
LOG(Message) << "Operator '" << o << "' FFT" << std::endl;
|
||||
fft.FFT_dim_mask(ftBuf, op, dMask, FFT::backward);
|
||||
for (unsigned int m = 0; m < nmom; ++m)
|
||||
{
|
||||
auto qt = mom_[m];
|
||||
|
||||
qt.resize(nd);
|
||||
slicedOp[o][m].resize(nt);
|
||||
for (unsigned int t = 0; t < nt; ++t)
|
||||
{
|
||||
qt[nd - 1] = t;
|
||||
peekSite(slicedOp[o][m][t], ftBuf, qt);
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG(Message) << "Making contractions" << std::endl;
|
||||
for (unsigned int m = 0; m < nmom; ++m)
|
||||
for (auto &p: par().op)
|
||||
{
|
||||
Result r;
|
||||
|
||||
r.sink = par().op[i];
|
||||
r.source = par().op[j];
|
||||
r.data = makeTwoPoint(slicedOp[i], slicedOp[j]);
|
||||
r.sink = p.first;
|
||||
r.source = p.second;
|
||||
r.mom = mom_[m];
|
||||
r.data = makeTwoPoint(slicedOp[p.first][m], slicedOp[p.second][m]);
|
||||
result.push_back(r);
|
||||
}
|
||||
saveResult(par().output, "twopt", result);
|
||||
@@ -169,7 +228,7 @@ std::vector<Complex> TTwoPoint<SImpl>::makeTwoPoint(
|
||||
{
|
||||
for (unsigned int t = 0; t < nt; ++t)
|
||||
{
|
||||
res[dt] += TensorRemove(trace(sink[(t+dt)%nt]*source[t]));
|
||||
res[dt] += TensorRemove(trace(sink[(t+dt)%nt]*adj(source[t])));
|
||||
}
|
||||
res[dt] *= 1./static_cast<double>(nt);
|
||||
}
|
||||
|
@@ -89,15 +89,20 @@ inline void dmuAcc(Field &out, const Field &in, const unsigned int mu, const Dif
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string varName(const std::string name, const std::string suf)
|
||||
{
|
||||
return name + "_" + suf;
|
||||
}
|
||||
|
||||
inline std::string varName(const std::string name, const unsigned int mu)
|
||||
{
|
||||
return name + "_" + std::to_string(mu);
|
||||
return varName(name, std::to_string(mu));
|
||||
}
|
||||
|
||||
inline std::string varName(const std::string name, const unsigned int mu,
|
||||
const unsigned int nu)
|
||||
{
|
||||
return name + "_" + std::to_string(mu) + "_" + std::to_string(nu);
|
||||
return varName(name, std::to_string(mu) + "_" + std::to_string(nu));
|
||||
}
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
36
extras/Hadrons/Modules/MSink/Point.cc
Normal file
36
extras/Hadrons/Modules/MSink/Point.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSink/Point.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSink/Point.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSink;
|
||||
|
||||
template class Grid::Hadrons::MSink::TPoint<FIMPL>;
|
||||
template class Grid::Hadrons::MSink::TPoint<ScalarImplCR>;
|
||||
|
@@ -7,6 +7,7 @@ Source file: extras/Hadrons/Modules/MSink/Point.hpp
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
Author: Antonin Portelli <antonin.portelli@me.com>
|
||||
Author: Guido Cossu <guido.cossu@ed.ac.uk>
|
||||
Author: Lanny91 <andrew.lawson@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -58,7 +59,7 @@ public:
|
||||
// constructor
|
||||
TPoint(const std::string name);
|
||||
// destructor
|
||||
virtual ~TPoint(void) = default;
|
||||
virtual ~TPoint(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -72,8 +73,8 @@ private:
|
||||
std::string momphName_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Point, TPoint<FIMPL>, MSink);
|
||||
MODULE_REGISTER_NS(ScalarPoint, TPoint<ScalarImplCR>, MSink);
|
||||
MODULE_REGISTER_TMP(Point, TPoint<FIMPL>, MSink);
|
||||
MODULE_REGISTER_TMP(ScalarPoint, TPoint<ScalarImplCR>, MSink);
|
||||
|
||||
/******************************************************************************
|
||||
* TPoint implementation *
|
||||
@@ -128,7 +129,7 @@ void TPoint<FImpl>::execute(void)
|
||||
envGetTmp(LatticeComplex, coor);
|
||||
p = strToVec<Real>(par().mom);
|
||||
ph = zero;
|
||||
for(unsigned int mu = 0; mu < env().getNd(); mu++)
|
||||
for(unsigned int mu = 0; mu < p.size(); mu++)
|
||||
{
|
||||
LatticeCoordinate(coor, mu);
|
||||
ph = ph + (p[mu]/env().getGrid()->_fdimensions[mu])*coor;
|
||||
|
35
extras/Hadrons/Modules/MSink/Smear.cc
Normal file
35
extras/Hadrons/Modules/MSink/Smear.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSink/Smear.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSink/Smear.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSink;
|
||||
|
||||
template class Grid::Hadrons::MSink::TSmear<FIMPL>;
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
// constructor
|
||||
TSmear(const std::string name);
|
||||
// destructor
|
||||
virtual ~TSmear(void) = default;
|
||||
virtual ~TSmear(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -70,7 +70,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Smear, TSmear<FIMPL>, MSink);
|
||||
MODULE_REGISTER_TMP(Smear, TSmear<FIMPL>, MSink);
|
||||
|
||||
/******************************************************************************
|
||||
* TSmear implementation *
|
||||
|
36
extras/Hadrons/Modules/MSolver/LocalCoherenceLanczos.cc
Normal file
36
extras/Hadrons/Modules/MSolver/LocalCoherenceLanczos.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSolver/LocalCoherenceLanczos.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSolver/LocalCoherenceLanczos.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSolver;
|
||||
|
||||
template class Grid::Hadrons::MSolver::TLocalCoherenceLanczos<FIMPL,HADRONS_DEFAULT_LANCZOS_NBASIS>;
|
||||
template class Grid::Hadrons::MSolver::TLocalCoherenceLanczos<ZFIMPL,HADRONS_DEFAULT_LANCZOS_NBASIS>;
|
||||
|
@@ -31,7 +31,7 @@ See the full license in the file "LICENSE" in the top level distribution directo
|
||||
#include <Grid/Hadrons/Global.hpp>
|
||||
#include <Grid/Hadrons/Module.hpp>
|
||||
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||
#include <Grid/Hadrons/LanczosUtils.hpp>
|
||||
#include <Grid/Hadrons/EigenPack.hpp>
|
||||
|
||||
BEGIN_HADRONS_NAMESPACE
|
||||
|
||||
@@ -45,8 +45,7 @@ class LocalCoherenceLanczosPar: Serializable
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LocalCoherenceLanczosPar,
|
||||
std::string, action,
|
||||
int, doFine,
|
||||
int, doCoarse,
|
||||
bool, doCoarse,
|
||||
LanczosParams, fineParams,
|
||||
LanczosParams, coarseParams,
|
||||
ChebyParams, smoother,
|
||||
@@ -63,14 +62,14 @@ public:
|
||||
typedef LocalCoherenceLanczos<typename FImpl::SiteSpinor,
|
||||
typename FImpl::SiteComplex,
|
||||
nBasis> LCL;
|
||||
typedef FineEigenPack<FImpl> FinePack;
|
||||
typedef CoarseEigenPack<FImpl, nBasis> CoarsePack;
|
||||
typedef FermionEigenPack<FImpl> BasePack;
|
||||
typedef CoarseFermionEigenPack<FImpl, nBasis> CoarsePack;
|
||||
typedef HADRONS_DEFAULT_SCHUR_OP<FMat, FermionField> SchurFMat;
|
||||
public:
|
||||
// constructor
|
||||
TLocalCoherenceLanczos(const std::string name);
|
||||
// destructor
|
||||
virtual ~TLocalCoherenceLanczos(void) = default;
|
||||
virtual ~TLocalCoherenceLanczos(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -78,24 +77,10 @@ public:
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
private:
|
||||
void makeCoarseGrid(void);
|
||||
private:
|
||||
std::vector<int> coarseDim_;
|
||||
int Ls_, cLs_{1};
|
||||
std::unique_ptr<GridCartesian> coarseGrid4_{nullptr};
|
||||
std::unique_ptr<GridCartesian> coarseGrid_{nullptr};
|
||||
std::unique_ptr<GridRedBlackCartesian> coarseGrid4Rb_{nullptr};
|
||||
std::unique_ptr<GridRedBlackCartesian> coarseGridRb_{nullptr};
|
||||
std::string fineName_, coarseName_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(LocalCoherenceLanczos,
|
||||
ARG(TLocalCoherenceLanczos<FIMPL, HADRONS_DEFAULT_LANCZOS_NBASIS>),
|
||||
MSolver);
|
||||
MODULE_REGISTER_NS(ZLocalCoherenceLanczos,
|
||||
ARG(TLocalCoherenceLanczos<ZFIMPL, HADRONS_DEFAULT_LANCZOS_NBASIS>),
|
||||
MSolver);
|
||||
MODULE_REGISTER_TMP(LocalCoherenceLanczos, ARG(TLocalCoherenceLanczos<FIMPL, HADRONS_DEFAULT_LANCZOS_NBASIS>), MSolver);
|
||||
MODULE_REGISTER_TMP(ZLocalCoherenceLanczos, ARG(TLocalCoherenceLanczos<ZFIMPL, HADRONS_DEFAULT_LANCZOS_NBASIS>), MSolver);
|
||||
|
||||
/******************************************************************************
|
||||
* TLocalCoherenceLanczos implementation *
|
||||
@@ -104,10 +89,7 @@ MODULE_REGISTER_NS(ZLocalCoherenceLanczos,
|
||||
template <typename FImpl, int nBasis>
|
||||
TLocalCoherenceLanczos<FImpl, nBasis>::TLocalCoherenceLanczos(const std::string name)
|
||||
: Module<LocalCoherenceLanczosPar>(name)
|
||||
{
|
||||
fineName_ = getName() + "_fine";
|
||||
coarseName_ = getName() + "_coarse";
|
||||
}
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
template <typename FImpl, int nBasis>
|
||||
@@ -121,61 +103,12 @@ std::vector<std::string> TLocalCoherenceLanczos<FImpl, nBasis>::getInput(void)
|
||||
template <typename FImpl, int nBasis>
|
||||
std::vector<std::string> TLocalCoherenceLanczos<FImpl, nBasis>::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {fineName_, coarseName_};
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
template <typename FImpl, int nBasis>
|
||||
void TLocalCoherenceLanczos<FImpl, nBasis>::makeCoarseGrid(void)
|
||||
{
|
||||
int nd = env().getNd();
|
||||
std::vector<int> blockSize = strToVec<int>(par().blockSize);
|
||||
auto fineDim = env().getDim();
|
||||
|
||||
Ls_ = env().getObjectLs(par().action);
|
||||
env().createGrid(Ls_);
|
||||
coarseDim_.resize(nd);
|
||||
for (int d = 0; d < coarseDim_.size(); d++)
|
||||
{
|
||||
coarseDim_[d] = fineDim[d]/blockSize[d];
|
||||
if (coarseDim_[d]*blockSize[d] != fineDim[d])
|
||||
{
|
||||
HADRON_ERROR(Size, "Fine dimension " + std::to_string(d)
|
||||
+ " (" + std::to_string(fineDim[d])
|
||||
+ ") not divisible by coarse dimension ("
|
||||
+ std::to_string(coarseDim_[d]) + ")");
|
||||
}
|
||||
}
|
||||
if (blockSize.size() > nd)
|
||||
{
|
||||
cLs_ = Ls_/blockSize[nd];
|
||||
if (cLs_*blockSize[nd] != Ls_)
|
||||
{
|
||||
HADRON_ERROR(Size, "Fine Ls (" + std::to_string(Ls_)
|
||||
+ ") not divisible by coarse Ls ("
|
||||
+ std::to_string(cLs_) + ")");
|
||||
}
|
||||
}
|
||||
if (Ls_ > 1)
|
||||
{
|
||||
coarseGrid4_.reset(SpaceTimeGrid::makeFourDimGrid(
|
||||
coarseDim_, GridDefaultSimd(nd, vComplex::Nsimd()),
|
||||
GridDefaultMpi()));
|
||||
coarseGrid4Rb_.reset(SpaceTimeGrid::makeFourDimRedBlackGrid(coarseGrid4_.get()));
|
||||
coarseGrid_.reset(SpaceTimeGrid::makeFiveDimGrid(cLs_, coarseGrid4_.get()));
|
||||
coarseGridRb_.reset(SpaceTimeGrid::makeFiveDimRedBlackGrid(cLs_, coarseGrid4_.get()));
|
||||
}
|
||||
else
|
||||
{
|
||||
coarseGrid_.reset(SpaceTimeGrid::makeFourDimGrid(
|
||||
coarseDim_, GridDefaultSimd(nd, vComplex::Nsimd()),
|
||||
GridDefaultMpi()));
|
||||
coarseGridRb_.reset(SpaceTimeGrid::makeFourDimRedBlackGrid(coarseGrid_.get()));
|
||||
}
|
||||
}
|
||||
|
||||
template <typename FImpl, int nBasis>
|
||||
void TLocalCoherenceLanczos<FImpl, nBasis>::setup(void)
|
||||
{
|
||||
@@ -183,19 +116,24 @@ void TLocalCoherenceLanczos<FImpl, nBasis>::setup(void)
|
||||
<< " action '" << par().action << "' (" << nBasis
|
||||
<< " eigenvectors)..." << std::endl;
|
||||
|
||||
if (!coarseGrid_)
|
||||
{
|
||||
makeCoarseGrid();
|
||||
}
|
||||
LOG(Message) << "Coarse grid: " << coarseGrid_->GlobalDimensions() << std::endl;
|
||||
envCreate(FinePack, fineName_, Ls_, par().fineParams.Nm, env().getRbGrid(Ls_));
|
||||
envCreate(CoarsePack, coarseName_, Ls_, par().coarseParams.Nm, coarseGridRb_.get());
|
||||
auto &fine = envGet(FinePack, fineName_);
|
||||
auto &coarse = envGet(CoarsePack, coarseName_);
|
||||
envTmp(SchurFMat, "mat", Ls_, envGet(FMat, par().action));
|
||||
unsigned int Ls = env().getObjectLs(par().action);
|
||||
auto blockSize = strToVec<int>(par().blockSize);
|
||||
|
||||
env().createCoarseGrid(blockSize, Ls);
|
||||
|
||||
auto cg = env().getCoarseGrid(blockSize, Ls);
|
||||
int cNm = (par().doCoarse) ? par().coarseParams.Nm : 0;
|
||||
|
||||
LOG(Message) << "Coarse grid: " << cg->GlobalDimensions() << std::endl;
|
||||
envCreateDerived(BasePack, CoarsePack, getName(), Ls,
|
||||
par().fineParams.Nm, cNm, env().getRbGrid(Ls), cg);
|
||||
|
||||
auto &epack = envGetDerived(BasePack, CoarsePack, getName());
|
||||
|
||||
envTmp(SchurFMat, "mat", Ls, envGet(FMat, par().action));
|
||||
envGetTmp(SchurFMat, mat);
|
||||
envTmp(LCL, "solver", Ls_, env().getRbGrid(Ls_), coarseGridRb_.get(), mat,
|
||||
Odd, fine.evec, coarse.evec, fine.eval, coarse.eval);
|
||||
envTmp(LCL, "solver", Ls, env().getRbGrid(Ls), cg, mat,
|
||||
Odd, epack.evec, epack.evecCoarse, epack.eval, epack.evalCoarse);
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
@@ -204,40 +142,38 @@ void TLocalCoherenceLanczos<FImpl, nBasis>::execute(void)
|
||||
{
|
||||
auto &finePar = par().fineParams;
|
||||
auto &coarsePar = par().coarseParams;
|
||||
auto &fine = envGet(FinePack, fineName_);
|
||||
auto &coarse = envGet(CoarsePack, coarseName_);
|
||||
auto &epack = envGetDerived(BasePack, CoarsePack, getName());
|
||||
|
||||
epack.record.operatorXml = vm().getModule(par().action)->parString();
|
||||
epack.record.solverXml = parString();
|
||||
envGetTmp(LCL, solver);
|
||||
if (par().doFine)
|
||||
LOG(Message) << "Performing fine grid IRL -- Nstop= "
|
||||
<< finePar.Nstop << ", Nk= " << finePar.Nk << ", Nm= "
|
||||
<< finePar.Nm << std::endl;
|
||||
solver.calcFine(finePar.Cheby, finePar.Nstop, finePar.Nk, finePar.Nm,
|
||||
finePar.resid,finePar.MaxIt, finePar.betastp,
|
||||
finePar.MinRes);
|
||||
solver.testFine(finePar.resid*100.0);
|
||||
if (!par().output.empty())
|
||||
{
|
||||
LOG(Message) << "Performing fine grid IRL -- Nstop= "
|
||||
<< finePar.Nstop << ", Nk= " << finePar.Nk << ", Nm= "
|
||||
<< finePar.Nm << std::endl;
|
||||
solver.calcFine(finePar.Cheby, finePar.Nstop, finePar.Nk, finePar.Nm,
|
||||
finePar.resid,finePar.MaxIt, finePar.betastp,
|
||||
finePar.MinRes);
|
||||
solver.testFine(finePar.resid*100.0);
|
||||
LOG(Message) << "Orthogonalising" << std::endl;
|
||||
solver.Orthogonalise();
|
||||
if (!par().output.empty())
|
||||
{
|
||||
fine.write(par().output + "_fine");
|
||||
}
|
||||
epack.writeFine(par().output, vm().getTrajectory());
|
||||
}
|
||||
if (par().doCoarse)
|
||||
{
|
||||
LOG(Message) << "Orthogonalising" << std::endl;
|
||||
solver.Orthogonalise();
|
||||
LOG(Message) << "Performing coarse grid IRL -- Nstop= "
|
||||
<< coarsePar.Nstop << ", Nk= " << coarsePar.Nk << ", Nm= "
|
||||
<< coarsePar.Nm << std::endl;
|
||||
<< coarsePar.Nstop << ", Nk= " << coarsePar.Nk << ", Nm= "
|
||||
<< coarsePar.Nm << std::endl;
|
||||
solver.calcCoarse(coarsePar.Cheby, par().smoother, par().coarseRelaxTol,
|
||||
coarsePar.Nstop, coarsePar.Nk, coarsePar.Nm,
|
||||
coarsePar.Nstop, coarsePar.Nk, coarsePar.Nm,
|
||||
coarsePar.resid, coarsePar.MaxIt, coarsePar.betastp,
|
||||
coarsePar.MinRes);
|
||||
solver.testCoarse(coarsePar.resid*100.0, par().smoother,
|
||||
par().coarseRelaxTol);
|
||||
par().coarseRelaxTol);
|
||||
if (!par().output.empty())
|
||||
{
|
||||
coarse.write(par().output + "_coarse");
|
||||
epack.writeCoarse(par().output, vm().getTrajectory());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
36
extras/Hadrons/Modules/MSolver/RBPrecCG.cc
Normal file
36
extras/Hadrons/Modules/MSolver/RBPrecCG.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSolver/RBPrecCG.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSolver/RBPrecCG.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSolver;
|
||||
|
||||
template class Grid::Hadrons::MSolver::TRBPrecCG<FIMPL,HADRONS_DEFAULT_LANCZOS_NBASIS>;
|
||||
template class Grid::Hadrons::MSolver::TRBPrecCG<ZFIMPL,HADRONS_DEFAULT_LANCZOS_NBASIS>;
|
||||
|
@@ -32,6 +32,7 @@ See the full license in the file "LICENSE" in the top level distribution directo
|
||||
#include <Grid/Hadrons/Global.hpp>
|
||||
#include <Grid/Hadrons/Module.hpp>
|
||||
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||
#include <Grid/Hadrons/EigenPack.hpp>
|
||||
|
||||
BEGIN_HADRONS_NAMESPACE
|
||||
|
||||
@@ -44,21 +45,29 @@ class RBPrecCGPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(RBPrecCGPar ,
|
||||
std::string , action,
|
||||
unsigned int , maxIteration,
|
||||
double , residual);
|
||||
std::string , action,
|
||||
unsigned int, maxIteration,
|
||||
double , residual,
|
||||
std::string , eigenPack);
|
||||
};
|
||||
|
||||
template <typename FImpl>
|
||||
template <typename FImpl, int nBasis>
|
||||
class TRBPrecCG: public Module<RBPrecCGPar>
|
||||
{
|
||||
public:
|
||||
FGS_TYPE_ALIASES(FImpl,);
|
||||
typedef FermionEigenPack<FImpl> EPack;
|
||||
typedef CoarseFermionEigenPack<FImpl, nBasis> CoarseEPack;
|
||||
typedef std::shared_ptr<Guesser<FermionField>> GuesserPt;
|
||||
typedef DeflatedGuesser<typename FImpl::FermionField> FineGuesser;
|
||||
typedef LocalCoherenceDeflatedGuesser<
|
||||
typename FImpl::FermionField,
|
||||
typename CoarseEPack::CoarseField> CoarseGuesser;
|
||||
public:
|
||||
// constructor
|
||||
TRBPrecCG(const std::string name);
|
||||
// destructor
|
||||
virtual ~TRBPrecCG(void) = default;
|
||||
virtual ~TRBPrecCG(void) {};
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getReference(void);
|
||||
@@ -70,37 +79,42 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(RBPrecCG, TRBPrecCG<FIMPL>, MSolver);
|
||||
MODULE_REGISTER_NS(ZRBPrecCG, TRBPrecCG<ZFIMPL>, MSolver);
|
||||
MODULE_REGISTER_TMP(RBPrecCG, ARG(TRBPrecCG<FIMPL, HADRONS_DEFAULT_LANCZOS_NBASIS>), MSolver);
|
||||
MODULE_REGISTER_TMP(ZRBPrecCG, ARG(TRBPrecCG<ZFIMPL, HADRONS_DEFAULT_LANCZOS_NBASIS>), MSolver);
|
||||
|
||||
/******************************************************************************
|
||||
* TRBPrecCG template implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
TRBPrecCG<FImpl>::TRBPrecCG(const std::string name)
|
||||
template <typename FImpl, int nBasis>
|
||||
TRBPrecCG<FImpl, nBasis>::TRBPrecCG(const std::string name)
|
||||
: Module(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
std::vector<std::string> TRBPrecCG<FImpl>::getInput(void)
|
||||
template <typename FImpl, int nBasis>
|
||||
std::vector<std::string> TRBPrecCG<FImpl, nBasis>::getInput(void)
|
||||
{
|
||||
std::vector<std::string> in = {};
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
template <typename FImpl>
|
||||
std::vector<std::string> TRBPrecCG<FImpl>::getReference(void)
|
||||
template <typename FImpl, int nBasis>
|
||||
std::vector<std::string> TRBPrecCG<FImpl, nBasis>::getReference(void)
|
||||
{
|
||||
std::vector<std::string> ref = {par().action};
|
||||
|
||||
if (!par().eigenPack.empty())
|
||||
{
|
||||
ref.push_back(par().eigenPack);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
template <typename FImpl>
|
||||
std::vector<std::string> TRBPrecCG<FImpl>::getOutput(void)
|
||||
template <typename FImpl, int nBasis>
|
||||
std::vector<std::string> TRBPrecCG<FImpl, nBasis>::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
@@ -108,8 +122,8 @@ std::vector<std::string> TRBPrecCG<FImpl>::getOutput(void)
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
void TRBPrecCG<FImpl>::setup(void)
|
||||
template <typename FImpl, int nBasis>
|
||||
void TRBPrecCG<FImpl, nBasis>::setup(void)
|
||||
{
|
||||
if (par().maxIteration == 0)
|
||||
{
|
||||
@@ -121,23 +135,53 @@ void TRBPrecCG<FImpl>::setup(void)
|
||||
<< par().residual << ", maximum iteration "
|
||||
<< par().maxIteration << std::endl;
|
||||
|
||||
auto Ls = env().getObjectLs(par().action);
|
||||
auto &mat = envGet(FMat, par().action);
|
||||
auto solver = [&mat, this](FermionField &sol, const FermionField &source)
|
||||
auto Ls = env().getObjectLs(par().action);
|
||||
auto &mat = envGet(FMat, par().action);
|
||||
std::string guesserName = getName() + "_guesser";
|
||||
GuesserPt guesser{nullptr};
|
||||
|
||||
if (par().eigenPack.empty())
|
||||
{
|
||||
guesser.reset(new ZeroGuesser<FermionField>());
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
auto &epack = envGetDerived(EPack, CoarseEPack, par().eigenPack);
|
||||
|
||||
LOG(Message) << "using low-mode deflation with coarse eigenpack '"
|
||||
<< par().eigenPack << "' ("
|
||||
<< epack.evecCoarse.size() << " modes)" << std::endl;
|
||||
guesser.reset(new CoarseGuesser(epack.evec, epack.evecCoarse,
|
||||
epack.evalCoarse));
|
||||
}
|
||||
catch (Exceptions::Definition &e)
|
||||
{
|
||||
auto &epack = envGet(EPack, par().eigenPack);
|
||||
|
||||
LOG(Message) << "using low-mode deflation with eigenpack '"
|
||||
<< par().eigenPack << "' ("
|
||||
<< epack.evec.size() << " modes)" << std::endl;
|
||||
guesser.reset(new FineGuesser(epack.evec, epack.eval));
|
||||
}
|
||||
}
|
||||
auto solver = [&mat, guesser, this](FermionField &sol,
|
||||
const FermionField &source)
|
||||
{
|
||||
ConjugateGradient<FermionField> cg(par().residual,
|
||||
par().maxIteration);
|
||||
HADRONS_DEFAULT_SCHUR_SOLVE<FermionField> schurSolver(cg);
|
||||
|
||||
schurSolver(mat, source, sol);
|
||||
schurSolver(mat, source, sol, *guesser);
|
||||
};
|
||||
envCreate(SolverFn, getName(), Ls, solver);
|
||||
}
|
||||
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
void TRBPrecCG<FImpl>::execute(void)
|
||||
template <typename FImpl, int nBasis>
|
||||
void TRBPrecCG<FImpl, nBasis>::execute(void)
|
||||
{}
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
36
extras/Hadrons/Modules/MSource/Point.cc
Normal file
36
extras/Hadrons/Modules/MSource/Point.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSource/Point.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSource/Point.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSource;
|
||||
|
||||
template class Grid::Hadrons::MSource::TPoint<FIMPL>;
|
||||
template class Grid::Hadrons::MSource::TPoint<ScalarImplCR>;
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
// constructor
|
||||
TPoint(const std::string name);
|
||||
// destructor
|
||||
virtual ~TPoint(void) = default;
|
||||
virtual ~TPoint(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -79,8 +79,8 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Point, TPoint<FIMPL>, MSource);
|
||||
MODULE_REGISTER_NS(ScalarPoint, TPoint<ScalarImplCR>, MSource);
|
||||
MODULE_REGISTER_TMP(Point, TPoint<FIMPL>, MSource);
|
||||
MODULE_REGISTER_TMP(ScalarPoint, TPoint<ScalarImplCR>, MSource);
|
||||
|
||||
/******************************************************************************
|
||||
* TPoint template implementation *
|
||||
|
35
extras/Hadrons/Modules/MSource/SeqConserved.cc
Normal file
35
extras/Hadrons/Modules/MSource/SeqConserved.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSource/SeqConserved.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSource/SeqConserved.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSource;
|
||||
|
||||
template class Grid::Hadrons::MSource::TSeqConserved<FIMPL>;
|
||||
|
@@ -89,7 +89,7 @@ public:
|
||||
// constructor
|
||||
TSeqConserved(const std::string name);
|
||||
// destructor
|
||||
virtual ~TSeqConserved(void) = default;
|
||||
virtual ~TSeqConserved(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -103,7 +103,7 @@ private:
|
||||
std::string SeqmomphName_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(SeqConserved, TSeqConserved<FIMPL>, MSource);
|
||||
MODULE_REGISTER_TMP(SeqConserved, TSeqConserved<FIMPL>, MSource);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
35
extras/Hadrons/Modules/MSource/SeqGamma.cc
Normal file
35
extras/Hadrons/Modules/MSource/SeqGamma.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSource/SeqGamma.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSource/SeqGamma.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSource;
|
||||
|
||||
template class Grid::Hadrons::MSource::TSeqGamma<FIMPL>;
|
||||
|
@@ -76,7 +76,7 @@ public:
|
||||
// constructor
|
||||
TSeqGamma(const std::string name);
|
||||
// destructor
|
||||
virtual ~TSeqGamma(void) = default;
|
||||
virtual ~TSeqGamma(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
std::string momphName_, tName_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(SeqGamma, TSeqGamma<FIMPL>, MSource);
|
||||
MODULE_REGISTER_TMP(SeqGamma, TSeqGamma<FIMPL>, MSource);
|
||||
|
||||
/******************************************************************************
|
||||
* TSeqGamma implementation *
|
||||
|
35
extras/Hadrons/Modules/MSource/Wall.cc
Normal file
35
extras/Hadrons/Modules/MSource/Wall.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSource/Wall.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSource/Wall.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSource;
|
||||
|
||||
template class Grid::Hadrons::MSource::TWall<FIMPL>;
|
||||
|
@@ -70,7 +70,7 @@ public:
|
||||
// constructor
|
||||
TWall(const std::string name);
|
||||
// destructor
|
||||
virtual ~TWall(void) = default;
|
||||
virtual ~TWall(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -84,7 +84,7 @@ private:
|
||||
std::string momphName_, tName_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Wall, TWall<FIMPL>, MSource);
|
||||
MODULE_REGISTER_TMP(Wall, TWall<FIMPL>, MSource);
|
||||
|
||||
/******************************************************************************
|
||||
* TWall implementation *
|
||||
|
36
extras/Hadrons/Modules/MSource/Z2.cc
Normal file
36
extras/Hadrons/Modules/MSource/Z2.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MSource/Z2.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MSource/Z2.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MSource;
|
||||
|
||||
template class Grid::Hadrons::MSource::TZ2<FIMPL>;
|
||||
template class Grid::Hadrons::MSource::TZ2<ScalarImplCR>;
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
// constructor
|
||||
TZ2(const std::string name);
|
||||
// destructor
|
||||
virtual ~TZ2(void) = default;
|
||||
virtual ~TZ2(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -85,8 +85,8 @@ private:
|
||||
std::string tName_;
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(Z2, TZ2<FIMPL>, MSource);
|
||||
MODULE_REGISTER_NS(ScalarZ2, TZ2<ScalarImplCR>, MSource);
|
||||
MODULE_REGISTER_TMP(Z2, TZ2<FIMPL>, MSource);
|
||||
MODULE_REGISTER_TMP(ScalarZ2, TZ2<ScalarImplCR>, MSource);
|
||||
|
||||
/******************************************************************************
|
||||
* TZ2 template implementation *
|
||||
|
35
extras/Hadrons/Modules/MUtilities/TestSeqConserved.cc
Normal file
35
extras/Hadrons/Modules/MUtilities/TestSeqConserved.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MUtilities/TestSeqConserved.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MUtilities/TestSeqConserved.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MUtilities;
|
||||
|
||||
template class Grid::Hadrons::MUtilities::TTestSeqConserved<FIMPL>;
|
||||
|
@@ -77,7 +77,7 @@ public:
|
||||
// constructor
|
||||
TTestSeqConserved(const std::string name);
|
||||
// destructor
|
||||
virtual ~TTestSeqConserved(void) = default;
|
||||
virtual ~TTestSeqConserved(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -88,7 +88,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(TestSeqConserved, TTestSeqConserved<FIMPL>, MUtilities);
|
||||
MODULE_REGISTER_TMP(TestSeqConserved, TTestSeqConserved<FIMPL>, MUtilities);
|
||||
|
||||
/******************************************************************************
|
||||
* TTestSeqConserved implementation *
|
||||
|
35
extras/Hadrons/Modules/MUtilities/TestSeqGamma.cc
Normal file
35
extras/Hadrons/Modules/MUtilities/TestSeqGamma.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MUtilities/TestSeqGamma.cc
|
||||
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
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.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Hadrons/Modules/MUtilities/TestSeqGamma.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace MUtilities;
|
||||
|
||||
template class Grid::Hadrons::MUtilities::TTestSeqGamma<FIMPL>;
|
||||
|
@@ -61,7 +61,7 @@ public:
|
||||
// constructor
|
||||
TTestSeqGamma(const std::string name);
|
||||
// destructor
|
||||
virtual ~TTestSeqGamma(void) = default;
|
||||
virtual ~TTestSeqGamma(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -72,7 +72,7 @@ protected:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(TestSeqGamma, TTestSeqGamma<FIMPL>, MUtilities);
|
||||
MODULE_REGISTER_TMP(TestSeqGamma, TTestSeqGamma<FIMPL>, MUtilities);
|
||||
|
||||
/******************************************************************************
|
||||
* TTestSeqGamma implementation *
|
||||
|
@@ -1,39 +0,0 @@
|
||||
#include <Grid/Hadrons/Modules/___FILEBASENAME___.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
|
||||
/******************************************************************************
|
||||
* T___FILEBASENAME___ implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
T___FILEBASENAME___::T___FILEBASENAME___(const std::string name)
|
||||
: Module<___FILEBASENAME___Par>(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
std::vector<std::string> T___FILEBASENAME___::getInput(void)
|
||||
{
|
||||
std::vector<std::string> in;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
std::vector<std::string> T___FILEBASENAME___::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
void T___FILEBASENAME___::setup(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
void T___FILEBASENAME___::execute(void)
|
||||
{
|
||||
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
#ifndef Hadrons____FILEBASENAME____hpp_
|
||||
#define Hadrons____FILEBASENAME____hpp_
|
||||
|
||||
#include <Grid/Hadrons/Global.hpp>
|
||||
#include <Grid/Hadrons/Module.hpp>
|
||||
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||
|
||||
BEGIN_HADRONS_NAMESPACE
|
||||
|
||||
/******************************************************************************
|
||||
* ___FILEBASENAME___ *
|
||||
******************************************************************************/
|
||||
class ___FILEBASENAME___Par: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(___FILEBASENAME___Par,
|
||||
unsigned int, i);
|
||||
};
|
||||
|
||||
class T___FILEBASENAME___: public Module<___FILEBASENAME___Par>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
T___FILEBASENAME___(const std::string name);
|
||||
// destructor
|
||||
virtual ~T___FILEBASENAME___(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER(___FILEBASENAME___, T___FILEBASENAME___);
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
||||
#endif // Hadrons____FILEBASENAME____hpp_
|
@@ -25,7 +25,7 @@ public:
|
||||
// constructor
|
||||
T___FILEBASENAME___(const std::string name);
|
||||
// destructor
|
||||
virtual ~T___FILEBASENAME___(void) = default;
|
||||
virtual ~T___FILEBASENAME___(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(___FILEBASENAME___, T___FILEBASENAME___, ___NAMESPACE___);
|
||||
MODULE_REGISTER(___FILEBASENAME___, T___FILEBASENAME___, ___NAMESPACE___);
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
|
@@ -1,81 +0,0 @@
|
||||
#ifndef Hadrons____FILEBASENAME____hpp_
|
||||
#define Hadrons____FILEBASENAME____hpp_
|
||||
|
||||
#include <Grid/Hadrons/Global.hpp>
|
||||
#include <Grid/Hadrons/Module.hpp>
|
||||
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||
|
||||
BEGIN_HADRONS_NAMESPACE
|
||||
|
||||
/******************************************************************************
|
||||
* ___FILEBASENAME___ *
|
||||
******************************************************************************/
|
||||
class ___FILEBASENAME___Par: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(___FILEBASENAME___Par,
|
||||
unsigned int, i);
|
||||
};
|
||||
|
||||
template <typename FImpl>
|
||||
class T___FILEBASENAME___: public Module<___FILEBASENAME___Par>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
T___FILEBASENAME___(const std::string name);
|
||||
// destructor
|
||||
virtual ~T___FILEBASENAME___(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER(___FILEBASENAME___, T___FILEBASENAME___<FIMPL>);
|
||||
|
||||
/******************************************************************************
|
||||
* T___FILEBASENAME___ implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
T___FILEBASENAME___<FImpl>::T___FILEBASENAME___(const std::string name)
|
||||
: Module<___FILEBASENAME___Par>(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
std::vector<std::string> T___FILEBASENAME___<FImpl>::getInput(void)
|
||||
{
|
||||
std::vector<std::string> in;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
template <typename FImpl>
|
||||
std::vector<std::string> T___FILEBASENAME___<FImpl>::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
void T___FILEBASENAME___<FImpl>::setup(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
void T___FILEBASENAME___<FImpl>::execute(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
||||
#endif // Hadrons____FILEBASENAME____hpp_
|
@@ -0,0 +1,7 @@
|
||||
#include <Grid/Hadrons/Modules/___NAMESPACE___/___FILEBASENAME___.hpp>
|
||||
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
using namespace ___NAMESPACE___;
|
||||
|
||||
template class Grid::Hadrons::___NAMESPACE___::T___FILEBASENAME___<FIMPL>;
|
@@ -26,7 +26,7 @@ public:
|
||||
// constructor
|
||||
T___FILEBASENAME___(const std::string name);
|
||||
// destructor
|
||||
virtual ~T___FILEBASENAME___(void) = default;
|
||||
virtual ~T___FILEBASENAME___(void) {};
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(___FILEBASENAME___, T___FILEBASENAME___<FIMPL>, ___NAMESPACE___);
|
||||
MODULE_REGISTER_TMP(___FILEBASENAME___, T___FILEBASENAME___<FIMPL>, ___NAMESPACE___);
|
||||
|
||||
/******************************************************************************
|
||||
* T___FILEBASENAME___ implementation *
|
||||
|
Reference in New Issue
Block a user