22#if !defined(LOOS_GRO_HPP)
31#include <loos_defs.hpp>
32#include <AtomicGroup.hpp>
43 explicit Gromacs(
const std::string &fname) : _filename(fname), _max_index(0), _has_velocities(
false)
45 std::ifstream ifs(fname.c_str());
51 explicit Gromacs(std::istream &ifs) : _filename(
"stream"), _max_index(0), _has_velocities(
false) { read(ifs); }
53 static pAtomicGroup create(
const std::string &fname)
55 return (pAtomicGroup(
new Gromacs(fname)));
58 bool hasVelocities()
const {
return (_has_velocities); }
60 std::string asString()
const;
64 std::string title(
void)
const {
return (title_); }
70 std::string _filename;
76 void read(std::istream &ifs);
79 std::string atomAsString(
const pAtom p)
const;
Class for handling groups of Atoms (pAtoms, actually)
Definition AtomicGroup.hpp:108
Error while opening a file.
Definition exceptions.hpp:175
Implements a GROMACS model file (.gro)
Definition gro.hpp:39
friend std::ostream & operator<<(std::ostream &, const Gromacs &)
Output as a GRO.
Definition gro.cpp:144
static Gromacs fromAtomicGroup(const AtomicGroup &)
Class method for creating a GRO from an AtomicGroup.
Definition gro.cpp:125
Namespace for most things not already encapsulated within a class.
Definition version.cpp:3