mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Hadrons: solver renaming
This commit is contained in:
parent
8b313a35ac
commit
b865dd9da8
@ -32,6 +32,6 @@ Hadrons_SOURCES += \
|
|||||||
|
|
||||||
# solver modules
|
# solver modules
|
||||||
Hadrons_SOURCES += \
|
Hadrons_SOURCES += \
|
||||||
SRBPrecCG.cc
|
SolRBPrecCG.cc
|
||||||
|
|
||||||
Hadrons_LDADD = -lGrid
|
Hadrons_LDADD = -lGrid
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
Grid physics library, www.github.com/paboyle/Grid
|
Grid physics library, www.github.com/paboyle/Grid
|
||||||
|
|
||||||
Source file: programs/Hadrons/SRBPrecCG.cc
|
Source file: programs/Hadrons/SolRBPrecCG.cc
|
||||||
|
|
||||||
Copyright (C) 2016
|
Copyright (C) 2016
|
||||||
|
|
||||||
@ -25,35 +25,35 @@ See the full license in the file "LICENSE" in the top level distribution
|
|||||||
directory.
|
directory.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include <Hadrons/SRBPrecCG.hpp>
|
#include <Hadrons/SolRBPrecCG.hpp>
|
||||||
|
|
||||||
using namespace Grid;
|
using namespace Grid;
|
||||||
using namespace QCD;
|
using namespace QCD;
|
||||||
using namespace Hadrons;
|
using namespace Hadrons;
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* SRBPrecCG implementation *
|
* SolRBPrecCG implementation *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
// constructor /////////////////////////////////////////////////////////////////
|
// constructor /////////////////////////////////////////////////////////////////
|
||||||
SRBPrecCG::SRBPrecCG(const std::string name)
|
SolRBPrecCG::SolRBPrecCG(const std::string name)
|
||||||
: Module(name)
|
: Module(name)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// parse parameters ////////////////////////////////////////////////////////////
|
// parse parameters ////////////////////////////////////////////////////////////
|
||||||
void SRBPrecCG::parseParameters(XmlReader &reader, const std::string name)
|
void SolRBPrecCG::parseParameters(XmlReader &reader, const std::string name)
|
||||||
{
|
{
|
||||||
read(reader, name, par_);
|
read(reader, name, par_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// dependencies/products ///////////////////////////////////////////////////////
|
// dependencies/products ///////////////////////////////////////////////////////
|
||||||
std::vector<std::string> SRBPrecCG::getInput(void)
|
std::vector<std::string> SolRBPrecCG::getInput(void)
|
||||||
{
|
{
|
||||||
std::vector<std::string> in = {par_.action};
|
std::vector<std::string> in = {par_.action};
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> SRBPrecCG::getOutput(void)
|
std::vector<std::string> SolRBPrecCG::getOutput(void)
|
||||||
{
|
{
|
||||||
std::vector<std::string> out = {getName()};
|
std::vector<std::string> out = {getName()};
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ std::vector<std::string> SRBPrecCG::getOutput(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// execution ///////////////////////////////////////////////////////////////////
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
void SRBPrecCG::execute(Environment &env)
|
void SolRBPrecCG::execute(Environment &env)
|
||||||
{
|
{
|
||||||
auto &mat = *(env.getFermionMatrix(par_.action));
|
auto &mat = *(env.getFermionMatrix(par_.action));
|
||||||
auto solver = [&mat, this](LatticeFermion &sol,
|
auto solver = [&mat, this](LatticeFermion &sol,
|
||||||
@ -73,5 +73,8 @@ void SRBPrecCG::execute(Environment &env)
|
|||||||
schurSolver(mat, source, sol);
|
schurSolver(mat, source, sol);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
LOG(Message) << "setting up Schur red-black preconditioned CG for"
|
||||||
|
<< " action '" << par_.action << "' with residual "
|
||||||
|
<< par_.residual << std::endl;
|
||||||
env.addSolver(getName(), solver, par_.action);
|
env.addSolver(getName(), solver, par_.action);
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
Grid physics library, www.github.com/paboyle/Grid
|
Grid physics library, www.github.com/paboyle/Grid
|
||||||
|
|
||||||
Source file: programs/Hadrons/SRBPrecCG.hpp
|
Source file: programs/Hadrons/SolRBPrecCG.hpp
|
||||||
|
|
||||||
Copyright (C) 2016
|
Copyright (C) 2016
|
||||||
|
|
||||||
@ -25,8 +25,8 @@ See the full license in the file "LICENSE" in the top level distribution
|
|||||||
directory.
|
directory.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#ifndef Hadrons_SRBPrecCG_hpp_
|
#ifndef Hadrons_SolRBPrecCG_hpp_
|
||||||
#define Hadrons_SRBPrecCG_hpp_
|
#define Hadrons_SolRBPrecCG_hpp_
|
||||||
|
|
||||||
#include <Hadrons/Global.hpp>
|
#include <Hadrons/Global.hpp>
|
||||||
#include <Hadrons/Module.hpp>
|
#include <Hadrons/Module.hpp>
|
||||||
@ -37,7 +37,7 @@ BEGIN_HADRONS_NAMESPACE
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Schur red-black preconditioned CG *
|
* Schur red-black preconditioned CG *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
class SRBPrecCG: public Module
|
class SolRBPrecCG: public Module
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class Par: Serializable
|
class Par: Serializable
|
||||||
@ -48,9 +48,9 @@ public:
|
|||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
// constructor
|
// constructor
|
||||||
SRBPrecCG(const std::string name);
|
SolRBPrecCG(const std::string name);
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~SRBPrecCG(void) = default;
|
virtual ~SolRBPrecCG(void) = default;
|
||||||
// parse parameters
|
// parse parameters
|
||||||
virtual void parseParameters(XmlReader &reader, const std::string name);
|
virtual void parseParameters(XmlReader &reader, const std::string name);
|
||||||
// dependencies/products
|
// dependencies/products
|
||||||
@ -62,8 +62,8 @@ private:
|
|||||||
Par par_;
|
Par par_;
|
||||||
};
|
};
|
||||||
|
|
||||||
MODULE_REGISTER(SRBPrecCG);
|
MODULE_REGISTER(SolRBPrecCG);
|
||||||
|
|
||||||
END_HADRONS_NAMESPACE
|
END_HADRONS_NAMESPACE
|
||||||
|
|
||||||
#endif // Hadrons_SRBPrecCG_hpp_
|
#endif // Hadrons_SolRBPrecCG_hpp_
|
Loading…
x
Reference in New Issue
Block a user