mirror of
https://github.com/paboyle/Grid.git
synced 2025-08-03 21:27:07 +01:00
Unified integrator and integrator algorithm into virtual class used as a policy for the
HMC.
This commit is contained in:
@@ -7,16 +7,15 @@ template<class GaugeField>
|
||||
class Action {
|
||||
|
||||
public:
|
||||
virtual void init (const GaugeField &U, GridParallelRNG& pRNG) = 0; //
|
||||
// Boundary conditions? // Heatbath?
|
||||
virtual void refresh(const GaugeField &U, GridParallelRNG& pRNG) = 0;// refresh pseudofermions
|
||||
virtual RealD S (const GaugeField &U) = 0; // evaluate the action
|
||||
virtual void deriv(const GaugeField &U,GaugeField & dSdU ) = 0; // evaluate the action derivative
|
||||
virtual void refresh(const GaugeField & ) {}; // Default to no-op for actions with no internal fields
|
||||
// Boundary conditions?
|
||||
// Heatbath?
|
||||
virtual ~Action() {};
|
||||
};
|
||||
|
||||
// Could derive PseudoFermion action with a PF field, FermionField, and a Grid; implement refresh
|
||||
/*
|
||||
template<class GaugeField, class FermionField>
|
||||
class PseudoFermionAction : public Action<GaugeField> {
|
||||
public:
|
||||
@@ -32,5 +31,28 @@ class PseudoFermionAction : public Action<GaugeField> {
|
||||
};
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
template<class GaugeField> struct ActionLevel{
|
||||
public:
|
||||
|
||||
typedef Action<GaugeField>* ActPtr; // now force the same colours as the rest of the code
|
||||
|
||||
int multiplier;
|
||||
|
||||
std::vector<ActPtr> actions;
|
||||
|
||||
ActionLevel(int mul = 1) : multiplier(mul) {
|
||||
assert (mul > 0);
|
||||
};
|
||||
|
||||
void push_back(ActPtr ptr){
|
||||
actions.push_back(ptr);
|
||||
}
|
||||
};
|
||||
|
||||
template<class GaugeField> using ActionSet = std::vector<ActionLevel< GaugeField > >;
|
||||
|
||||
|
||||
}}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user