Loading...
Searching...
No Matches
PLMD::fileTraj Class Reference

atomic distribution from a trajectory file More...

#include <AtomDistribution.h>

Inheritance diagram for PLMD::fileTraj:

Public Member Functions

 fileTraj (std::string_view fmt, std::string_view fname, bool useMolfile, int command_line_natoms)
 
void frame (std::vector< Vector > &posToUpdate, std::vector< double > &box, unsigned step, Random &rng)
 Update the input vectors with the position and the box of the frame.
 
void frame (View< Vector > posToUpdate, View< double, 9 > box, unsigned, Random &) override
 Update the input vectors with the position and the box of the frame.
 
bool overrideNat (unsigned &natoms) override
 If necessary changes the number of atoms, returns true if that number has been changed.
 

Static Public Member Functions

static std::unique_ptr< AtomDistributiongetAtomDistribution (std::string_view atomicDistr)
 

Private Member Functions

void rewind ()
 
void step (bool doRewind=true)
 

Private Attributes

std::vector< double > cell
 
std::vector< double > charges {}
 
std::vector< Vectorcoordinates {}
 
bool dont_read_pbc =false
 
std::vector< double > masses {}
 
TrajectoryParser parser
 
bool read =false
 

Detailed Description

atomic distribution from a trajectory file

Constructor & Destructor Documentation

◆ fileTraj()

PLMD::fileTraj::fileTraj ( std::string_view fmt,
std::string_view fname,
bool useMolfile,
int command_line_natoms )

Member Function Documentation

◆ frame() [1/2]

void PLMD::AtomDistribution::frame ( std::vector< Vector > & posToUpdate,
std::vector< double > & box,
unsigned step,
Random & rng )
inherited

Update the input vectors with the position and the box of the frame.

◆ frame() [2/2]

void PLMD::fileTraj::frame ( View< Vector > posToUpdate,
View< double, 9 > box,
unsigned step,
Random & rng )
overridevirtual

Update the input vectors with the position and the box of the frame.

Implements PLMD::AtomDistribution.

◆ getAtomDistribution()

std::unique_ptr< AtomDistribution > PLMD::AtomDistribution::getAtomDistribution ( std::string_view atomicDistr)
staticinherited

◆ overrideNat()

bool PLMD::fileTraj::overrideNat ( unsigned & )
overridevirtual

If necessary changes the number of atoms, returns true if that number has been changed.

This is used principally in the benchmark. All the atoms distributions usually acts all the atoms passed by the vector of positions, so this does not change the input

But the "reading file" ones will only work if the number of atoms is the same of the one in the file, so this set the input to that number

And in case of the ones that replicate the trajectory this multiplies the input by the number of replicated "systems" this this is needed to inform benchmark that if you asked for replicating N atoms X*Y*Z times it will need an array of N*X*Y*Z atoms Outside of the specific usecase of the benchmark this is less important, because replicate will generate the inner trjectory on a limited number of atoms and the it will replicate it

Reimplemented from PLMD::AtomDistribution.

◆ rewind()

void PLMD::fileTraj::rewind ( )
private

◆ step()

void PLMD::fileTraj::step ( bool doRewind = true)
private

Member Data Documentation

◆ cell

std::vector<double> PLMD::fileTraj::cell
private
Initial value:
{0.0,0.0,0.0,
0.0,0.0,0.0,
0.0,0.0,0.0}

◆ charges

std::vector<double> PLMD::fileTraj::charges {}
private

◆ coordinates

std::vector<Vector> PLMD::fileTraj::coordinates {}
private

◆ dont_read_pbc

bool PLMD::fileTraj::dont_read_pbc =false
private

◆ masses

std::vector<double> PLMD::fileTraj::masses {}
private

◆ parser

TrajectoryParser PLMD::fileTraj::parser
private

◆ read

bool PLMD::fileTraj::read =false
private

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