1 // clang-format off
2 /* -*- c++ -*- ----------------------------------------------------------
3 LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
4 https://www.lammps.org/, Sandia National Laboratories
5 Steve Plimpton, sjplimp@sandia.gov
6
7 Copyright (2003) Sandia Corporation. Under the terms of Contract
8 DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
9 certain rights in this software. This software is distributed under
10 the GNU General Public License.
11
12 See the README file in the top-level LAMMPS directory.
13 ------------------------------------------------------------------------- */
14
15 /* ----------------------------------------------------------------------
16 Contributing authors: Richard Berger (Temple U)
17 ------------------------------------------------------------------------- */
18
19 #include "table_file_reader.h"
20
21 #include "text_file_reader.h"
22
23 using namespace LAMMPS_NS;
24
TableFileReader(LAMMPS * lmp,const std::string & filename,const std::string & type,const int auto_convert)25 TableFileReader::TableFileReader(LAMMPS *lmp,
26 const std::string &filename,
27 const std::string &type,
28 const int auto_convert) :
29 PotentialFileReader(lmp, filename, type + " table", auto_convert)
30 {
31 }
32
~TableFileReader()33 TableFileReader::~TableFileReader() {
34 }
35
find_section_start(const std::string & keyword)36 char *TableFileReader::find_section_start(const std::string &keyword) {
37 char *line = nullptr;
38 while ((line = reader->next_line())) {
39 ValueTokenizer values(line);
40 std::string word = values.next_string();
41
42 if (word == keyword) {
43 // matching keyword
44 return line;
45 }
46 }
47 return nullptr;
48 }
49