openmm / openmm-plumed

OpenMM plugin to interface with PLUMED
55 stars 23 forks source link

Implement setLogStream and getLogStream #25

Closed raimis closed 4 years ago

raimis commented 4 years ago

PLUMED writes the log to stdout by default, but It can be changed via its API (https://www.plumed.org/doc-v2.6/developer-doc/html/_how_to_plumed_your_m_d.html):

plumed_cmd(plumedmain, "setLog", stream);

This PR implements a corresponding functionality for OpenMM-PLUMED API:

void PlumedForce::setLogStream(FILE* stream);
FILE* PlumedForce::getLogStream() const;
peastman commented 4 years ago

Looks good. Do you need to

#include <cstdio>

at the top of PlumedForce.h? That's where FILE is defined. Without that, this might fail to compile on some compilers.

raimis commented 4 years ago

Good point! Added the header.

peastman commented 4 years ago

Looks good, thanks!