Gromacs  2016.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Protected Member Functions
gmx::test::MdrunComparisonFixture Class Referenceabstract

#include <programs/mdrun/tests/mdruncomparisonfixture.h>

Inherits gmx::test::MdrunTestFixture.

Description

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.
 

Public Attributes

SimulationRunner runner_
 Helper object to manage the preparation for and call of mdrun.
 
::gmx::test::TestFileManager fileManager_
 Object that manages finding input files, writing temporary output files and cleaning up files.
 

Protected Member Functions

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...
 

Member Function Documentation

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.

  • argon12
  • argon5832
  • spc5
  • spc216
  • alanine_vsite_vacuo
  • alanine_vsite_solvated
  • nonanol

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.

Exceptions
std::bad_allocif 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.

Exceptions
std::bad_allocif out of memory
void gmx::test::IntegrationTestFixture::redirectStderrToDevNull ( )
protectedinherited

Discards stderr while running a test.

Todo:
Implement this when the output routines are sufficiently modular to permit it to work.
void gmx::test::IntegrationTestFixture::redirectStdoutToDevNull ( )
protectedinherited

Discards stdout while running a test.

Todo:
Implement this when the output routines are sufficiently modular to permit it to work.
void gmx::test::IntegrationTestFixture::redirectStringToStdin ( const char *  theString)
protectedinherited

Accepts a string as input, writes it to a temporary file and then reopens stdin to read the contents of that string.

Exceptions
FileIOErrorwhen the freopen() fails
virtual void gmx::test::MdrunComparisonFixture::runTest ( const CommandLine gromppCallerRef,
const char *  simulationName,
const char *  integrator,
const char *  tcoupl,
const char *  pcoupl,
FloatingPointTolerance  tolerance 
)
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.


The documentation for this class was generated from the following files: