mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-14 09:45:36 +00:00
Small cleanup of the observables
This commit is contained in:
parent
b640230b1e
commit
6d1e9e5f92
@ -89,65 +89,6 @@ struct HMCparameters: Serializable {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
// Move this to a different file
|
|
||||||
template <class Field>
|
|
||||||
class HmcObservable {
|
|
||||||
public:
|
|
||||||
virtual void TrajectoryComplete(int traj, Field &U, GridSerialRNG &sRNG,
|
|
||||||
GridParallelRNG &pRNG) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
// this is only defined for a gauge theory
|
|
||||||
template <class Impl>
|
|
||||||
class PlaquetteLogger : public HmcObservable<typename Impl::Field> {
|
|
||||||
private:
|
|
||||||
std::string Stem;
|
|
||||||
|
|
||||||
public:
|
|
||||||
// here forces the Impl to be of gauge fields
|
|
||||||
// if not the compiler will complain
|
|
||||||
INHERIT_GIMPL_TYPES(Impl);
|
|
||||||
typedef typename Impl::Field Field; // necessary for HmcObservable compatibility
|
|
||||||
PlaquetteLogger(std::string cf) { Stem = cf; };
|
|
||||||
|
|
||||||
void TrajectoryComplete(int traj,
|
|
||||||
Field &U,
|
|
||||||
GridSerialRNG &sRNG,
|
|
||||||
GridParallelRNG &pRNG) {
|
|
||||||
std::string file;
|
|
||||||
{
|
|
||||||
std::ostringstream os;
|
|
||||||
os << Stem << "." << traj;
|
|
||||||
file = os.str();
|
|
||||||
}
|
|
||||||
std::ofstream of(file);
|
|
||||||
|
|
||||||
RealD peri_plaq = WilsonLoops<PeriodicGimplR>::avgPlaquette(U);
|
|
||||||
RealD peri_rect = WilsonLoops<PeriodicGimplR>::avgRectangle(U);
|
|
||||||
|
|
||||||
RealD impl_plaq = WilsonLoops<Impl>::avgPlaquette(U);
|
|
||||||
RealD impl_rect = WilsonLoops<Impl>::avgRectangle(U);
|
|
||||||
|
|
||||||
// Fixme reorganise this output
|
|
||||||
of << traj << " " << impl_plaq << " " << impl_rect << " " << peri_plaq
|
|
||||||
<< " " << peri_rect << std::endl;
|
|
||||||
std::cout << GridLogMessage << "traj"
|
|
||||||
<< " "
|
|
||||||
<< "plaq "
|
|
||||||
<< " "
|
|
||||||
<< " rect "
|
|
||||||
<< " "
|
|
||||||
<< "peri_plaq"
|
|
||||||
<< " "
|
|
||||||
<< "peri_rect" << std::endl;
|
|
||||||
std::cout << GridLogMessage << traj << " " << impl_plaq << " " << impl_rect
|
|
||||||
<< " " << peri_plaq << " " << peri_rect << std::endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//////////////////////////////////////////////////////////////
|
|
||||||
*/
|
|
||||||
|
|
||||||
template <class IntegratorType>
|
template <class IntegratorType>
|
||||||
class HybridMonteCarlo {
|
class HybridMonteCarlo {
|
||||||
private:
|
private:
|
||||||
|
@ -44,7 +44,7 @@ class PlaquetteLogger : public HmcObservable<typename Impl::Field> {
|
|||||||
// if not the compiler will complain
|
// if not the compiler will complain
|
||||||
INHERIT_GIMPL_TYPES(Impl);
|
INHERIT_GIMPL_TYPES(Impl);
|
||||||
typedef typename Impl::Field Field; // necessary for HmcObservable compatibility
|
typedef typename Impl::Field Field; // necessary for HmcObservable compatibility
|
||||||
PlaquetteLogger(std::string cf) { Stem = cf; };
|
explicit PlaquetteLogger(std::string cf) { Stem = cf; }
|
||||||
|
|
||||||
void TrajectoryComplete(int traj,
|
void TrajectoryComplete(int traj,
|
||||||
Field &U,
|
Field &U,
|
||||||
@ -80,7 +80,6 @@ class PlaquetteLogger : public HmcObservable<typename Impl::Field> {
|
|||||||
<< " " << peri_plaq << " " << peri_rect << std::endl;
|
<< " " << peri_plaq << " " << peri_rect << std::endl;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
} // namespace QCD
|
} // namespace QCD
|
||||||
} // namespace Grid
|
} // namespace Grid
|
||||||
|
Loading…
Reference in New Issue
Block a user