00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OST_MM_SETTINGS_HH
00021 #define OST_MM_SETTINGS_HH
00022
00023
00024
00025
00026
00027 #include <vector>
00028
00029 #include <boost/shared_ptr.hpp>
00030 #include <limits>
00031 #include <ost/mol/residue_handle.hh>
00032 #include <ost/mol/mm/forcefield.hh>
00033 #include <ost/platform.hh>
00034 #include <boost/filesystem/path.hpp>
00035 #include <ost/log.hh>
00036
00037 namespace OpenMM{
00038 class Integrator;
00039
00040
00041 }
00042
00043 namespace ost { namespace mol{ namespace mm{
00044
00045 struct Settings;
00046 class TerminiExceptions;
00047 typedef boost::shared_ptr<Settings> SettingsPtr;
00048 typedef boost::shared_ptr<TerminiExceptions> TerminiExceptionsPtr;
00049
00050 enum Platform{
00051 Reference,
00052 OpenCL,
00053 CUDA,
00054 CPU
00055 };
00056
00057 enum NonbondedMethod{
00058 NoCutoff,
00059 CutoffNonPeriodic,
00060 CutoffPeriodic,
00061 Ewald,
00062 PME
00063 };
00064
00065 class TerminiExceptions{
00066
00067 public:
00068
00069 TerminiExceptions(){ }
00070
00071 void SetException(const ost::mol::ResidueHandle& res, const String& exception_name){
00072 exceptions_[res.GetHashCode()] = exception_name;
00073 }
00074
00075 bool HasException(const ost::mol::ResidueHandle& res) const{
00076 return exceptions_.find(res.GetHashCode()) != exceptions_.end();
00077 }
00078
00079 String GetException(const ost::mol::ResidueHandle& res) const {
00080 if(!this->HasException(res)){
00081 std::stringstream ss;
00082 ss<<"Tried to get termini exceptions of res "<<res<<" without defined exception!";
00083 throw ost::Error(ss.str());
00084 }
00085 std::map<unsigned long, String>::const_iterator i = exceptions_.find(res.GetHashCode());
00086 return i->second;
00087 }
00088 private:
00089 std::map<unsigned long, String> exceptions_;
00090
00091 };
00092
00093 typedef std::map<String,String> PropertyMap;
00094
00095 struct Settings{
00096
00097 Settings(): add_bonds(true),
00098 add_angles(true),
00099 add_dihedrals(true),
00100 add_impropers(true),
00101 add_cmaps(true),
00102 add_exclusions(true),
00103 add_nonbonded(true),
00104 add_gbsa(false),
00105 constrain_hbonds(false),
00106 constrain_bonds(false),
00107 rigid_water(false),
00108 strict_interactions(true),
00109 ideal_bond_length_constraints(true),
00110 fix_heavy_atoms(false),
00111 kill_electrostatics(false),
00112 generate_disulfid_bonds(true),
00113 nonbonded_method(NoCutoff),
00114 nonbonded_cutoff(10.0),
00115 remove_cmm_motion(true),
00116 cmm_frequency(1),
00117 periodic_box_extents(0,0,0),
00118 init_temperature(0.0),
00119 forcefield(),
00120
00121 termini_exceptions(new TerminiExceptions),
00122 platform(Reference),
00123 reference_properties(),
00124 cpu_properties(),
00125 opencl_properties(),
00126 cuda_properties(),
00127 add_thermostat(false),
00128 thermostat_temperature(std::numeric_limits<Real>::quiet_NaN()),
00129 thermostat_collision_frequency(std::numeric_limits<Real>::quiet_NaN()),
00130 add_barostat(false),
00131 barostat_temperature(std::numeric_limits<Real>::quiet_NaN()),
00132 barostat_pressure(std::numeric_limits<Real>::quiet_NaN()),
00133 barostat_frequency(25),
00134 integrator(),
00135 solvent_dielectric(78.3),
00136 solute_dielectric(1.0),
00137 reaction_field_dielectric(78.3),
00138 use_dispersion_correction(true),
00139 keep_ff_specific_naming(true),
00140 openmm_plugin_directory("/unibas/lcs-software/software/OpenMM/6.1-Linux64/lib/plugins") {
00141
00142 try {
00143
00144 boost::filesystem::path shared_path(GetSharedDataPath());
00145 custom_plugin_directory = (shared_path / "openmm_plugins").string();
00146 } catch (std::runtime_error& e) {
00147
00148 LOG_WARNING("Failed to find shared data path for openmm_plugins. "
00149 "Please set custom_plugin_directory of Settings object "
00150 "manually or ensure that OST_ROOT is set properly. "
00151 "Caught exception: " << e.what());
00152 custom_plugin_directory = openmm_plugin_directory;
00153 }
00154
00155 }
00156
00157
00158 bool add_bonds;
00159 bool add_angles;
00160 bool add_dihedrals;
00161 bool add_impropers;
00162 bool add_cmaps;
00163 bool add_exclusions;
00164 bool add_nonbonded;
00165 bool add_gbsa;
00166 bool constrain_hbonds;
00167 bool constrain_bonds;
00168 bool rigid_water;
00169 bool strict_interactions;
00170 bool ideal_bond_length_constraints;
00171 bool fix_heavy_atoms;
00172
00173 bool kill_electrostatics;
00174
00175 bool generate_disulfid_bonds;
00176
00177 NonbondedMethod nonbonded_method;
00178 Real nonbonded_cutoff;
00179 bool remove_cmm_motion;
00180 int cmm_frequency;
00181
00182 geom::Vec3 periodic_box_extents;
00183
00184
00185 Real init_temperature;
00186 ForcefieldPtr forcefield;
00187 TerminiExceptionsPtr termini_exceptions;
00188 Platform platform;
00189 PropertyMap reference_properties;
00190 PropertyMap cpu_properties;
00191 PropertyMap opencl_properties;
00192 PropertyMap cuda_properties;
00193 bool add_thermostat;
00194 Real thermostat_temperature;
00195 Real thermostat_collision_frequency;
00196 bool add_barostat;
00197 Real barostat_temperature;
00198 Real barostat_pressure;
00199 int barostat_frequency;
00200 boost::shared_ptr<OpenMM::Integrator> integrator;
00201 Real solvent_dielectric;
00202 Real solute_dielectric;
00203 Real reaction_field_dielectric;
00204 bool use_dispersion_correction;
00205 bool keep_ff_specific_naming;
00206 String openmm_plugin_directory;
00207 String custom_plugin_directory;
00208 };
00209
00210 }}}
00211
00212 #endif