1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-10 14:10:46 +01:00

Hadrons: solver renaming

This commit is contained in:
Antonin Portelli 2016-05-03 18:16:57 -07:00
parent 8b313a35ac
commit b865dd9da8
3 changed files with 20 additions and 17 deletions

View File

@ -32,6 +32,6 @@ Hadrons_SOURCES += \
# solver modules
Hadrons_SOURCES += \
SRBPrecCG.cc
SolRBPrecCG.cc
Hadrons_LDADD = -lGrid

View File

@ -1,7 +1,7 @@
/*******************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: programs/Hadrons/SRBPrecCG.cc
Source file: programs/Hadrons/SolRBPrecCG.cc
Copyright (C) 2016
@ -25,35 +25,35 @@ See the full license in the file "LICENSE" in the top level distribution
directory.
*******************************************************************************/
#include <Hadrons/SRBPrecCG.hpp>
#include <Hadrons/SolRBPrecCG.hpp>
using namespace Grid;
using namespace QCD;
using namespace Hadrons;
/******************************************************************************
* SRBPrecCG implementation *
* SolRBPrecCG implementation *
******************************************************************************/
// constructor /////////////////////////////////////////////////////////////////
SRBPrecCG::SRBPrecCG(const std::string name)
SolRBPrecCG::SolRBPrecCG(const std::string name)
: Module(name)
{}
// parse parameters ////////////////////////////////////////////////////////////
void SRBPrecCG::parseParameters(XmlReader &reader, const std::string name)
void SolRBPrecCG::parseParameters(XmlReader &reader, const std::string name)
{
read(reader, name, par_);
}
// dependencies/products ///////////////////////////////////////////////////////
std::vector<std::string> SRBPrecCG::getInput(void)
std::vector<std::string> SolRBPrecCG::getInput(void)
{
std::vector<std::string> in = {par_.action};
return in;
}
std::vector<std::string> SRBPrecCG::getOutput(void)
std::vector<std::string> SolRBPrecCG::getOutput(void)
{
std::vector<std::string> out = {getName()};
@ -61,7 +61,7 @@ std::vector<std::string> SRBPrecCG::getOutput(void)
}
// execution ///////////////////////////////////////////////////////////////////
void SRBPrecCG::execute(Environment &env)
void SolRBPrecCG::execute(Environment &env)
{
auto &mat = *(env.getFermionMatrix(par_.action));
auto solver = [&mat, this](LatticeFermion &sol,
@ -73,5 +73,8 @@ void SRBPrecCG::execute(Environment &env)
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);
}

View File

@ -1,7 +1,7 @@
/*******************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: programs/Hadrons/SRBPrecCG.hpp
Source file: programs/Hadrons/SolRBPrecCG.hpp
Copyright (C) 2016
@ -25,8 +25,8 @@ See the full license in the file "LICENSE" in the top level distribution
directory.
*******************************************************************************/
#ifndef Hadrons_SRBPrecCG_hpp_
#define Hadrons_SRBPrecCG_hpp_
#ifndef Hadrons_SolRBPrecCG_hpp_
#define Hadrons_SolRBPrecCG_hpp_
#include <Hadrons/Global.hpp>
#include <Hadrons/Module.hpp>
@ -37,7 +37,7 @@ BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Schur red-black preconditioned CG *
******************************************************************************/
class SRBPrecCG: public Module
class SolRBPrecCG: public Module
{
public:
class Par: Serializable
@ -48,9 +48,9 @@ public:
};
public:
// constructor
SRBPrecCG(const std::string name);
SolRBPrecCG(const std::string name);
// destructor
virtual ~SRBPrecCG(void) = default;
virtual ~SolRBPrecCG(void) = default;
// parse parameters
virtual void parseParameters(XmlReader &reader, const std::string name);
// dependencies/products
@ -62,8 +62,8 @@ private:
Par par_;
};
MODULE_REGISTER(SRBPrecCG);
MODULE_REGISTER(SolRBPrecCG);
END_HADRONS_NAMESPACE
#endif // Hadrons_SRBPrecCG_hpp_
#endif // Hadrons_SolRBPrecCG_hpp_