#include "gromacs/topology/mtop_util.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/logger.h"
#include "gromacs/utility/smalloc.h"
-static void low_mspeed(real tempi, gmx_mtop_t* mtop, rvec v[], gmx::ThreeFry2x64<>* rng)
+static void low_mspeed(real tempi, gmx_mtop_t* mtop, rvec v[], gmx::ThreeFry2x64<>* rng, const gmx::MDLogger& logger)
{
int nrdf;
real boltz;
}
}
}
- fprintf(stderr, "Velocities were taken from a Maxwell distribution at %g K\n", tempi);
+ GMX_LOG(logger.info)
+ .asParagraph()
+ .appendTextFormatted("Velocities were taken from a Maxwell distribution at %g K", tempi);
if (debug)
{
fprintf(debug,
}
}
-void maxwell_speed(real tempi, unsigned int seed, gmx_mtop_t* mtop, rvec v[])
+void maxwell_speed(real tempi, unsigned int seed, gmx_mtop_t* mtop, rvec v[], const gmx::MDLogger& logger)
{
if (seed == 0)
{
seed = static_cast<int>(gmx::makeRandomSeed());
- fprintf(stderr, "Using random seed %u for generating velocities\n", seed);
+ GMX_LOG(logger.info)
+ .asParagraph()
+ .appendTextFormatted("Using random seed %u for generating velocities", seed);
}
gmx::ThreeFry2x64<> rng(seed, gmx::RandomDomain::MaxwellVelocities);
- low_mspeed(tempi, mtop, v, &rng);
+ low_mspeed(tempi, mtop, v, &rng, logger);
}
static real calc_cm(int natoms, const real mass[], rvec x[], rvec v[], rvec xcm, rvec vcm, rvec acm, matrix L)
return tm;
}
-void stop_cm(FILE gmx_unused* log, int natoms, real mass[], rvec x[], rvec v[])
+void stop_cm(const gmx::MDLogger gmx_unused& logger, int natoms, real mass[], rvec x[], rvec v[])
{
rvec xcm, vcm, acm;
tensor L;
int i, m;
#ifdef DEBUG
- fprintf(log, "stopping center of mass motion...\n");
+ GMX_LOG(logger.info).asParagraph().appendTextFormatted("stopping center of mass motion...");
#endif
(void)calc_cm(natoms, mass, x, v, xcm, vcm, acm, L);
v[i][m] -= vcm[m];
}
}
-
-#ifdef DEBUG
- (void)calc_cm(log, natoms, mass, x, v, xcm, vcm, acm, L);
-#endif
}