Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
GaffParameterParser.h
Go to the documentation of this file.
1 
8 #ifndef MOLECULARMECHANICS_GAFFPARAMETERPARSER_H
9 #define MOLECULARMECHANICS_GAFFPARAMETERPARSER_H
10 
11 #include <istream>
12 #include <memory>
13 #include <regex>
14 #include <string>
15 #include <unordered_map>
16 #include <vector>
17 
18 namespace Scine {
19 namespace MolecularMechanics {
20 class GaffParameters;
21 
29  public:
33  explicit GaffParameterParser(std::string filename);
34 
38  std::unique_ptr<GaffParameters> parseParameters();
39 
40  private:
41  void parse(GaffParameters& parameters);
42  void parseFirstLine(std::istream& in);
43  void parseAtomTypesInfo(std::istream& in, GaffParameters& parameters);
44  void parseHydrophilicAtomSymbols(std::istream& in, GaffParameters& parameters);
45  void parseBonds(std::istream& in, GaffParameters& parameters);
46  void parseAngles(std::istream& in, GaffParameters& parameters);
47  void parseDihedrals(std::istream& in, GaffParameters& parameters);
48  void parseImproperDihedrals(std::istream& in, GaffParameters& parameters);
49  void parseHBond1012(std::istream& in, GaffParameters& parameters);
50  void parseLennardJones(std::istream& in, GaffParameters& parameters);
51 
52  // Checks whether a regex iterator is valid; throws exception if not.
53  void checkIter(const std::sregex_token_iterator& iter);
54 
55  std::string parameterFile_;
56  std::unordered_map<std::string, double> atomicMasses_;
57 };
58 
59 } // namespace MolecularMechanics
60 } // namespace Scine
61 
62 #endif // MOLECULARMECHANICS_GAFFPARAMETERPARSER_H
Class containing the parameters for the GAFF model obtained after parsing a GAFF parameter file...
Definition: GaffParameters.h:38
This class reads in the GAFF parameters from the parameter file. The parsing relies on Qt and the con...
Definition: GaffParameterParser.h:28
GaffParameterParser(std::string filename)
Constructor from filename of parameter file.
Definition: GaffParameterParser.cpp:19
std::unique_ptr< GaffParameters > parseParameters()
Parse the parameters.
Definition: GaffParameterParser.cpp:22