OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
settings.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2015 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 
20 #ifndef OST_MM_SETTINGS_HH
21 #define OST_MM_SETTINGS_HH
22 
23 /*
24  DO NOT EDIT, automatically generated by CMake
25 */
26 
27 #include <vector>
28 
29 #include <boost/shared_ptr.hpp>
30 #include <limits>
32 #include <ost/mol/mm/forcefield.hh>
33 #include <ost/platform.hh>
34 #include <boost/filesystem/path.hpp>
35 #include <ost/log.hh>
36 
37 namespace OpenMM{
38  class Integrator;//hacky way of telling the Integrator us around
39  //will be included in source file to avoid
40  //dependencies on external libraries
41 }
42 
43 namespace ost { namespace mol{ namespace mm{
44 
45 struct Settings;
47 typedef boost::shared_ptr<Settings> SettingsPtr;
48 typedef boost::shared_ptr<TerminiExceptions> TerminiExceptionsPtr;
49 
50 enum Platform{
55 };
56 
63 };
64 
66 
67 public:
68 
70 
71  void SetException(const ost::mol::ResidueHandle& res, const String& exception_name){
72  exceptions_[res.GetHashCode()] = exception_name;
73  }
74 
75  bool HasException(const ost::mol::ResidueHandle& res) const{
76  return exceptions_.find(res.GetHashCode()) != exceptions_.end();
77  }
78 
80  if(!this->HasException(res)){
81  std::stringstream ss;
82  ss<<"Tried to get termini exceptions of res "<<res<<" without defined exception!";
83  throw ost::Error(ss.str());
84  }
85  std::map<unsigned long, String>::const_iterator i = exceptions_.find(res.GetHashCode());
86  return i->second;
87  }
88 private:
89  std::map<unsigned long, String> exceptions_;
90 
91 };
92 
93 typedef std::map<String,String> PropertyMap;
94 
95 struct Settings{
96 
97  Settings(): add_bonds(true),
98  add_angles(true),
99  add_dihedrals(true),
100  add_impropers(true),
101  add_cmaps(true),
102  add_exclusions(true),
103  add_nonbonded(true),
104  add_gbsa(false),
105  constrain_hbonds(false),
106  constrain_bonds(false),
107  rigid_water(false),
108  strict_interactions(true),
110  fix_heavy_atoms(false),
111  kill_electrostatics(false),
114  nonbonded_cutoff(10.0),
115  remove_cmm_motion(true),
116  cmm_frequency(1),
117  periodic_box_extents(0,0,0),
118  init_temperature(0.0),
119  forcefield(), //note, that we don't create an empty forcefield at this point =>force the user
120  //to assign a forcefield
124  cpu_properties(),
126  cuda_properties(),
127  add_thermostat(false),
128  thermostat_temperature(std::numeric_limits<Real>::quiet_NaN()),
129  thermostat_collision_frequency(std::numeric_limits<Real>::quiet_NaN()),
130  add_barostat(false),
131  barostat_temperature(std::numeric_limits<Real>::quiet_NaN()),
132  barostat_pressure(std::numeric_limits<Real>::quiet_NaN()),
133  barostat_frequency(25),
134  integrator(),
135  solvent_dielectric(78.3), //this is for GBSA
136  solute_dielectric(1.0), //this is for GBSA
140  openmm_plugin_directory("/unibas/lcs-software/software/OpenMM/7.1.1-goolf-1.7.20-Python-2.7.11/lib/plugins") {
141 
142  try {
143  // try to guess custom_plugin_directory
144  boost::filesystem::path shared_path(GetSharedDataPath());
145  custom_plugin_directory = (shared_path / "openmm_plugins").string();
146  } catch (std::runtime_error& e) {
147  // fallback to OpenMM path (used to be default in OST before 1.7)
148  LOG_WARNING("Failed to find shared data path for openmm_plugins. "
149  "Please set custom_plugin_directory of Settings object "
150  "manually or ensure that OST_ROOT is set properly. "
151  "Caught exception: " << e.what());
153  }
154 
155  }
156 
157  //
158  bool add_bonds;
162  bool add_cmaps;
165  bool add_gbsa;
172  //set all charges to zero
174  //automatically generate disulfid bonds
176  //see export_openmm.cc for all possibilities
181  //currently only boxes defined by base vectors are supported
183  //at the beginning of the simulation, the initial velociities are
184  //randomly set according to a boltzmann distribution
200  boost::shared_ptr<OpenMM::Integrator> integrator;
208 };
209 
210 }}} //namespace
211 
212 #endif
void SetException(const ost::mol::ResidueHandle &res, const String &exception_name)
Definition: settings.hh:71
Real thermostat_collision_frequency
Definition: settings.hh:195
std::string String
Definition: base.hh:54
float Real
Definition: base.hh:44
geom::Vec3 periodic_box_extents
Definition: settings.hh:182
PropertyMap cpu_properties
Definition: settings.hh:190
String openmm_plugin_directory
Definition: settings.hh:206
ForcefieldPtr forcefield
Definition: settings.hh:186
#define LOG_WARNING(m)
Definition: log.hh:85
boost::shared_ptr< Settings > SettingsPtr
Definition: settings.hh:46
bool ideal_bond_length_constraints
Definition: settings.hh:170
PropertyMap cuda_properties
Definition: settings.hh:192
PropertyMap reference_properties
Definition: settings.hh:189
unsigned long GetHashCode() const
TerminiExceptionsPtr termini_exceptions
Definition: settings.hh:187
boost::shared_ptr< ost::mol::mm::Forcefield > ForcefieldPtr
Definition: forcefield.hh:42
PropertyMap opencl_properties
Definition: settings.hh:191
Three dimensional vector class, using Real precision.
Definition: vec3.hh:42
NonbondedMethod nonbonded_method
Definition: settings.hh:177
String DLLEXPORT_OST_BASE GetSharedDataPath()
String custom_plugin_directory
Definition: settings.hh:207
bool HasException(const ost::mol::ResidueHandle &res) const
Definition: settings.hh:75
std::map< String, String > PropertyMap
Definition: settings.hh:93
boost::shared_ptr< OpenMM::Integrator > integrator
Definition: settings.hh:200
boost::shared_ptr< TerminiExceptions > TerminiExceptionsPtr
Definition: settings.hh:48
String GetException(const ost::mol::ResidueHandle &res) const
Definition: settings.hh:79