Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
PLMD::cltools::SimpleMD Class Reference
Inheritance diagram for PLMD::cltools::SimpleMD:
Inheritance graph
[legend]

Public Types

enum  { unset, commandline, ifile }
 How is the input specified on the command line or in an input file. More...
 

Public Member Functions

 SimpleMD (const CLToolOptions &co)
 
const std::map< std::string, std::string > & getInputData ()
 
bool readInput (int argc, char **argv, FILE *in, FILE *out)
 Read the arguments from the command line. More...
 
void setInputData (const std::map< std::string, std::string > &inputData)
 Set the input data: More...
 

Static Public Member Functions

static void registerKeywords (Keywords &keys)
 

Public Attributes

enum PLMD::CLTool:: { ... }  inputdata
 How is the input specified on the command line or in an input file. More...
 

Protected Member Functions

void error (const std::string &msg)
 Crash the command line tool with an error. More...
 
template<class T >
bool parse (const std::string &key, T &t)
 Get the value of one of the command line arguments. More...
 
void parseFlag (const std::string &key, bool &t)
 Find out whether one of the command line flags is present or not. More...
 
template<class T >
bool parseVector (const std::string &key, std::vector< T > &t)
 

Private Member Functions

void check_list (const int natoms, const std::vector< Vector > &positions, const std::vector< Vector > &positions0, const double listcutoff, const double forcecutoff, bool &recompute)
 
void compute_engkin (const int natoms, const std::vector< double > &masses, const std::vector< Vector > &velocities, double &engkin)
 
void compute_forces (const int natoms, double epsilon, double sigma, const std::vector< Vector > &positions, const double cell[3], double forcecutoff, const std::vector< std::vector< int > > &list, std::vector< Vector > &forces, double &engconf)
 
void compute_list (const int natoms, const std::vector< Vector > &positions, const double cell[3], const double listcutoff, std::vector< std::vector< int > > &list)
 
std::string description () const override
 virtual function returning a one-line descriptor for the tool More...
 
int main (FILE *in, FILE *out, PLMD::Communicator &pc) override
 virtual function mapping to the specific main for each tool More...
 
void pbc (const double cell[3], const Vector &vin, Vector &vout)
 
void randomize_velocities (const int natoms, const int ndim, const double temperature, const std::vector< double > &masses, std::vector< Vector > &velocities, Random &random)
 
void read_input (double &temperature, double &tstep, double &friction, double &forcecutoff, double &listcutoff, int &nstep, int &nconfig, int &nstat, bool &wrapatoms, std::string &inputfile, std::string &outputfile, std::string &trajfile, std::string &statfile, int &ndim, int &idum, double &epsilon, double &sigma)
 
void read_natoms (const std::string &inputfile, int &natoms)
 
void read_positions (const std::string &inputfile, int natoms, std::vector< Vector > &positions, double cell[3])
 
bool readCommandLineArgs (int argc, char **argv, FILE *out)
 Read the arguments from the command line. More...
 
bool readInputFile (int argc, char **argv, FILE *in, FILE *out)
 Read the arguments from an input file specified on the command line. More...
 
void setRemainingToDefault (FILE *out)
 Set arguments from the default options provided to Keywords. More...
 
void thermostat (const int natoms, const int ndim, const std::vector< double > &masses, const double dt, const double friction, const double temperature, std::vector< Vector > &velocities, double &engint, Random &random)
 
void write_final_positions (const std::string &outputfile, int natoms, const std::vector< Vector > &positions, const double cell[3], const bool wrapatoms)
 
void write_positions (const std::string &trajfile, int natoms, const std::vector< Vector > &positions, const double cell[3], const bool wrapatoms)
 
void write_statistics (const std::string &statfile, const int istep, const double tstep, const int natoms, const int ndim, const double engkin, const double engconf, const double engint)
 

Private Attributes

std::map< std::string, std::string > inputData
 The data read in from the command line stored in a map with the keywords. More...
 
const Keywordskeywords
 The list of keywords for this CLTool. More...
 
const std::string name
 The name of this command line tool. More...
 
bool write_positions_first
 
bool write_statistics_first
 
FILE * write_statistics_fp
 
std::unique_ptr< FILE, decltype(deleter)> write_statistics_fp_deleter {nullptr,deleter}
 
int write_statistics_last_time_reopened
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

How is the input specified on the command line or in an input file.

Enumerator
unset 
commandline 
ifile 

Constructor & Destructor Documentation

◆ SimpleMD()

PLMD::cltools::SimpleMD::SimpleMD ( const CLToolOptions co)
inlineexplicit

Member Function Documentation

◆ check_list()

void PLMD::cltools::SimpleMD::check_list ( const int  natoms,
const std::vector< Vector > &  positions,
const std::vector< Vector > &  positions0,
const double  listcutoff,
const double  forcecutoff,
bool &  recompute 
)
inlineprivate

◆ compute_engkin()

void PLMD::cltools::SimpleMD::compute_engkin ( const int  natoms,
const std::vector< double > &  masses,
const std::vector< Vector > &  velocities,
double &  engkin 
)
inlineprivate

◆ compute_forces()

void PLMD::cltools::SimpleMD::compute_forces ( const int  natoms,
double  epsilon,
double  sigma,
const std::vector< Vector > &  positions,
const double  cell[3],
double  forcecutoff,
const std::vector< std::vector< int > > &  list,
std::vector< Vector > &  forces,
double &  engconf 
)
inlineprivate

◆ compute_list()

void PLMD::cltools::SimpleMD::compute_list ( const int  natoms,
const std::vector< Vector > &  positions,
const double  cell[3],
const double  listcutoff,
std::vector< std::vector< int > > &  list 
)
inlineprivate

◆ description()

std::string PLMD::cltools::SimpleMD::description ( ) const
inlineoverrideprivatevirtual

virtual function returning a one-line descriptor for the tool

Reimplemented from PLMD::CLTool.

◆ error()

void PLMD::CLTool::error ( const std::string &  msg)
protectedinherited

Crash the command line tool with an error.

◆ getInputData()

const std::map<std::string,std::string>& PLMD::CLTool::getInputData ( )
inlineinherited

◆ main()

int PLMD::cltools::SimpleMD::main ( FILE *  in,
FILE *  out,
PLMD::Communicator pc 
)
inlineoverrideprivatevirtual

virtual function mapping to the specific main for each tool

Implements PLMD::CLTool.

◆ parse()

template<class T >
bool PLMD::CLTool::parse ( const std::string &  key,
T &  t 
)
protectedinherited

Get the value of one of the command line arguments.

◆ parseFlag()

void PLMD::CLTool::parseFlag ( const std::string &  key,
bool &  t 
)
protectedinherited

Find out whether one of the command line flags is present or not.

◆ parseVector()

template<class T >
bool PLMD::CLTool::parseVector ( const std::string &  key,
std::vector< T > &  t 
)
protectedinherited

◆ pbc()

void PLMD::cltools::SimpleMD::pbc ( const double  cell[3],
const Vector vin,
Vector vout 
)
inlineprivate

◆ randomize_velocities()

void PLMD::cltools::SimpleMD::randomize_velocities ( const int  natoms,
const int  ndim,
const double  temperature,
const std::vector< double > &  masses,
std::vector< Vector > &  velocities,
Random random 
)
inlineprivate

◆ read_input()

void PLMD::cltools::SimpleMD::read_input ( double &  temperature,
double &  tstep,
double &  friction,
double &  forcecutoff,
double &  listcutoff,
int &  nstep,
int &  nconfig,
int &  nstat,
bool &  wrapatoms,
std::string &  inputfile,
std::string &  outputfile,
std::string &  trajfile,
std::string &  statfile,
int &  ndim,
int &  idum,
double &  epsilon,
double &  sigma 
)
inlineprivate

◆ read_natoms()

void PLMD::cltools::SimpleMD::read_natoms ( const std::string &  inputfile,
int &  natoms 
)
inlineprivate

◆ read_positions()

void PLMD::cltools::SimpleMD::read_positions ( const std::string &  inputfile,
int  natoms,
std::vector< Vector > &  positions,
double  cell[3] 
)
inlineprivate

◆ readCommandLineArgs()

bool PLMD::CLTool::readCommandLineArgs ( int  argc,
char **  argv,
FILE *  out 
)
privateinherited

Read the arguments from the command line.

◆ readInput()

bool PLMD::CLTool::readInput ( int  argc,
char **  argv,
FILE *  in,
FILE *  out 
)
inherited

Read the arguments from the command line.

◆ readInputFile()

bool PLMD::CLTool::readInputFile ( int  argc,
char **  argv,
FILE *  in,
FILE *  out 
)
privateinherited

Read the arguments from an input file specified on the command line.

◆ registerKeywords()

static void PLMD::cltools::SimpleMD::registerKeywords ( Keywords keys)
inlinestatic

◆ setInputData()

void PLMD::CLTool::setInputData ( const std::map< std::string, std::string > &  inputData)
inlineinherited

Set the input data:

◆ setRemainingToDefault()

void PLMD::CLTool::setRemainingToDefault ( FILE *  out)
privateinherited

Set arguments from the default options provided to Keywords.

◆ thermostat()

void PLMD::cltools::SimpleMD::thermostat ( const int  natoms,
const int  ndim,
const std::vector< double > &  masses,
const double  dt,
const double  friction,
const double  temperature,
std::vector< Vector > &  velocities,
double &  engint,
Random random 
)
inlineprivate

◆ write_final_positions()

void PLMD::cltools::SimpleMD::write_final_positions ( const std::string &  outputfile,
int  natoms,
const std::vector< Vector > &  positions,
const double  cell[3],
const bool  wrapatoms 
)
inlineprivate

◆ write_positions()

void PLMD::cltools::SimpleMD::write_positions ( const std::string &  trajfile,
int  natoms,
const std::vector< Vector > &  positions,
const double  cell[3],
const bool  wrapatoms 
)
inlineprivate

◆ write_statistics()

void PLMD::cltools::SimpleMD::write_statistics ( const std::string &  statfile,
const int  istep,
const double  tstep,
const int  natoms,
const int  ndim,
const double  engkin,
const double  engconf,
const double  engint 
)
inlineprivate

Member Data Documentation

◆ inputData

std::map<std::string,std::string> PLMD::CLTool::inputData
privateinherited

The data read in from the command line stored in a map with the keywords.

◆ inputdata

enum { ... } PLMD::CLTool::inputdata

How is the input specified on the command line or in an input file.

◆ keywords

const Keywords& PLMD::CLTool::keywords
privateinherited

The list of keywords for this CLTool.

◆ name

const std::string PLMD::CLTool::name
privateinherited

The name of this command line tool.

◆ write_positions_first

bool PLMD::cltools::SimpleMD::write_positions_first
private

◆ write_statistics_first

bool PLMD::cltools::SimpleMD::write_statistics_first
private

◆ write_statistics_fp

FILE* PLMD::cltools::SimpleMD::write_statistics_fp
private

◆ write_statistics_fp_deleter

std::unique_ptr<FILE,decltype(deleter)> PLMD::cltools::SimpleMD::write_statistics_fp_deleter {nullptr,deleter}
private

◆ write_statistics_last_time_reopened

int PLMD::cltools::SimpleMD::write_statistics_last_time_reopened
private

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