23#if !defined(LOOS_XTCWRITER_HPP)
24#define LOOS_XTCWRITER_HPP
31#include <loos_defs.hpp>
32#include <AtomicGroup.hpp>
34#include <trajwriter.hpp>
53 static const int magicints[];
54 static const int firstidx;
56 static const int lastidx;
64 static pTrajectoryWriter
create(
const std::string& s,
const bool append =
false) {
65 return(pTrajectoryWriter(
new XTCWriter(s, append)));
69 XTCWriter(
const std::string& fname,
const bool append =
false) :
71 buf1size(0), buf2size(0),
82 xdr.setStream(stream_);
88 XTCWriter(
const std::string& fname,
const double dt,
const uint steps_per_frame,
const bool append =
false) :
90 buf1size(0), buf2size(0),
95 steps_per_frame_(steps_per_frame),
101 xdr.setStream(stream_);
107 XTCWriter(
const std::string& fname,
const double dt,
const uint steps_per_frame,
const float precision,
const bool append =
false) :
109 buf1size(0), buf2size(0),
114 steps_per_frame_(steps_per_frame),
118 precision_(precision)
120 xdr.setStream(stream_);
166 int sizeofint(
const int size)
const;
167 int sizeofints(
const int num_of_bits,
const unsigned int sizes[])
const;
168 void encodebits(
int* buf,
int num_of_bits,
const int num)
const;
169 void encodeints(
int* buf,
const int num_of_ints,
const int num_of_bits,
170 const unsigned int* sizes,
const unsigned int* nums)
const;
171 void writeCompressedCoordsFloat(
float* ptr,
int size,
float precision);
173 void allocateBuffers(
const size_t size);
175 void writeHeader(
const int natoms,
const int step,
const float time);
176 void writeBox(
const GCoord& box);
178 void prepareToAppend();
181 uint buf1size, buf2size;
187 uint steps_per_frame_;
Class for handling groups of Atoms (pAtoms, actually)
Definition AtomicGroup.hpp:108
Base class for writing trajectories.
Definition trajwriter.hpp:53
TrajectoryWriter(const std::string &fname, const bool append=false)
Write a trajectory to a file, optionally appending.
Definition trajwriter.hpp:57
Class for writing Gromacs XTC trajectories.
Definition xtcwriter.hpp:52
static pTrajectoryWriter create(const std::string &s, const bool append=false)
Class factory function.
Definition xtcwriter.hpp:64
uint framesWritten() const
Total frames in output file.
Definition xtcwriter.hpp:163
void stepsPerFrame(const uint s)
Set how many steps pass per frame written.
Definition xtcwriter.hpp:148
void currentStep(const uint s)
Sets the current output step.
Definition xtcwriter.hpp:154
uint stepsPerFrame() const
How many steps per frame written.
Definition xtcwriter.hpp:145
uint currentStep() const
What the current output step is.
Definition xtcwriter.hpp:151
double timePerStep() const
Get the time per step.
Definition xtcwriter.hpp:139
void timePerStep(const double dt)
Set the time per step.
Definition xtcwriter.hpp:142
void writeFrame(const AtomicGroup &model)
Write a frame to the trajectory.
Definition xtcwriter.cpp:730
Namespace for most things not already encapsulated within a class.
Definition version.cpp:3