25 std::string
getName()
const override {
return "CASTEP MD"; }
26 std::vector<std::string>
getExtensions()
const override {
return {
"md"}; }
30 const std::string &filename,
31 std::function<
void(
float,
const std::string &)> progress_callback =
nullptr)
override;
34 const std::string &filename,
35 std::function<
void(
float,
const std::string &)> progress_callback =
nullptr)
override;
43 static std::vector<correlation::core::Cell>
44 read(
const std::string &file_name,
45 const std::function<
void(
float,
const std::string &)> &progress_callback =
nullptr);
49 updateProgress(std::streampos current_pos, std::streampos file_size,
50 std::streampos &last_progress_pos, std::streamoff update_interval,
51 const std::function<
void(
float,
const std::string &)> &progress_callback);
55 std::vector<correlation::core::Cell> &frames);
Abstract base class for all file format readers.
Simulation cell structure with periodic boundary conditions.
Trajectory data structure for time-series atomistic simulations.
Represents the simulation cell (periodic box).
Definition Cell.hpp:30
This class stores a series of snapshots of a system.
Definition Trajectory.hpp:32
Reads a sequence of frames from a CASTEP .md trajectory file.
Definition CastepMdReader.hpp:23
static void parseEnergyLine(const std::string &line, real_t ¤t_energy, correlation::core::Cell &temp_cell, bool &cell_has_atoms, std::vector< correlation::core::Cell > &frames)
Definition CastepMdReader.cpp:115
static void parseAtomLine(const std::string &line, real_t current_energy, correlation::core::Cell &temp_cell, bool &cell_has_atoms)
Definition CastepMdReader.cpp:181
static void updateProgress(std::streampos current_pos, std::streampos file_size, std::streampos &last_progress_pos, std::streamoff update_interval, const std::function< void(float, const std::string &)> &progress_callback)
Definition CastepMdReader.cpp:104
static std::vector< correlation::core::Cell > read(const std::string &file_name, const std::function< void(float, const std::string &)> &progress_callback=nullptr)
Low-level parser for the specific file format.
Definition CastepMdReader.cpp:42
bool isTrajectory() const override
Returns true if this reader supports trajectory files.
Definition CastepMdReader.hpp:27
std::string getName() const override
Returns the display name of the format.
Definition CastepMdReader.hpp:25
correlation::core::Trajectory readTrajectory(const std::string &filename, std::function< void(float, const std::string &)> progress_callback=nullptr) override
Reads a trajectory from a file.
Definition CastepMdReader.cpp:36
std::vector< std::string > getExtensions() const override
Returns a list of supported file extensions.
Definition CastepMdReader.hpp:26
correlation::core::Cell readStructure(const std::string &filename, std::function< void(float, const std::string &)> progress_callback=nullptr) override
Reads an atomic structure from a file.
Definition CastepMdReader.cpp:30
static void parseLatticeLine(std::ifstream &myfile, const std::string &line, correlation::core::Cell &temp_cell)
Definition CastepMdReader.cpp:141
Definition TrajectoryLoader.hpp:24
double real_t
Definition Precision.hpp:18