| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#ifndef OPENMMINPUTDIALOG_H |
| 7 |
#define OPENMMINPUTDIALOG_H |
| 8 |
|
| 9 |
#include "ui_openmminputdialog.h" |
| 10 |
|
| 11 |
#include <QHash> |
| 12 |
#include <QtCore/QSettings> |
| 13 |
|
| 14 |
class QJsonObject; |
| 15 |
class QTextEdit; |
| 16 |
|
| 17 |
namespace Avogadro { |
| 18 |
namespace QtGui { |
| 19 |
class Molecule; |
| 20 |
} |
| 21 |
|
| 22 |
namespace QtPlugins { |
| 23 |
class OpenMMInputDialog : public QDialog |
| 24 |
{ |
| 25 |
Q_OBJECT |
| 26 |
|
| 27 |
public: |
| 28 |
explicit OpenMMInputDialog(QWidget* parent = nullptr, |
| 29 |
Qt::WindowFlags flag = Qt::WindowFlags()); |
| 30 |
~OpenMMInputDialog() override; |
| 31 |
|
| 32 |
void readSettings(QSettings&); |
| 33 |
void writeSettings(QSettings&) const; |
| 34 |
|
| 35 |
enum forceFieldType |
| 36 |
{ |
| 37 |
amber96, |
| 38 |
amber99sb, |
| 39 |
amber99sbildn, |
| 40 |
amber99sbnmr, |
| 41 |
amber03, |
| 42 |
amber10 |
| 43 |
}; |
| 44 |
enum waterModelType |
| 45 |
{ |
| 46 |
spce, |
| 47 |
tip3p, |
| 48 |
tip4pew, |
| 49 |
tip5p, |
| 50 |
implicit |
| 51 |
}; |
| 52 |
enum nonBondedType |
| 53 |
{ |
| 54 |
NoCutoff, |
| 55 |
CutoffNonPeriodic, |
| 56 |
CutoffPeriodic, |
| 57 |
Ewald, |
| 58 |
PME |
| 59 |
}; |
| 60 |
enum constraintType |
| 61 |
{ |
| 62 |
None, |
| 63 |
HBonds, |
| 64 |
AllBonds, |
| 65 |
HAngles |
| 66 |
}; |
| 67 |
enum integratorType |
| 68 |
{ |
| 69 |
Langevin, |
| 70 |
Verlet, |
| 71 |
Brownian, |
| 72 |
VariableLangevin, |
| 73 |
VariableVerlet |
| 74 |
}; |
| 75 |
enum barostatType |
| 76 |
{ |
| 77 |
NoBarostat, |
| 78 |
MonteCarlo |
| 79 |
}; |
| 80 |
enum platformType |
| 81 |
{ |
| 82 |
Reference, |
| 83 |
OpenCL, |
| 84 |
CPU, |
| 85 |
CUDA |
| 86 |
}; |
| 87 |
enum precisionType |
| 88 |
{ |
| 89 |
singlePrecision, |
| 90 |
mixedPrecision, |
| 91 |
doublePrecision |
| 92 |
}; |
| 93 |
void setMolecule(QtGui::Molecule* molecule); |
| 94 |
|
| 95 |
protected: |
| 96 |
/** |
| 97 |
* Reimplemented to update the dialog when it is shown |
| 98 |
*/ |
| 99 |
void showEvent(QShowEvent* event) override; |
| 100 |
|
| 101 |
private: |
| 102 |
Ui::OpenMMInputDialog ui; |
| 103 |
QtGui::Molecule* m_molecule; |
| 104 |
|
| 105 |
// QString m_title; |
| 106 |
QString m_readData; |
| 107 |
forceFieldType m_forceFieldType; |
| 108 |
QString m_title; |
| 109 |
QString m_savePath; |
| 110 |
waterModelType m_waterModelType; |
| 111 |
nonBondedType m_nonBondedType; |
| 112 |
constraintType m_constraintType; |
| 113 |
integratorType m_integratorType; |
| 114 |
barostatType m_barostatType; |
| 115 |
|
| 116 |
int m_deviceIndex; |
| 117 |
int m_openclPlatformIndex; |
| 118 |
int m_rigidWater; |
| 119 |
double m_temperature; |
| 120 |
double m_generationTemperature; |
| 121 |
double m_nonBondedCutoff; |
| 122 |
double m_timeStep; |
| 123 |
double m_ewaldTolerance; |
| 124 |
double m_constraintTolerance; |
| 125 |
int m_reportInterval; |
| 126 |
int m_equilibriationSteps; |
| 127 |
int m_productionSteps; |
| 128 |
double m_errorTolerance; |
| 129 |
double m_collisionRate; |
| 130 |
double m_pressure; |
| 131 |
int m_barostatInterval; |
| 132 |
QString m_dumpXYZ; |
| 133 |
int m_dumpStep; |
| 134 |
int m_velocityDistRandom; |
| 135 |
platformType m_platformType; |
| 136 |
precisionType m_precisionType; |
| 137 |
int m_thermoInterval; |
| 138 |
int m_minimize; |
| 139 |
int m_minimizeSteps; |
| 140 |
bool m_DCDReporter; |
| 141 |
bool m_PDBReporter; |
| 142 |
bool m_stateDataReporter; |
| 143 |
bool m_stepIndex; |
| 144 |
bool m_time; |
| 145 |
bool m_speed; |
| 146 |
bool m_progress; |
| 147 |
bool m_potentialEnergy; |
| 148 |
bool m_kineticEnergy; |
| 149 |
bool m_totalEnergy; |
| 150 |
bool m_temperatureCheck; |
| 151 |
bool m_volume; |
| 152 |
bool m_density; |
| 153 |
|
| 154 |
QString m_output; |
| 155 |
bool m_dirty; |
| 156 |
bool m_warned; |
| 157 |
bool readData; |
| 158 |
|
| 159 |
QTextEdit* m_jobEdit; |
| 160 |
QTextEdit* m_moleculeEdit; |
| 161 |
QString m_inputCoordFileName; |
| 162 |
QString m_topologyFileName; |
| 163 |
QString m_jobFileName; |
| 164 |
|
| 165 |
// Generate an input deck as a string |
| 166 |
QString generateInputDeck(); |
| 167 |
// Translate enums to strings |
| 168 |
QString getForceFieldType(forceFieldType t); |
| 169 |
QString getImplicitSolventType(forceFieldType t); |
| 170 |
QString getConstraintType(constraintType t); |
| 171 |
QString getWaterModelType(waterModelType t); |
| 172 |
QString getNonBondedType(nonBondedType t); |
| 173 |
QString getIntegratorType(integratorType t); |
| 174 |
QString getBarostatType(barostatType t); |
| 175 |
QString getRigidWater(int t); |
| 176 |
QString getVelocityDistRandom(int t); |
| 177 |
QString getPlatformType(platformType t); |
| 178 |
QString getPrecisionType(precisionType t); |
| 179 |
QString getMinimize(int t); |
| 180 |
|
| 181 |
// Enable/disable form elements |
| 182 |
void deckDirty(bool); |
| 183 |
void addMoleculeDataTab(); |
| 184 |
|
| 185 |
public Q_SLOTS: |
| 186 |
void updatePreviewText(); |
| 187 |
|
| 188 |
private Q_SLOTS: |
| 189 |
//! Button Slots |
| 190 |
void textEditModified(); |
| 191 |
void resetClicked(); |
| 192 |
void generateClicked(); |
| 193 |
void enableFormClicked(); |
| 194 |
|
| 195 |
void setScriptName(); |
| 196 |
void setInputCoordName(); |
| 197 |
void setTopologyName(); |
| 198 |
|
| 199 |
void setForceField(int); |
| 200 |
void setConstraintType(int); |
| 201 |
void setWaterModelType(int); |
| 202 |
void setNonBondedType(int); |
| 203 |
|
| 204 |
void setIntegratorType(int); |
| 205 |
void setBarostatType(int); |
| 206 |
|
| 207 |
void setRigidWater(int); |
| 208 |
void setTemperature(double); |
| 209 |
void setGenerationTemperature(double); |
| 210 |
void setNonBondedCutoff(double); |
| 211 |
|
| 212 |
void setTimeStep(double); |
| 213 |
void setEwaldTolerance(double); |
| 214 |
void setConstraintTolerance(double); |
| 215 |
void setReportInterval(int); |
| 216 |
void setEquilibriationSteps(int); |
| 217 |
void setProductionSteps(int); |
| 218 |
void setDeviceIndex(int); |
| 219 |
void setOpenCLPlatformIndex(int); |
| 220 |
void setErrorTolerance(double); |
| 221 |
void setCollisionRate(double); |
| 222 |
void setPressure(double); |
| 223 |
void setBarostatInterval(int); |
| 224 |
|
| 225 |
void setVelocityDistRandom(int); |
| 226 |
void setDCDReporter(bool); |
| 227 |
void setPDBReporter(bool); |
| 228 |
void setStateDataReporter(bool); |
| 229 |
void setStepIndexBoolean(bool); |
| 230 |
void setTimeBoolean(bool); |
| 231 |
void setSpeedBoolean(bool); |
| 232 |
void setProgressBoolean(bool); |
| 233 |
void setPotentialEnergyBoolean(bool); |
| 234 |
void setKineticEnergyBoolean(bool); |
| 235 |
void setTotalEnergyBoolean(bool); |
| 236 |
void setTemperatureBoolean(bool); |
| 237 |
void setVolumeBoolean(bool); |
| 238 |
void setDensityBoolean(bool); |
| 239 |
void setPlatformType(int); |
| 240 |
void setPrecisionType(int); |
| 241 |
void setMinimize(int); |
| 242 |
void setMinimizeSteps(int); |
| 243 |
}; |
| 244 |
} // namespace QtPlugins |
| 245 |
} // namespace Avogadro |
| 246 |
|
| 247 |
#endif |