Psi4
basisset_parser.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi_src_lib_libmints_basisset_parser_h_
29 #define _psi_src_lib_libmints_basisset_parser_h_
30 
31 #include <vector>
32 #include <string>
34 #include "gshell.h"
35 
36 
37 namespace psi {
38 
39 class BasisSet;
40 
42 public:
50  std::string message,
51  const char* file,
52  int line
53  ) throw();
54 
55  virtual ~BasisSetFileNotFound() throw();
56 };
57 
59 public:
67  std::string message,
68  const char* file,
69  int line
70  ) throw();
71 
72  virtual ~BasisSetNotFound() throw();
73 };
74 
82 {
83 protected:
84  std::string filename_;
85 public:
90 
92  BasisSetParser(bool forced_puream);
93  virtual ~BasisSetParser();
94 
99  std::vector<std::string> load_file(const std::string& filename, const std::string& basisname="");
100 
102  std::vector<std::string> string_to_vector(const std::string& data);
103 
109  virtual std::vector<ShellInfo> parse(const std::string& symbol, const std::string& dataset) {
110  return parse(symbol, string_to_vector(dataset));
111  }
112 
118  virtual std::vector<ShellInfo> parse(const std::string& symbol, const std::vector<std::string>& dataset) = 0;
119 };
120 
125 {
126 public:
128  Gaussian94BasisSetParser(bool forced_puream): BasisSetParser(forced_puream) {}
129  virtual std::vector<ShellInfo> parse(const std::string& symbol, const std::vector<std::string>& dataset);
130 };
131 
132 } /* end psi namespace */
133 
134 #endif
const char * file() const
Definition: exception.cc:110
Class for reading in basis sets formatted for Gaussian.
Definition: basisset_parser.h:124
virtual std::vector< ShellInfo > parse(const std::string &symbol, const std::vector< std::string > &dataset)
Definition: basisset_parser.cc:158
Definition: basisset_parser.h:41
BasisSetFileNotFound(std::string message, const char *file, int line)
Definition: basisset_parser.cc:54
Gaussian94BasisSetParser()
Definition: basisset_parser.h:127
virtual ~BasisSetParser()
Definition: basisset_parser.cc:94
virtual ~BasisSetFileNotFound()
Definition: basisset_parser.cc:64
Definition: exception.h:53
Abstract class for parsing basis sets from a text file.
Definition: basisset_parser.h:81
virtual ~BasisSetNotFound()
Definition: basisset_parser.cc:78
std::vector< std::string > load_file(const std::string &filename, const std::string &basisname="")
Definition: basisset_parser.cc:98
bool force_puream_or_cartesian_
If the parser needs to force spherical or cartesian (e.g., loading old guess)
Definition: basisset_parser.h:87
BasisSetNotFound(std::string message, const char *file, int line)
Definition: basisset_parser.cc:68
Gaussian94BasisSetParser(bool forced_puream)
Definition: basisset_parser.h:128
Definition: basisset_parser.h:58
int line() const
Definition: exception.cc:116
bool forced_is_puream_
Is the forced value to use puream? (Otherwise force Cartesian).
Definition: basisset_parser.h:89
BasisSetParser()
Definition: basisset_parser.cc:82
std::string filename_
Definition: basisset_parser.h:84
std::vector< std::string > string_to_vector(const std::string &data)
Take a multiline string and convert it to a vector of strings.
Definition: basisset_parser.cc:148
virtual std::vector< ShellInfo > parse(const std::string &symbol, const std::string &dataset)
Definition: basisset_parser.h:109