mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-18 15:57:05 +01:00
Fixed seg fault for observable modules
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: ./lib/qcd/modules/Registration.h
|
||||
Source file: ./lib/qcd/modules/plaquette.h
|
||||
|
||||
Copyright (C) 2017
|
||||
|
||||
@ -43,41 +43,25 @@ class PlaquetteLogger : public HmcObservable<typename Impl::Field> {
|
||||
// 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
|
||||
explicit PlaquetteLogger(std::string cf) { Stem = cf; }
|
||||
|
||||
// necessary for HmcObservable compatibility
|
||||
typedef typename Impl::Field Field;
|
||||
|
||||
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 plaq = WilsonLoops<Impl>::avgPlaquette(U);
|
||||
|
||||
RealD impl_plaq = WilsonLoops<Impl>::avgPlaquette(U);
|
||||
RealD impl_rect = WilsonLoops<Impl>::avgRectangle(U);
|
||||
int def_prec = std::cout.precision();
|
||||
|
||||
std::cout << GridLogMessage
|
||||
<< std::setprecision(std::numeric_limits<Real>::digits10 + 1)
|
||||
<< "Plaquette: [ " << traj << " ] "<< plaq << std::endl;
|
||||
|
||||
std::cout.precision(def_prec);
|
||||
|
||||
// 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;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user