Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions
energyreader.h File Reference
#include <cstdint>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "gromacs/fileio/enxio.h"
#include "gromacs/utility/classhelpers.h"
#include "gromacs/utility/unique_cptr.h"
#include "testutils/testasserts.h"
+ Include dependency graph for energyreader.h:
+ This graph shows which files directly or indirectly include this file:

Description

Interfaces of related classes for tests that want to inspect energies produced by mdrun.

The responsibilities for reading and sharing information from .edr files in an exception-safe manner are shared between two classes. Intended usage is to call openEnergyFileToReadFields() to return an EnergyFrameReader that knows it expects to read the named .edr fields from each frame. Successive calls to its EnergyFrameReader::readNextFrame() and EnergyFrameReader::frame() methods will return EnergyFrame objects that contain the values for the .edr fields registered earlier.

Author
Mark Abraham mark..nosp@m.j.ab.nosp@m.raham.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Classes

class  gmx::test::EnergyFrameReader
 Manages returning an EnergyFrame containing required energy term values read from successive frames of an .edr file. More...
 

Typedefs

typedef std::unique_ptr
< EnergyFrameReader > 
gmx::test::EnergyFrameReaderPtr
 Convenience smart pointer typedef.
 
typedef unique_cptr< ener_file,
done_ener_file > 
gmx::test::ener_file_ptr
 Convenience smart pointer typedef.
 
typedef unique_cptr
< t_enxframe, done_enxframe > 
gmx::test::enxframe_ptr
 Convenience smart pointer typedef.
 

Functions

EnergyFrameReaderPtr gmx::test::openEnergyFileToReadTerms (const std::string &filename, const std::vector< std::string > &requiredEnergyTermNames)
 Open the file and return an object that can read the required terms from frames of an .edr file. More...
 
void gmx::test::done_enxframe (t_enxframe *fr)
 Helper function to clean up resources. More...