Scine::Sparrow  5.1.0
Library for fast and agile quantum chemical calculations with semiempirical methods.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
CommandLineOptions.h
Go to the documentation of this file.
1 
7 #ifndef SPARROW_COMMANDLINEOPTIONS_H
8 #define SPARROW_COMMANDLINEOPTIONS_H
9 
10 #include <memory>
11 #include <ostream>
12 
13 namespace Scine {
14 namespace Core {
15 class Log;
16 } // namespace Core
17 namespace Utils {
18 class Settings;
19 } // namespace Utils
20 namespace Sparrow {
21 
27  public:
33  CommandLineOptions(int argc, char* argv[]);
35 
37  std::string getCallStatement() const;
39  bool helpRequired() const;
41  bool outputToFileRequired() const;
42 
44  std::string getSelectedMethodName() const;
46  std::string getStructureCoordinatesFile() const;
48  std::string getCalculationDescription() const;
50  std::string getLoggerVerbosity() const;
52  std::string getLogFilename() const;
54  int getNumberOfOrbitalSteers() const;
56  bool gradientRequired() const;
58  bool hessianRequired() const;
60  bool atomicHessiansRequired() const;
62  bool bondOrdersRequired() const;
64  bool suppressNormalModes() const;
66  bool excitedStatesRequired() const;
68  bool orbitalSteeringRequired() const;
70  bool wavefunctionRequired() const;
72  bool thermochemistryRequired() const;
74  bool pruneBasis() const;
75 
77  void updateLogger(Core::Log& log) const;
79  void updateSettings(Utils::Settings& settingsToUpdate) const;
81  void updateExcitedStatesSettings(Utils::Settings& settingsToUpdate) const;
83  void updateOrbitalSteeringSettings(Utils::Settings& settingsToUpdate) const;
84 
86  void printHelp(std::ostream& out) const;
87 
88  private:
89  struct Impl;
90  std::unique_ptr<Impl> pImpl_;
91 
93  std::string generateCallStatement(int argc, char* argv[]) const;
94 
97  template<class CharType>
98  bool validOptionToSet(CharType optionIdentifier, const Utils::Settings& settings) const;
99 
101  template<class CharPtrType, class StringType>
102  std::string combineNamesForOptions(CharPtrType nameOfOption, StringType abbreviatedOption) const;
103 };
104 
105 } // namespace Sparrow
106 } // namespace Scine
107 
108 #endif // SPARROW_COMMANDLINEOPTIONS_H
std::string getLogFilename() const
returns the name of the file where the logging should be printed.
Definition: CommandLineOptions.cpp:187
void updateExcitedStatesSettings(Utils::Settings &settingsToUpdate) const
updates the excited states setting with the option parsed from the command line.
Definition: CommandLineOptions.cpp:326
Definition: CommandLineOptions.cpp:49
CommandLineOptions(int argc, char *argv[])
Class constructor, parses the command line arguments and maps them to the according setting...
Definition: CommandLineOptions.cpp:55
bool thermochemistryRequired() const
returns whether the thermochemical properties are calculated.
Definition: CommandLineOptions.cpp:230
void printHelp(std::ostream &out) const
prints the help message.
Definition: CommandLineOptions.cpp:403
bool atomicHessiansRequired() const
returns whether the atomic Hessians have to be computed.
Definition: CommandLineOptions.cpp:206
void updateLogger(Core::Log &log) const
updates a logger with the verbosity parsed from the command line.
Definition: CommandLineOptions.cpp:244
bool bondOrdersRequired() const
returns whether the bond order matrix has to be computed.
Definition: CommandLineOptions.cpp:210
bool excitedStatesRequired() const
returns whether an excited states calculation has to be performed.
Definition: CommandLineOptions.cpp:218
bool gradientRequired() const
returns whether the gradients have to be computed.
Definition: CommandLineOptions.cpp:198
bool hessianRequired() const
returns whether the hessian matrix has to be computed.
Definition: CommandLineOptions.cpp:202
bool wavefunctionRequired() const
returns whether the wavefunction output is printed as a molden file.
Definition: CommandLineOptions.cpp:226
Class to parse the command line options for non-default options and passes them to a Util::Settings c...
Definition: CommandLineOptions.h:26
bool orbitalSteeringRequired() const
returns whether an orbital steering calculation has to be performed.
Definition: CommandLineOptions.cpp:222
std::string getCallStatement() const
returns the command call used to run the program.
Definition: CommandLineOptions.cpp:150
bool outputToFileRequired() const
returns whether the matrices should be saved as files.
Definition: CommandLineOptions.cpp:158
std::string getStructureCoordinatesFile() const
returns the xyz file containing the coordinates with the desired structures.
Definition: CommandLineOptions.cpp:408
void updateSettings(Utils::Settings &settingsToUpdate) const
updates a setting with the option parsed from the command line.
Definition: CommandLineOptions.cpp:287
bool suppressNormalModes() const
returns whether the normal modes output is printed or suppressed.
Definition: CommandLineOptions.cpp:214
void updateOrbitalSteeringSettings(Utils::Settings &settingsToUpdate) const
updates the orbital steering setting with the option parsed from the command line.
Definition: CommandLineOptions.cpp:365
std::string getCalculationDescription() const
returns the desired calculation description.
Definition: CommandLineOptions.cpp:173
std::string getLoggerVerbosity() const
returns the desired verbosity of the logging.
Definition: CommandLineOptions.cpp:180
bool helpRequired() const
returns whether the help flag option has been set.
Definition: CommandLineOptions.cpp:154
std::string getSelectedMethodName() const
returns the method name given as command-line argument.
Definition: CommandLineOptions.cpp:162
bool pruneBasis() const
returns whether the excited state basis needs to be pruned.
Definition: CommandLineOptions.cpp:234
int getNumberOfOrbitalSteers() const
returns the desired number of orbital steers.
Definition: CommandLineOptions.cpp:194