LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
Loading...
Searching...
No Matches
amber_traj.hpp
1/*
2 This file is part of LOOS.
3
4 LOOS (Lightweight Object-Oriented Structure library)
5 Copyright (c) 2008, Tod D. Romo, Alan Grossfield
6 Department of Biochemistry and Biophysics
7 School of Medicine & Dentistry, University of Rochester
8
9 This package (LOOS) is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation under version 3 of the License.
12
13 This package is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#if !defined(LOOS_AMBER_TRAJ_HPP)
23#define LOOS_AMBER_TRAJ_HPP
24
25
26#include <string>
27
28#include <loos_defs.hpp>
29#include <Coord.hpp>
30#include <Trajectory.hpp>
31
32
33namespace loos {
34
36
48 class AmberTraj : public Trajectory {
49 public:
50 explicit AmberTraj(const std::string& s, const int na) : Trajectory(s),
51 _natoms(na), frame_offset(0),
52 frame_size(0), periodic(false) { init(); }
53
54 explicit AmberTraj(std::istream& is, const int na) : Trajectory(is), _natoms(na),
55 frame_offset(0), frame_size(0),
56 periodic(false) { init(); }
57
58 std::string description() const { return("Amber trajectory"); }
59 static pTraj create(const std::string& fname, const AtomicGroup& model) {
60 return(pTraj(new AmberTraj(fname, model.size())));
61 }
62
63
64 virtual uint nframes(void) const { return(_nframes); }
65 virtual uint natoms(void) const { return(_natoms); }
66 virtual std::vector<GCoord> coords(void) const { return(frame); }
67
68 virtual bool hasPeriodicBox(void) const { return(periodic); }
69 virtual GCoord periodicBox(void) const { return(box); }
70
71 virtual double velocityConversionFactor() const { return(20.455); }
72
78 virtual float timestep(void) const { return(0.0); } // Dummy routine...
79
80 virtual bool parseFrame(void);
81
82
83 private:
84 void init(void);
85 virtual void rewindImpl(void) { ifs->clear(); ifs->seekg(frame_offset); }
86 virtual void seekNextFrameImpl(void) { }
87 virtual void seekFrameImpl(const uint);
88 virtual void updateGroupCoordsImpl(AtomicGroup&);
89
90
91 private:
92 uint _natoms, _nframes;
93 unsigned long frame_offset, frame_size;
94 bool periodic;
95 GCoord box;
96 std::vector<GCoord> frame;
97
98 };
99
100
101}
102#endif
Class for reading amber coordinate trajectories.
Definition amber_traj.hpp:48
virtual bool parseFrame(void)
Parse an actual frame.
Definition amber_traj.cpp:86
virtual double velocityConversionFactor() const
Conversion applied to velocities to get to \AA/ps.
Definition amber_traj.hpp:71
virtual bool hasPeriodicBox(void) const
Definition amber_traj.hpp:68
virtual float timestep(void) const
Definition amber_traj.hpp:78
virtual uint natoms(void) const
Definition amber_traj.hpp:65
std::string description() const
Return a string describing trajectory format.
Definition amber_traj.hpp:58
virtual std::vector< GCoord > coords(void) const
Returns the current frames coordinates as a vector of GCoords.
Definition amber_traj.hpp:66
virtual GCoord periodicBox(void) const
Returns the periodic box for the current frame/trajectory.
Definition amber_traj.hpp:69
virtual uint nframes(void) const
Number of frames in the trajectory.
Definition amber_traj.hpp:64
Class for handling groups of Atoms (pAtoms, actually)
Definition AtomicGroup.hpp:108
Base-class for polymorphic trajectories.
Definition Trajectory.hpp:65
-picker
Namespace for most things not already encapsulated within a class.
Definition version.cpp:3