Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::readers::NequipReader Class Reference

Reads atomic structures and trajectories from NequIP Extended XYZ outputs. More...

#include <NequipReader.hpp>

Inheritance diagram for correlation::readers::NequipReader:
Collaboration diagram for correlation::readers::NequipReader:

Classes

struct  CommentData
 Intermediate storage for parsed NequIP Extended XYZ comment line metadata and column layout. More...

Public Member Functions

std::string getName () const override
 Returns the display name of the format.
std::vector< std::string > getExtensions () const override
 Returns a list of supported file extensions.
bool isTrajectory () const override
 Returns true if this reader supports trajectory files.
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.
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.
Public Member Functions inherited from correlation::readers::BaseReader
 BaseReader ()=default
 ~BaseReader () override=default
 BaseReader (const BaseReader &)=delete
BaseReader & operator= (const BaseReader &)=delete
 BaseReader (BaseReader &&)=delete
BaseReader & operator= (BaseReader &&)=delete
virtual correlation::core::Trajectory readTrajectory (const std::vector< std::string > &filenames, ProgressCallback progress_callback=nullptr)
 Reads a trajectory concatenated across multiple files.
Public Member Functions inherited from correlation::readers::IStructureReader
 IStructureReader ()=default
virtual ~IStructureReader ()=default
 IStructureReader (const IStructureReader &)=delete
IStructureReader & operator= (const IStructureReader &)=delete
 IStructureReader (IStructureReader &&)=delete
IStructureReader & operator= (IStructureReader &&)=delete
Public Member Functions inherited from correlation::readers::ITrajectoryReader
 ITrajectoryReader ()=default
virtual ~ITrajectoryReader ()=default
 ITrajectoryReader (const ITrajectoryReader &)=delete
ITrajectoryReader & operator= (const ITrajectoryReader &)=delete
 ITrajectoryReader (ITrajectoryReader &&)=delete
ITrajectoryReader & operator= (ITrajectoryReader &&)=delete

Static Private Member Functions

static void parseLattice (const std::string &comment, CommentData &data)
static void parseEnergy (const std::string &comment, CommentData &data)
static void parseProperties (const std::string &comment, CommentData &data)
static void parsePropertiesParts (const std::vector< std::string > &parts, CommentData &data)
static CommentData parseCommentLine (const std::string &comment)
static correlation::core::Cell parseNequipFrame (const char *data, size_t size)

Detailed Description

Reads atomic structures and trajectories from NequIP Extended XYZ outputs.

NequIP outputs follow the Extended XYZ convention, writing simulation frames with Lattice="...", energy fields (nequip_energy, energy, free_energy), and per-atom properties in Properties=... (such as species:S:1:pos:R:3:nequip_forces:R:3).

When atomic forces (nequip_forces, forces, NequIP_forces) are present, they are captured and stored in the atom's velocity vector for downstream structural and dynamical analysis.

Member Function Documentation

◆ getExtensions()

std::vector< std::string > correlation::readers::NequipReader::getExtensions ( ) const
inlinenodiscardoverridevirtual

Returns a list of supported file extensions.

Returns
A vector of strings containing extensions (e.g. {".cif", ".ext"}).

Implements correlation::readers::BaseReader.

◆ getName()

std::string correlation::readers::NequipReader::getName ( ) const
inlinenodiscardoverridevirtual

Returns the display name of the format.

Returns
A string representing the format name (e.g. "LAMMPS Dump", "CIF").

Implements correlation::readers::BaseReader.

◆ isTrajectory()

bool correlation::readers::NequipReader::isTrajectory ( ) const
inlinenodiscardoverridevirtual

Returns true if this reader supports trajectory files.

Returns
True if the format can store multiple time steps.

Implements correlation::readers::BaseReader.

◆ parseCommentLine()

NequipReader::CommentData correlation::readers::NequipReader::parseCommentLine ( const std::string & comment)
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseEnergy()

void correlation::readers::NequipReader::parseEnergy ( const std::string & comment,
CommentData & data )
staticprivate
Here is the caller graph for this function:

◆ parseLattice()

void correlation::readers::NequipReader::parseLattice ( const std::string & comment,
CommentData & data )
staticprivate
Here is the caller graph for this function:

◆ parseNequipFrame()

correlation::core::Cell correlation::readers::NequipReader::parseNequipFrame ( const char * data,
size_t size )
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseProperties()

void correlation::readers::NequipReader::parseProperties ( const std::string & comment,
CommentData & data )
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parsePropertiesParts()

void correlation::readers::NequipReader::parsePropertiesParts ( const std::vector< std::string > & parts,
CommentData & data )
staticprivate
Here is the caller graph for this function:

◆ readStructure()

correlation::core::Cell correlation::readers::NequipReader::readStructure ( const std::string & filename,
std::function< void(float, const std::string &)> progress_callback = nullptr )
overridevirtual

Reads an atomic structure from a file.

Parameters
[in]filenamePath to the file to be read.
[in]progress_callbackOptional callback to report progress [0.0, 1.0].
Returns
A Cell object containing the loaded structure.

Implements correlation::readers::BaseReader.

Here is the call graph for this function:

◆ readTrajectory()

correlation::core::Trajectory correlation::readers::NequipReader::readTrajectory ( const std::string & filename,
std::function< void(float, const std::string &)> progress_callback = nullptr )
overridevirtual

Reads a trajectory from a file.

Parameters
[in]filenamePath to the file to be read.
[in]progress_callbackOptional callback to report progress [0.0, 1.0].
Returns
A Trajectory object containing all loaded frames.

Implements correlation::readers::BaseReader.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: