00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IMPATOM_SIMULATION_PARAMETERS_H
00009 #define IMPATOM_SIMULATION_PARAMETERS_H
00010
00011 #include "atom_config.h"
00012 #include "atom_macros.h"
00013 #include "Residue.h"
00014 #include "Hierarchy.h"
00015 #include <IMP/core/utility.h>
00016 #include <IMP/core/XYZ.h>
00017 #include <IMP/core/core_macros.h>
00018
00019 #include <IMP/base_types.h>
00020 #include <IMP/Particle.h>
00021 #include <IMP/Model.h>
00022 #include <IMP/internal/units.h>
00023 #include <IMP/internal/constants.h>
00024
00025 #include <vector>
00026 #include <deque>
00027
00028 IMPATOM_BEGIN_NAMESPACE
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class IMPATOMEXPORT SimulationParameters: public Decorator
00039 {
00040 public:
00041 IMP_DECORATOR(SimulationParameters, Decorator);
00042
00043
00044
00045 static SimulationParameters setup_particle(Particle *p,
00046 double time_step=1e3,
00047 double T
00048 #ifndef SWIG
00049 =IMP::internal::DEFAULT_TEMPERATURE.get_value()
00050 #else
00051 =298
00052 #endif
00053 );
00054
00055
00056
00057 static bool particle_is_instance(Particle *p) {
00058 return p->has_attribute(get_current_time_key())
00059 && p->has_attribute(get_last_time_step_key());
00060 }
00061
00062 Float get_temperature_in_kelvin() const {
00063 return get_particle()->get_value(get_temperature_key());
00064 }
00065 Float get_current_time_in_femtoseconds() const {
00066 return get_particle()->get_value(get_current_time_key());
00067 }
00068 Float get_last_time_step_in_femtoseconds() const {
00069 return get_particle()->get_value(get_last_time_step_key());
00070 }
00071 Float get_maximum_time_step_in_femtoseconds() const {
00072 return get_particle()->get_value(get_maximum_time_step_key());
00073 }
00074
00075 void set_current_time_in_femtoseconds(double t) {
00076 get_particle()->set_value(get_current_time_key(),
00077 t);
00078 }
00079
00080 void set_last_time_step_in_femtoseconds(double t) {
00081 get_particle()->set_value(get_last_time_step_key(),
00082 t);
00083 }
00084 void set_maximum_time_step_in_femtoseconds(double t) {
00085 get_particle()->set_value(get_maximum_time_step_key(),
00086 t);
00087 }
00088
00089
00090 static FloatKey get_last_time_step_key();
00091
00092 static FloatKey get_current_time_key();
00093
00094 static FloatKey get_maximum_time_step_key();
00095
00096 static FloatKey get_temperature_key();
00097
00098 #ifndef IMP_DOXYGEN
00099 #ifndef SWIG
00100 unit::Femtosecond get_current_time() const {
00101 return unit::Femtosecond(get_current_time_in_femtoseconds());
00102 }
00103 unit::Femtosecond get_last_time_step() const {
00104 return unit::Femtosecond(get_last_time_step_in_femtoseconds());
00105 }
00106 unit::Femtosecond get_maximum_time_step() const {
00107 return unit::Femtosecond(get_maximum_time_step_in_femtoseconds());
00108 }
00109 void set_maximum_time_step(unit::Femtosecond ts) {
00110 if (get_last_time_step() == unit::Femtosecond(0)) set_last_time_step(ts);
00111 set_maximum_time_step_in_femtoseconds(unit::strip_units(ts));
00112 }
00113 void set_last_time_step(unit::Femtosecond ts) {
00114 set_last_time_step_in_femtoseconds(unit::strip_units(ts));
00115 }
00116 unit::Kelvin get_temperature() const {
00117 return unit::Kelvin(get_temperature_in_kelvin());
00118 }
00119 void set_current_time(unit::Femtosecond t) {
00120 set_current_time_in_femtoseconds(unit::strip_units(t));
00121 }
00122
00123 unit::Femtojoule get_kT() const;
00124 #endif
00125 #endif
00126 };
00127
00128 IMP_OUTPUT_OPERATOR(SimulationParameters);
00129
00130
00131 IMPATOM_END_NAMESPACE
00132
00133 #endif