1 /* -*- c++ -*- ---------------------------------------------------------- 2 LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 3 https://www.lammps.org/, Sandia National Laboratories 4 Steve Plimpton, sjplimp@sandia.gov 5 6 Copyright (2003) Sandia Corporation. Under the terms of Contract 7 DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains 8 certain rights in this software. This software is distributed under 9 the GNU General Public License. 10 11 See the README file in the top-level LAMMPS directory. 12 ------------------------------------------------------------------------- */ 13 14 /* ---------------------------------------------------------------------- 15 Contributing authors: Richard Berger (Temple U) 16 ------------------------------------------------------------------------- */ 17 18 #ifndef LMP_POTENTIAL_FILE_READER_H 19 #define LMP_POTENTIAL_FILE_READER_H 20 21 #include "pointers.h" // IWYU pragma: export 22 #include "tokenizer.h" 23 24 namespace LAMMPS_NS { 25 class TextFileReader; 26 27 class PotentialFileReader : protected Pointers { 28 protected: 29 TextFileReader *reader; 30 std::string filename; 31 std::string filetype; 32 int unit_convert; 33 34 TextFileReader *open_potential(const std::string &path); 35 36 public: 37 PotentialFileReader(class LAMMPS *lmp, const std::string &filename, 38 const std::string &potential_name, const int auto_convert = 0); 39 PotentialFileReader(class LAMMPS *lmp, const std::string &filename, 40 const std::string &potential_name, const std::string &name_suffix, 41 const int auto_convert = 0); 42 virtual ~PotentialFileReader(); 43 44 void ignore_comments(bool value); 45 46 void skip_line(); 47 char *next_line(int nparams = 0); 48 void next_dvector(double *list, int n); 49 ValueTokenizer next_values(int nparams, 50 const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); 51 52 // convenience functions 53 double next_double(); 54 int next_int(); 55 tagint next_tagint(); 56 bigint next_bigint(); 57 std::string next_string(); 58 59 // unit conversion info get_unit_convert()60 int get_unit_convert() const { return unit_convert; } 61 }; 62 63 } // namespace LAMMPS_NS 64 65 #endif 66