Gromacs
2016.6
|
#include <programs/mdrun/tests/mdruncomparisonfixture.h>
Declares abstract base text fixture class for integration tests of mdrun functionality that will compare multiple calls to mdrun.
An internal database of several kinds of simulation useful for such comparisons is available.
Any method in this class may throw std::bad_alloc if out of memory.
Public Types | |
typedef std::map< std::string, std::string > | MdpFieldValues |
Helper typedef. | |
Public Member Functions | |
virtual | ~MdrunComparisonFixture () |
Destructor. | |
MdpFieldValues | prepareMdpFieldValues (const char *simulationName) |
Prepare .mdp values to do a simulation. More... | |
void | prepareMdpFile (const MdpFieldValues &mdpFieldValues, const char *integrator, const char *tcoupl, const char *pcoupl) |
Set up an .mdp file that permits a highly reproducible simulation. More... | |
virtual void | runTest (const CommandLine &gromppCallerRef, const char *simulationName, const char *integrator, const char *tcoupl, const char *pcoupl, FloatingPointTolerance tolerance)=0 |
Run mdrun two ways in a test. Subclasses must override this method. More... | |
virtual void | runTest (const char *simulationName, const char *integrator, const char *tcoupl, const char *pcoupl, FloatingPointTolerance tolerance) |
Convenience overload of runTest() for cases that don't need to customize the command line for grompp. | |
Additional Inherited Members | |
Public Attributes inherited from gmx::test::MdrunTestFixture | |
SimulationRunner | runner_ |
Helper object to manage the preparation for and call of mdrun. | |
Public Attributes inherited from gmx::test::IntegrationTestFixture | |
::gmx::test::TestFileManager | fileManager_ |
Object that manages finding input files, writing temporary output files and cleaning up files. | |
Protected Member Functions inherited from gmx::test::IntegrationTestFixture | |
void | redirectStringToStdin (const char *theString) |
Accepts a string as input, writes it to a temporary file and then reopens stdin to read the contents of that string. More... | |
void | redirectStdoutToDevNull () |
Discards stdout while running a test. More... | |
void | redirectStderrToDevNull () |
Discards stderr while running a test. More... | |
MdrunComparisonFixture::MdpFieldValues gmx::test::MdrunComparisonFixture::prepareMdpFieldValues | ( | const char * | simulationName | ) |
Prepare .mdp values to do a simulation.
A database of several kinds of simulation useful for different kinds of tests is available.
Some of these systems are pretty minimal, because having few atoms means few interactions, highly reproducible forces, and allows tests to focus on the correctness of the implementation of high-level mdrun features. The boxes are of a reasonable size so that domain decomposition is possible. The pressure-coupling parameters are isotropic, and set up so that there will not be dramatic collapse of volume over the handful of MD steps that will be run. A single temperature-coupling group is used.
This is separate from prepareMdpFile, so that derived classes can react to the .mdp settings, e.g. by stopping a run after half the steps.
std::bad_alloc | if out of memory std::out_of_range if simulationName is not in the database |
void gmx::test::MdrunComparisonFixture::prepareMdpFile | ( | const MdpFieldValues & | mdpFieldValues, |
const char * | integrator, | ||
const char * | tcoupl, | ||
const char * | pcoupl | ||
) |
Set up an .mdp file that permits a highly reproducible simulation.
std::bad_alloc | if out of memory |
|
pure virtual |
Run mdrun two ways in a test. Subclasses must override this method.
It is expected that this method calls prepareMdpFieldValues() and prepareMdpFile() to help set up a call to grompp with gromppCallerRef. Then mdrun will be called and perhaps energies and forces compared.