1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 17:25:37 +01:00

Namespace

This commit is contained in:
paboyle 2018-01-14 22:19:25 +00:00
parent df29cc19ab
commit 56e87d6e55

View File

@ -25,11 +25,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
See the full license in the file "LICENSE" in the top level distribution See the full license in the file "LICENSE" in the top level distribution
directory directory
*************************************************************************************/ *************************************************************************************/
/* END LEGAL */ /* END LEGAL */
#ifndef SOLVER_MODULES_H #ifndef SOLVER_MODULES_H
#define SOLVER_MODULES_H #define SOLVER_MODULES_H
namespace Grid { NAMESPACE_BEGIN(Grid);
////////////////////////////////////////////// //////////////////////////////////////////////
// Operator Functions (Solvers) // Operator Functions (Solvers)
@ -37,9 +37,9 @@ namespace Grid {
template <template <typename> class SolverType, class Field, class SPar> template <template <typename> class SolverType, class Field, class SPar>
class SolverModule class SolverModule
: public Parametrized<SPar>, : public Parametrized<SPar>,
public HMCModuleBase<OperatorFunction<Field> > { public HMCModuleBase<OperatorFunction<Field> > {
public: public:
typedef HMCModuleBase< OperatorFunction<Field> > Base; typedef HMCModuleBase< OperatorFunction<Field> > Base;
typedef typename Base::Product Product; typedef typename Base::Product Product;
@ -60,7 +60,7 @@ class SolverModule
return SolverPtr.get(); return SolverPtr.get();
} }
private: private:
virtual void initialize() = 0; virtual void initialize() = 0;
}; };
@ -68,8 +68,8 @@ class SolverModule
// Factory // Factory
template <char const *str, class Field, class ReaderClass > template <char const *str, class Field, class ReaderClass >
class HMC_SolverModuleFactory class HMC_SolverModuleFactory
: public Factory < HMCModuleBase<OperatorFunction<Field> > , Reader<ReaderClass> > { : public Factory < HMCModuleBase<OperatorFunction<Field> > , Reader<ReaderClass> > {
public: public:
// use SINGLETON FUNCTOR MACRO HERE // use SINGLETON FUNCTOR MACRO HERE
typedef Reader<ReaderClass> TheReader; typedef Reader<ReaderClass> TheReader;
@ -80,20 +80,20 @@ class HMC_SolverModuleFactory
return e; return e;
} }
private: private:
HMC_SolverModuleFactory(void) = default; HMC_SolverModuleFactory(void) = default;
std::string obj_type() const { std::string obj_type() const {
return std::string(str); return std::string(str);
} }
}; };
class SolverParameters : Serializable { class SolverParameters : Serializable {
public: public:
GRID_SERIALIZABLE_CLASS_MEMBERS(SolverParameters, GRID_SERIALIZABLE_CLASS_MEMBERS(SolverParameters,
RealD, tolerance, RealD, tolerance,
RealD, max_iterations); RealD, max_iterations);
// add error on no convergence? // add error on no convergence?
}; };
@ -101,8 +101,8 @@ class SolverParameters : Serializable {
class SolverObjName: Serializable { class SolverObjName: Serializable {
public: public:
GRID_SERIALIZABLE_CLASS_MEMBERS(SolverObjName, GRID_SERIALIZABLE_CLASS_MEMBERS(SolverObjName,
std::string, name, std::string, name,
SolverParameters, parameters); SolverParameters, parameters);
}; };
@ -132,7 +132,7 @@ class ConjugateResidualModule: public SolverModule<ConjugateResidual, Field, Sol
}; };
extern char solver_string[]; extern char solver_string[];
} // Grid
NAMESPACE_END(Grid);
#endif //SOLVER_MODULES_H #endif //SOLVER_MODULES_H