Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
SettingsPopulator.h
Go to the documentation of this file.
1 
8 #ifndef SWOOSEUTILITIES_SETTINGSPOPULATOR_H
9 #define SWOOSEUTILITIES_SETTINGSPOPULATOR_H
10 
11 #include "OptionNames.h"
12 #include "SettingsNames.h"
16 #include <Utils/Settings.h>
18 
19 namespace Scine {
20 namespace SwooseUtilities {
21 
27  public:
28  // These functions used mostly for MM
29  static void addSfamAtomTypeLevel(Utils::UniversalSettings::DescriptorCollection& settings);
30  static void addPrintContributionsMolecularMechanicsOption(Utils::UniversalSettings::DescriptorCollection& settings);
31  static void addOnlyCalculateBondedContribution(Utils::UniversalSettings::DescriptorCollection& settings);
32  static void addParameterAndConnectivityFile(Utils::UniversalSettings::DescriptorCollection& settings,
33  bool setEmptyDefault = true);
34  static void addDetectBondsWithCovalentRadiiOption(Utils::UniversalSettings::DescriptorCollection& settings);
35  static void addNonCovalentCutoffRadius(Utils::UniversalSettings::DescriptorCollection& settings);
36  static void addHydrogenBondCorrection(Utils::UniversalSettings::DescriptorCollection& settings);
37  static void addApplyCutoffDuringInitializationOption(Utils::UniversalSettings::DescriptorCollection& settings);
38  static void addGaffAtomicChargesFile(Utils::UniversalSettings::DescriptorCollection& settings);
39  static void addGaffAtomTypesFile(Utils::UniversalSettings::DescriptorCollection& settings);
40 
41  // These functions used for QM/MM
42  static void addQmAtomsOption(Utils::UniversalSettings::DescriptorCollection& settings);
43  static void addElectrostaticEmbeddingOption(Utils::UniversalSettings::DescriptorCollection& settings);
44  static void addQmRegionXyzFileOption(Utils::UniversalSettings::DescriptorCollection& settings);
45  static void addIgnoreQmOption(Utils::UniversalSettings::DescriptorCollection& settings);
46  static void addOptimizeLinksOption(Utils::UniversalSettings::DescriptorCollection& settings);
47  static void addSilenceOption(Utils::UniversalSettings::DescriptorCollection& settings);
48  static void addChargeRedistributionOption(Utils::UniversalSettings::DescriptorCollection& settings);
49  static void addReducedQmMmEnergyOption(Utils::UniversalSettings::DescriptorCollection& settings);
50 
51  // These functions are mostly for the MM parametrization
52  static void addBondOrderThreshold(Utils::UniversalSettings::DescriptorCollection& settings);
53  static void addConnectivityRefinementOption(Utils::UniversalSettings::DescriptorCollection& settings);
54  static void addExistingParameterFile(Utils::UniversalSettings::DescriptorCollection& settings);
55  static void addConstrainMMParametersOption(Utils::UniversalSettings::DescriptorCollection& settings);
56  static void addOptimizeImproperDihedralForceConstantsOption(Utils::UniversalSettings::DescriptorCollection& settings);
57  static void addGaussianMethodAndBasisSet(Utils::UniversalSettings::DescriptorCollection& settings);
58  static void addExternalProgramNProcs(Utils::UniversalSettings::DescriptorCollection& settings);
59  static void addBaseWorkingDirectory(Utils::UniversalSettings::DescriptorCollection& settings);
60  static void addNumberAtomsThreshold(Utils::UniversalSettings::DescriptorCollection& settings);
61  static void addSubsystemRadius(Utils::UniversalSettings::DescriptorCollection& settings);
62  static void addReferenceDataGenerationOptions(Utils::UniversalSettings::DescriptorCollection& settings,
63  bool includeReadWriteMode = true);
64  static void addDatabaseSettings(Utils::UniversalSettings::DescriptorCollection& settings, std::string defaultDatabaseName);
65  static void addDatabaseSleepTime(Utils::UniversalSettings::DescriptorCollection& settings);
66  static void addAtomicInformationFile(Utils::UniversalSettings::DescriptorCollection& settings, bool setEmptyDefault = true);
67  static void addUseGaussianOption(Utils::UniversalSettings::DescriptorCollection& settings);
68  static void addReferenceProgram(Utils::UniversalSettings::DescriptorCollection& settings);
69  static void addReferenceMethodAndBasisSet(Utils::UniversalSettings::DescriptorCollection& settings);
70  static void addIncreaseScfSafetyOption(Utils::UniversalSettings::DescriptorCollection& settings);
71  static void addEarlyTerminationOption(Utils::UniversalSettings::DescriptorCollection& settings);
72  static void addReuseDatabaseOption(Utils::UniversalSettings::DescriptorCollection& settings);
73  static void addTerminateAfterReferenceDataGenerationOption(Utils::UniversalSettings::DescriptorCollection& settings);
74  static void addUseCsvInputFormatOption(Utils::UniversalSettings::DescriptorCollection& settings);
75  static void addConvertToCm5Option(Utils::UniversalSettings::DescriptorCollection& settings);
76  static void addYamlSettingsForDirectMode(Utils::UniversalSettings::DescriptorCollection& settings);
77  static void addTitration(Utils::UniversalSettings::DescriptorCollection& settings);
78  static void addUseThermochemistryForTitration(Utils::UniversalSettings::DescriptorCollection& settings);
79  static void addTrainingDataDirectory(Utils::UniversalSettings::DescriptorCollection& settings);
80  static void addTitrationSiteFile(Utils::UniversalSettings::DescriptorCollection& settings);
81 
82  // These functions used for QM region selection
83  static void addQmRegionCenterAtoms(Utils::UniversalSettings::DescriptorCollection& settings);
84  static void addInitialRadius(Utils::UniversalSettings::DescriptorCollection& settings);
85  static void addCuttingProbability(Utils::UniversalSettings::DescriptorCollection& settings);
86  static void addQmRegionSizesSettings(Utils::UniversalSettings::DescriptorCollection& settings);
87  static void addNumAttemptsPerRadiusOption(Utils::UniversalSettings::DescriptorCollection& settings);
88  static void addMaxNumRefModelsOption(Utils::UniversalSettings::DescriptorCollection& settings);
89  static void addTolerancesForQmRegionSelection(Utils::UniversalSettings::DescriptorCollection& settings);
90  static void addQmRegionSelectionRandomSeed(Utils::UniversalSettings::DescriptorCollection& settings);
91  static void addPerformSfamParametrizations(Utils::UniversalSettings::DescriptorCollection& settings);
92 
93  // These functions used for QM region selection via a Database
94  static void addMethodFamily(Utils::UniversalSettings::DescriptorCollection& settings);
95  static void addProgram(Utils::UniversalSettings::DescriptorCollection& settings);
96 
97  // These functions used for structure preparation
98  static void addPreparationDataDirectory(Utils::UniversalSettings::DescriptorCollection& settings);
99  static void addSolvation(Utils::UniversalSettings::DescriptorCollection& settings);
100  static void addPhValueOfSystem(Utils::UniversalSettings::DescriptorCollection& settings);
101  static void addNumberOfSolventShells(Utils::UniversalSettings::DescriptorCollection& settings);
102  static void addChargedCandNTermini(Utils::UniversalSettings::DescriptorCollection& settings);
106  SettingsPopulator() = delete;
107 };
108 
109 inline void SettingsPopulator::addSfamAtomTypeLevel(Utils::UniversalSettings::DescriptorCollection& settings) {
110  Utils::UniversalSettings::OptionListDescriptor sfamAtomTypeLevel("Sets the atom type level for SFAM's MM model.");
111  sfamAtomTypeLevel.addOption("elements");
112  sfamAtomTypeLevel.addOption("low");
113  sfamAtomTypeLevel.addOption("high");
114  sfamAtomTypeLevel.addOption("unique");
115  sfamAtomTypeLevel.setDefaultOption("high");
116  settings.push_back(SettingsNames::sfamAtomTypeLevel, std::move(sfamAtomTypeLevel));
117 }
118 
119 inline void
120 SettingsPopulator::addPrintContributionsMolecularMechanicsOption(Utils::UniversalSettings::DescriptorCollection& settings) {
121  Utils::UniversalSettings::BoolDescriptor printContributionsMolecularMechanics(
122  "Sets the option to have a very verbose output from the MM calculation, which includes the individual energy "
123  "contributions.");
124  printContributionsMolecularMechanics.setDefaultValue(false);
125  settings.push_back(SettingsNames::printContributionsMolecularMechanics, std::move(printContributionsMolecularMechanics));
126 }
127 
128 inline void SettingsPopulator::addOnlyCalculateBondedContribution(Utils::UniversalSettings::DescriptorCollection& settings) {
129  Utils::UniversalSettings::BoolDescriptor onlyCalculateBondedContribution(
130  "Sets the option to only calculate covalent contributions within the MM model.");
131  onlyCalculateBondedContribution.setDefaultValue(false);
132  settings.push_back(SettingsNames::onlyCalculateBondedContribution, std::move(onlyCalculateBondedContribution));
133 }
134 
135 inline void SettingsPopulator::addParameterAndConnectivityFile(Utils::UniversalSettings::DescriptorCollection& settings,
136  bool setEmptyDefault) {
137  Utils::UniversalSettings::StringDescriptor parameterFilePath(
138  "Path to the MM parameter file (for reading and writing).");
139  if (setEmptyDefault)
140  parameterFilePath.setDefaultValue("");
141  else
142  parameterFilePath.setDefaultValue("Parameters.dat");
143  settings.push_back(Utils::SettingsNames::parameterFilePath, std::move(parameterFilePath));
144 
145  Utils::UniversalSettings::StringDescriptor connectivityFilePath(
146  "Path to the system connectivity file (for reading and writing).");
147  if (setEmptyDefault)
148  connectivityFilePath.setDefaultValue("");
149  else
150  connectivityFilePath.setDefaultValue("Connectivity.dat");
151  settings.push_back(SettingsNames::connectivityFilePath, std::move(connectivityFilePath));
152 }
153 
154 inline void SettingsPopulator::addDetectBondsWithCovalentRadiiOption(Utils::UniversalSettings::DescriptorCollection& settings) {
155  Utils::UniversalSettings::BoolDescriptor detectBonds(
156  "Decides whether the connectivity should be determined by bond detection based on covalent radii instead of "
157  "reading the connectivity file.");
158  detectBonds.setDefaultValue(false);
159  settings.push_back(SettingsNames::detectBondsWithCovalentRadii, std::move(detectBonds));
160 }
161 
162 inline void SettingsPopulator::addNonCovalentCutoffRadius(Utils::UniversalSettings::DescriptorCollection& settings) {
163  Utils::UniversalSettings::DoubleDescriptor cutoffRadius(
164  "The cutoff radius for non covalent interactions in Angstrom.");
165  cutoffRadius.setMinimum(0.0);
166  cutoffRadius.setDefaultValue(1200.0);
167  settings.push_back(SettingsNames::nonCovalentCutoffRadius, std::move(cutoffRadius));
168 }
169 
170 inline void SettingsPopulator::addHydrogenBondCorrection(Utils::UniversalSettings::DescriptorCollection& settings) {
171  Utils::UniversalSettings::BoolDescriptor hydrogenBondCorrection("Include hydrogen bond interaction in MM model.");
172  hydrogenBondCorrection.setDefaultValue(true);
173  settings.push_back(SettingsNames::hydrogenBondCorrection, std::move(hydrogenBondCorrection));
174 }
175 
176 inline void SettingsPopulator::addApplyCutoffDuringInitializationOption(Utils::UniversalSettings::DescriptorCollection& settings) {
177  Utils::UniversalSettings::BoolDescriptor applyCutoffDuringInitialization(
178  "Decides whether the non-covalent cutoff radius should be enforced during the initialization of the calculator "
179  "to "
180  "exclude the interactions beyond the distance cutoff.");
181  applyCutoffDuringInitialization.setDefaultValue(false);
182  settings.push_back(SettingsNames::applyCutoffDuringInitialization, std::move(applyCutoffDuringInitialization));
183 }
184 
185 inline void SettingsPopulator::addGaffAtomicChargesFile(Utils::UniversalSettings::DescriptorCollection& settings) {
186  Utils::UniversalSettings::StringDescriptor atomicChargeFilePath("Path to atomic charges file for GAFF.");
187  atomicChargeFilePath.setDefaultValue("");
188  settings.push_back(SettingsNames::gaffAtomicChargesFile, std::move(atomicChargeFilePath));
189 }
190 
191 inline void SettingsPopulator::addTitrationSiteFile(Utils::UniversalSettings::DescriptorCollection& settings) {
192  Utils::UniversalSettings::StringDescriptor titrationSiteFile("Path to titation sites for MM parametrization.");
193  titrationSiteFile.setDefaultValue("titrable_sites.dat");
194  settings.push_back(SettingsNames::titrationSiteFile, std::move(titrationSiteFile));
195 }
196 
197 inline void SettingsPopulator::addGaffAtomTypesFile(Utils::UniversalSettings::DescriptorCollection& settings) {
198  Utils::UniversalSettings::StringDescriptor atomTypesFilePath("Path to atom types file for GAFF.");
199  atomTypesFilePath.setDefaultValue("");
200  settings.push_back(SettingsNames::gaffAtomTypesFile, std::move(atomTypesFilePath));
201 }
202 
203 inline void SettingsPopulator::addQmAtomsOption(Utils::UniversalSettings::DescriptorCollection& settings) {
204  Utils::UniversalSettings::IntListDescriptor qmAtoms("A list containing the indices of the atoms in the QM region.");
205  qmAtoms.setDefaultValue({});
206  settings.push_back(Utils::SettingsNames::qmAtomsList, std::move(qmAtoms));
207 }
208 
209 inline void SettingsPopulator::addChargeRedistributionOption(Utils::UniversalSettings::DescriptorCollection& settings) {
210  Utils::UniversalSettings::OptionListDescriptor chargeRedistr(
211  "Sets the charge redistribution scheme for the MM atoms close to the QM-MM boundary.");
212  chargeRedistr.addOption(OptionNames::redistributedChargeOption);
213  chargeRedistr.addOption(OptionNames::redistributedChargeAndDipolesOption);
214  chargeRedistr.setDefaultOption(OptionNames::redistributedChargeOption);
215  settings.push_back(SettingsNames::chargeRedistributionKey, std::move(chargeRedistr));
216 }
217 
218 inline void SettingsPopulator::addElectrostaticEmbeddingOption(Utils::UniversalSettings::DescriptorCollection& settings) {
219  Utils::UniversalSettings::BoolDescriptor electrostaticEmbeddingOption(
220  "Sets whether electrostatic embedding is used in QM/MM. The alternative is applying mechanical embedding only.");
221  electrostaticEmbeddingOption.setDefaultValue(false);
222  settings.push_back(Utils::SettingsNames::electrostaticEmbedding, std::move(electrostaticEmbeddingOption));
223 }
224 
225 inline void SettingsPopulator::addQmRegionXyzFileOption(Utils::UniversalSettings::DescriptorCollection& settings) {
226  Utils::UniversalSettings::StringDescriptor qmRegionXyzFile(
227  "The path to a file to which the QM region can be dumped in XYZ format.");
228  qmRegionXyzFile.setDefaultValue("");
229  settings.push_back(SettingsNames::qmRegionXyzFile, std::move(qmRegionXyzFile));
230 }
231 
232 inline void SettingsPopulator::addIgnoreQmOption(Utils::UniversalSettings::DescriptorCollection& settings) {
233  Utils::UniversalSettings::BoolDescriptor ignoreQm(
234  "Whether to ignore all contributions from the QM calculation, and therefore, not performing it.");
235  ignoreQm.setDefaultValue(false);
236  settings.push_back(Utils::SettingsNames::ignoreQmOption, std::move(ignoreQm));
237 }
238 
239 inline void SettingsPopulator::addOptimizeLinksOption(Utils::UniversalSettings::DescriptorCollection& settings) {
240  Utils::UniversalSettings::BoolDescriptor optLinks(
241  "Whether to optimize the position of the link nuclei before reporting an energy.");
242  optLinks.setDefaultValue(false);
243  settings.push_back(Utils::SettingsNames::optimizeLinks, std::move(optLinks));
244 }
245 
246 inline void SettingsPopulator::addSilenceOption(Utils::UniversalSettings::DescriptorCollection& settings) {
247  Utils::UniversalSettings::BoolDescriptor silence("Whether to silence the standard output of the subcalculators.");
248  silence.setDefaultValue(false);
249  settings.push_back(SettingsNames::silenceUnderlyingCalculators, std::move(silence));
250 }
251 
252 inline void SettingsPopulator::addReducedQmMmEnergyOption(Utils::UniversalSettings::DescriptorCollection& settings) {
253  Utils::UniversalSettings::BoolDescriptor reducedEnergyOption(
254  "Sets whether an additional MM calculation shall be performed to evaluate the reduced QM/MM energy without any "
255  "MM contributions for atoms located solely within the environment.");
256  reducedEnergyOption.setDefaultValue(false);
257  settings.push_back(SettingsNames::calculateReducedQmMmEnergy, std::move(reducedEnergyOption));
258 }
259 
260 inline void SettingsPopulator::addBondOrderThreshold(Utils::UniversalSettings::DescriptorCollection& settings) {
261  Utils::UniversalSettings::DoubleDescriptor bondOrderThreshold(
262  "Sets the threshold for which bond orders to consider as bonds.");
263  bondOrderThreshold.setMinimum(0.0);
264  bondOrderThreshold.setMaximum(2.0);
265  bondOrderThreshold.setDefaultValue(0.5);
266  settings.push_back(SettingsNames::bondOrderThreshold, std::move(bondOrderThreshold));
267 }
268 
269 inline void SettingsPopulator::addConnectivityRefinementOption(Utils::UniversalSettings::DescriptorCollection& settings) {
270  Utils::UniversalSettings::BoolDescriptor refineConnectivity(
271  "Whether the connectivities of the atoms obtained from covalent radii shall be refined applying quantum-chemical "
272  "data.");
273  refineConnectivity.setDefaultValue(true);
274  settings.push_back(SettingsNames::refineConnectivity, std::move(refineConnectivity));
275 }
276 
277 inline void SettingsPopulator::addExistingParameterFile(Utils::UniversalSettings::DescriptorCollection& settings) {
278  Utils::UniversalSettings::StringDescriptor existingParameters(
279  "Path to an MM parameter file, which already contains some parameters that can be re-used for the "
280  "parametrization.");
281  existingParameters.setDefaultValue("");
282  settings.push_back(SettingsNames::existingParameters, std::move(existingParameters));
283 }
284 
285 inline void SettingsPopulator::addConstrainMMParametersOption(Utils::UniversalSettings::DescriptorCollection& settings) {
286  Utils::UniversalSettings::BoolDescriptor constrainMMParameters(
287  "Decides whether there should be constraints during the MM parameter optimization.");
288  constrainMMParameters.setDefaultValue(true);
289  settings.push_back(SettingsNames::constrainMMParameters, std::move(constrainMMParameters));
290 }
291 
292 inline void
293 SettingsPopulator::addOptimizeImproperDihedralForceConstantsOption(Utils::UniversalSettings::DescriptorCollection& settings) {
294  Utils::UniversalSettings::BoolDescriptor optImproperDihedralForceConstants(
295  "Decides whether the improper dihedral force constants of non-planar groups should be optimized during the MM "
296  "parameter optimization.");
297  optImproperDihedralForceConstants.setDefaultValue(true);
298  settings.push_back(SettingsNames::optimizeImproperDihedralForceConstants, std::move(optImproperDihedralForceConstants));
299 }
300 
301 inline void SettingsPopulator::addNumberAtomsThreshold(Utils::UniversalSettings::DescriptorCollection& settings) {
302  Utils::UniversalSettings::IntDescriptor numberAtomsThreshold(
303  "The maximum number of atoms where reference data is still generated for the whole system.");
304  numberAtomsThreshold.setMinimum(1);
305  numberAtomsThreshold.setMaximum(200);
306  numberAtomsThreshold.setDefaultValue(150);
307  settings.push_back(SettingsNames::numberAtomsThreshold, std::move(numberAtomsThreshold));
308 }
309 
310 inline void SettingsPopulator::addGaussianMethodAndBasisSet(Utils::UniversalSettings::DescriptorCollection& settings) {
311  Utils::UniversalSettings::StringDescriptor gaussianMethod(
312  "The method used in the Gaussian calculation for the CM5 charges.");
313  gaussianMethod.setDefaultValue("PBEPBE");
314  settings.push_back(SettingsNames::gaussianMethod, std::move(gaussianMethod));
315 
316  Utils::UniversalSettings::StringDescriptor gaussianBasisSet(
317  "The basis set used in the Gaussian calculation for the CM5 charges.");
318  gaussianBasisSet.setDefaultValue("def2SVP");
319  settings.push_back(SettingsNames::gaussianBasisSet, std::move(gaussianBasisSet));
320 }
321 
322 inline void SettingsPopulator::addBaseWorkingDirectory(Utils::UniversalSettings::DescriptorCollection& settings) {
323  Utils::UniversalSettings::StringDescriptor baseWorkingDirectory("Base directory for the calculations.");
324  baseWorkingDirectory.setDefaultValue(Utils::FilesystemHelpers::currentDirectory());
325  settings.push_back(Utils::ExternalQC::SettingsNames::baseWorkingDirectory, std::move(baseWorkingDirectory));
326 }
327 
328 inline void SettingsPopulator::addExternalProgramNProcs(Utils::UniversalSettings::DescriptorCollection& settings) {
329  Utils::UniversalSettings::IntDescriptor externalProgramNProcs(
330  "Number of processes for a reference calculation by an external program.");
331  externalProgramNProcs.setDefaultValue(1);
332  externalProgramNProcs.setMinimum(1);
333  settings.push_back(Utils::SettingsNames::externalProgramNProcs, std::move(externalProgramNProcs));
334 }
335 
336 inline void SettingsPopulator::addReferenceMethodAndBasisSet(Utils::UniversalSettings::DescriptorCollection& settings) {
337  Utils::UniversalSettings::StringDescriptor referenceMethod("The method used in reference calculations.");
338  referenceMethod.setDefaultValue(""); // default will be set later depending on the program
339  settings.push_back(SettingsNames::referenceMethod, std::move(referenceMethod));
340 
341  Utils::UniversalSettings::StringDescriptor referenceBasisSet("The basis set used in reference calculations.");
342  referenceBasisSet.setDefaultValue(""); // default will be set later depending on the program
343  settings.push_back(SettingsNames::referenceBasisSet, std::move(referenceBasisSet));
344 }
345 
346 inline void SettingsPopulator::addSubsystemRadius(Utils::UniversalSettings::DescriptorCollection& settings) {
347  Utils::UniversalSettings::DoubleDescriptor subsystemRadius(
348  "The radius of the spheres defining the volume of the subsystems. Unit: Angstrom.");
349  subsystemRadius.setMinimum(5.0);
350  subsystemRadius.setMaximum(12.0);
351  subsystemRadius.setDefaultValue(6.0);
352  settings.push_back(SettingsNames::subsystemRadius, std::move(subsystemRadius));
353 }
354 
355 inline void SettingsPopulator::addReferenceDataGenerationOptions(Utils::UniversalSettings::DescriptorCollection& settings,
356  bool includeReadWriteMode) {
357  if (includeReadWriteMode) {
358  Utils::UniversalSettings::StringDescriptor refDataDir(
359  "The name of the directory where the reference calculation files are loaded from and to which the molecular "
360  "structure data is written.");
361  refDataDir.setDefaultValue("reference_data");
362  settings.push_back(SettingsNames::referenceDataDirectory, std::move(refDataDir));
363  }
364 
365  Utils::UniversalSettings::OptionListDescriptor refDataMode(
366  "Mode of the reference data generation (direct, reading, writing, database)");
367  refDataMode.addOption(OptionNames::directMode);
368  refDataMode.addOption(OptionNames::databaseMode);
369  if (includeReadWriteMode) {
370  refDataMode.addOption(OptionNames::readFromFilesMode);
371  refDataMode.addOption(OptionNames::writeToFilesMode);
372  }
373  refDataMode.setDefaultOption(OptionNames::directMode);
374  settings.push_back(SettingsNames::referenceDataMode, std::move(refDataMode));
375 }
376 
377 inline void SettingsPopulator::addDatabaseSettings(Utils::UniversalSettings::DescriptorCollection& settings,
378  std::string defaultDatabaseName) {
379  Utils::UniversalSettings::StringDescriptor databaseHost("The name or IP address of the database host.");
380  databaseHost.setDefaultValue("localhost");
381  settings.push_back(SettingsNames::databaseHost, std::move(databaseHost));
382 
383  Utils::UniversalSettings::StringDescriptor databaseName("The name of the database.");
384  databaseName.setDefaultValue(defaultDatabaseName);
385  settings.push_back(SettingsNames::databaseName, std::move(databaseName));
386 
387  Utils::UniversalSettings::IntDescriptor databasePort("The port through which to connect to the database.");
388  databasePort.setMinimum(27000);
389  databasePort.setMaximum(27999);
390  databasePort.setDefaultValue(27017);
391  settings.push_back(SettingsNames::databasePort, std::move(databasePort));
392 }
393 
394 inline void SettingsPopulator::addDatabaseSleepTime(Utils::UniversalSettings::DescriptorCollection& settings) {
395  Utils::UniversalSettings::IntDescriptor databaseSleepTime(
396  "The sleep time in seconds inbetween database operations in reference data generation phase.");
397  databaseSleepTime.setMinimum(1);
398  databaseSleepTime.setMaximum(86400); // one day
399  databaseSleepTime.setDefaultValue(60);
400  settings.push_back(SettingsNames::databaseSleepTime, std::move(databaseSleepTime));
401 }
402 
403 inline void SettingsPopulator::addAtomicInformationFile(Utils::UniversalSettings::DescriptorCollection& settings,
404  bool setEmptyDefault) {
405  Utils::UniversalSettings::StringDescriptor atomicInfoFile(
406  "Path to file containing the information about formal charges and unpaired electrons.");
407  if (setEmptyDefault) {
408  atomicInfoFile.setDefaultValue("");
409  }
410  else {
411  atomicInfoFile.setDefaultValue("atomic_info.dat");
412  }
413  settings.push_back(SettingsNames::atomicInformationFile, std::move(atomicInfoFile));
414 }
415 
416 inline void SettingsPopulator::addUseGaussianOption(Utils::UniversalSettings::DescriptorCollection& settings) {
417  Utils::UniversalSettings::BoolDescriptor useGaussianOption(
418  "Decides whether to apply the Gaussian program to calculate CM5 charges.");
419  useGaussianOption.setDefaultValue(false);
420  settings.push_back(SettingsNames::useGaussianOptionKey, std::move(useGaussianOption));
421 }
422 
423 inline void SettingsPopulator::addReferenceProgram(Utils::UniversalSettings::DescriptorCollection& settings) {
424  Utils::UniversalSettings::OptionListDescriptor referenceProgram(
425  "Set program for the reference calculations in SFAM parametrization.");
426  referenceProgram.addOption(OptionNames::turbomoleOption);
427  referenceProgram.addOption(OptionNames::orcaOption);
428  referenceProgram.addOption(OptionNames::sparrowOption);
429  referenceProgram.addOption(OptionNames::xtbOption);
430  referenceProgram.setDefaultOption(OptionNames::orcaOption);
431  settings.push_back(SettingsNames::referenceProgram, std::move(referenceProgram));
432 }
433 
434 inline void SettingsPopulator::addIncreaseScfSafetyOption(Utils::UniversalSettings::DescriptorCollection& settings) {
435  Utils::UniversalSettings::BoolDescriptor increaseScfSafety(
436  "Decides whether options for a safer SCF convergence should be applied.");
437  increaseScfSafety.setDefaultValue(false);
438  settings.push_back(SettingsNames::increaseScfSafetyKey, std::move(increaseScfSafety));
439 }
440 
441 inline void SettingsPopulator::addEarlyTerminationOption(Utils::UniversalSettings::DescriptorCollection& settings) {
442  Utils::UniversalSettings::BoolDescriptor earlyTermination(
443  "Decides whether the reference data generation should be terminated early when enough data has been collected.");
444  earlyTermination.setDefaultValue(true);
445  settings.push_back(SettingsNames::enableEarlyTerminationKey, std::move(earlyTermination));
446 }
447 
448 inline void SettingsPopulator::addReuseDatabaseOption(Utils::UniversalSettings::DescriptorCollection& settings) {
449  Utils::UniversalSettings::BoolDescriptor reuseDatabase("Decides whether an existing database should be employed as "
450  "the basis for the parametrization by reusing its data.");
451  reuseDatabase.setDefaultValue(false);
452  settings.push_back(SettingsNames::reuseDatabaseKey, std::move(reuseDatabase));
453 }
454 
455 inline void
456 SettingsPopulator::addTerminateAfterReferenceDataGenerationOption(Utils::UniversalSettings::DescriptorCollection& settings) {
457  Utils::UniversalSettings::BoolDescriptor refDataOnly(
458  "Decides whether to terminate program after reference data generation step of parametrization. Can only be set "
459  "to true in case of the database or write mode.");
460  refDataOnly.setDefaultValue(false);
461  settings.push_back(SettingsNames::terminateAfterReferenceDataGeneration, std::move(refDataOnly));
462 }
463 
464 inline void SettingsPopulator::addUseCsvInputFormatOption(Utils::UniversalSettings::DescriptorCollection& settings) {
465  Utils::UniversalSettings::BoolDescriptor useCsv("Whether to use the CSV input format during read mode.");
466  useCsv.setDefaultValue(true);
467  settings.push_back(SettingsNames::useCsvInputFormat, std::move(useCsv));
468 }
469 
470 inline void SettingsPopulator::addConvertToCm5Option(Utils::UniversalSettings::DescriptorCollection& settings) {
471  Utils::UniversalSettings::BoolDescriptor convertChargesCm5(
472  "Whether to convert atomic charges with the Charge Model 5 algorithm.");
473  convertChargesCm5.setDefaultValue(true);
474  settings.push_back(SettingsNames::convertChargesCm5, std::move(convertChargesCm5));
475 }
476 
477 inline void SettingsPopulator::addYamlSettingsForDirectMode(Utils::UniversalSettings::DescriptorCollection& settings) {
478  Utils::UniversalSettings::StringDescriptor yamlSettingsFilePath("");
479  yamlSettingsFilePath.setDefaultValue("");
480  settings.push_back(SettingsNames::yamlSettingsFilePath, std::move(yamlSettingsFilePath));
481 }
482 
483 inline void SettingsPopulator::addQmRegionCenterAtoms(Utils::UniversalSettings::DescriptorCollection& settings) {
484  Utils::UniversalSettings::IntListDescriptor centerAtoms(
485  "The center atom(s) around which the QM Region will be constructed.");
486  centerAtoms.setDefaultValue({0});
487  settings.push_back(SettingsNames::qmRegionCenterAtoms, std::move(centerAtoms));
488 }
489 
490 inline void SettingsPopulator::addInitialRadius(Utils::UniversalSettings::DescriptorCollection& settings) {
491  Utils::UniversalSettings::DoubleDescriptor initialRadius("The initial radius for the QM region generation.");
492  initialRadius.setMinimum(2.0);
493  initialRadius.setMaximum(12.0);
494  initialRadius.setDefaultValue(6.0);
495  settings.push_back(SettingsNames::initialRadiusForQmRegionSelection, std::move(initialRadius));
496 }
497 
498 inline void SettingsPopulator::addCuttingProbability(Utils::UniversalSettings::DescriptorCollection& settings) {
499  Utils::UniversalSettings::DoubleDescriptor cuttingProbability(
500  "The cutting probability for the QM region generation.");
501  cuttingProbability.setMinimum(0.1);
502  cuttingProbability.setMaximum(1.0);
503  cuttingProbability.setDefaultValue(1.0);
504  settings.push_back(SettingsNames::cuttingProbability, std::move(cuttingProbability));
505 }
506 
507 inline void SettingsPopulator::addQmRegionSizesSettings(Utils::UniversalSettings::DescriptorCollection& settings) {
508  Utils::UniversalSettings::IntDescriptor minSize("Minimum size of the QM region.");
509  minSize.setMinimum(1);
510  minSize.setDefaultValue(100);
511  settings.push_back(SettingsNames::qmRegionCandidateMinSize, std::move(minSize));
512 
513  Utils::UniversalSettings::IntDescriptor maxSize("Maximum size of the QM region.");
514  maxSize.setMinimum(1);
515  maxSize.setDefaultValue(120);
516  settings.push_back(SettingsNames::qmRegionCandidateMaxSize, std::move(maxSize));
517 
518  Utils::UniversalSettings::IntDescriptor refMaxSize("Maximum size for the reference QM regions.");
519  refMaxSize.setMinimum(1);
520  refMaxSize.setDefaultValue(200);
521  settings.push_back(SettingsNames::qmRegionRefMaxSize, std::move(refMaxSize));
522 }
523 
524 inline void SettingsPopulator::addNumAttemptsPerRadiusOption(Utils::UniversalSettings::DescriptorCollection& settings) {
525  Utils::UniversalSettings::IntDescriptor numAttemptsPerRadius(
526  "Number of QM region generation attempts for a given initial radius.");
527  numAttemptsPerRadius.setMinimum(1);
528  numAttemptsPerRadius.setDefaultValue(100);
529  settings.push_back(SettingsNames::numAttemptsPerRadius, std::move(numAttemptsPerRadius));
530 }
531 
532 inline void SettingsPopulator::addMaxNumRefModelsOption(Utils::UniversalSettings::DescriptorCollection& settings) {
533  Utils::UniversalSettings::IntDescriptor maxNumRefModels("Maximum number of reference models to be evaluated.");
534  maxNumRefModels.setMinimum(1);
535  maxNumRefModels.setDefaultValue(10);
536  settings.push_back(SettingsNames::maxNumRefModels, std::move(maxNumRefModels));
537 }
538 
539 inline void SettingsPopulator::addTolerancesForQmRegionSelection(Utils::UniversalSettings::DescriptorCollection& settings) {
540  Utils::UniversalSettings::DoubleDescriptor tolPercentageError(
541  "The tolerance in percent for the mean absolute error of forces for the QM region selection.");
542  tolPercentageError.setMinimum(0.0);
543  tolPercentageError.setDefaultValue(20.0);
544  settings.push_back(SettingsNames::tolerancePercentageError, std::move(tolPercentageError));
545 
546  Utils::UniversalSettings::DoubleDescriptor tolPercentageSymmetryScore(
547  "The tolerance in percent for the symmetry score based on the minimum symmetry score of all candidate models.");
548  tolPercentageSymmetryScore.setMinimum(0.0);
549  tolPercentageError.setDefaultValue(50.0);
550  settings.push_back(SettingsNames::tolerancePercentageSymmetryScore, std::move(tolPercentageSymmetryScore));
551 }
552 
553 inline void SettingsPopulator::addQmRegionSelectionRandomSeed(Utils::UniversalSettings::DescriptorCollection& settings) {
554  Utils::UniversalSettings::IntDescriptor randomSeed("Random seed for the QM region selection.");
555  randomSeed.setDefaultValue(42);
556  settings.push_back(SettingsNames::qmRegionSelectionRandomSeed, std::move(randomSeed));
557 }
558 
559 inline void SettingsPopulator::addPreparationDataDirectory(Utils::UniversalSettings::DescriptorCollection& settings) {
560  Utils::UniversalSettings::StringDescriptor preparationDataDirectory("Base directory for the preparation.");
561  preparationDataDirectory.setDefaultValue("preparation_data");
562  settings.push_back(SettingsNames::preparationDataDirectory, std::move(preparationDataDirectory));
563 }
564 
565 inline void SettingsPopulator::addSolvation(Utils::UniversalSettings::DescriptorCollection& settings) {
566  Utils::UniversalSettings::BoolDescriptor solvateStructure("Solvates the input structure.");
567  solvateStructure.setDefaultValue(false);
568  settings.push_back(SettingsNames::solvateStructure, std::move(solvateStructure));
569 }
570 
571 inline void SettingsPopulator::addNumberOfSolventShells(Utils::UniversalSettings::DescriptorCollection& settings) {
572  Utils::UniversalSettings::IntDescriptor numberOfSolventShells("Defines the number of solvent shells");
573  numberOfSolventShells.setDefaultValue(1);
574  settings.push_back(SettingsNames::numberOfSolventShells, std::move(numberOfSolventShells));
575 }
576 
577 inline void SettingsPopulator::addChargedCandNTermini(Utils::UniversalSettings::DescriptorCollection& settings) {
578  Utils::UniversalSettings::BoolDescriptor chargedCandNTermini(
579  "Whether to protonate C and N termini in their charged (NH3+, COO-) form");
580  chargedCandNTermini.setDefaultValue(true);
581  settings.push_back(SettingsNames::chargedCandNTermini, std::move(chargedCandNTermini));
582 }
583 
584 inline void SettingsPopulator::addPhValueOfSystem(Utils::UniversalSettings::DescriptorCollection& settings) {
585  Utils::UniversalSettings::DoubleDescriptor phValueOfSystem("pH value for the protonation.");
586  phValueOfSystem.setDefaultValue(7.0);
587  settings.push_back(SettingsNames::phValueOfSystem, std::move(phValueOfSystem));
588 }
589 
590 inline void SettingsPopulator::addTitration(Utils::UniversalSettings::DescriptorCollection& settings) {
591  Utils::UniversalSettings::BoolDescriptor titrate(
592  "Titrates the structure to protonate amino acids according to the pH value.");
593  titrate.setDefaultValue(false);
594  settings.push_back(SettingsNames::titrate, std::move(titrate));
595 }
596 
597 inline void SettingsPopulator::addUseThermochemistryForTitration(Utils::UniversalSettings::DescriptorCollection& settings) {
598  Utils::UniversalSettings::BoolDescriptor useThermoChemistryForTitration(
599  "Sets whether thermochemical data (gibbs free energy) should be used for calculation of pka values and "
600  "protonation states.");
601  useThermoChemistryForTitration.setDefaultValue(false);
602  settings.push_back(SettingsNames::useThermoChemistryForTitration, std::move(useThermoChemistryForTitration));
603 }
604 
605 inline void SettingsPopulator::addTrainingDataDirectory(Utils::UniversalSettings::DescriptorCollection& settings) {
606  Utils::UniversalSettings::StringDescriptor trainingDataDirectory(
607  "Sets the directory in which the reference calculation for the training data are stored.");
608  trainingDataDirectory.setDefaultValue("");
609  settings.push_back(SettingsNames::trainingDataDirectory, std::move(trainingDataDirectory));
610 }
611 
612 inline void SettingsPopulator::addMethodFamily(Utils::UniversalSettings::DescriptorCollection& settings) {
613  Utils::UniversalSettings::StringDescriptor methodFamily("The method family such as 'DFT/SFAM'.");
614  methodFamily.setDefaultValue("PM6/SFAM");
615  settings.push_back(Utils::SettingsNames::methodFamily, std::move(methodFamily));
616 }
617 
618 inline void SettingsPopulator::addProgram(Utils::UniversalSettings::DescriptorCollection& settings) {
619  Utils::UniversalSettings::StringDescriptor program("The underlying programs such as 'Turbomole/SFAM'.");
620  program.setDefaultValue("Any/Swoose");
621  settings.push_back(Utils::SettingsNames::program, std::move(program));
622 }
623 
624 } // namespace SwooseUtilities
625 } // namespace Scine
626 
627 #endif // SWOOSEUTILITIES_SETTINGSPOPULATOR_H
SettingsPopulator()=delete
Deleted constructor.
Class with only static functions to populate settings.
Definition: SettingsPopulator.h:26
static std::string currentDirectory()