Simbody

Force_Thermostat.h

Go to the documentation of this file.
00001 #ifndef SimTK_SIMBODY_FORCE_THERMOSTAT_H_
00002 #define SimTK_SIMBODY_FORCE_THERMOSTAT_H_
00003 /* -------------------------------------------------------------------------- *
00004  *                      SimTK Core: SimTK Simbody(tm)                         *
00005  * -------------------------------------------------------------------------- *
00006  * This is part of the SimTK Core biosimulation toolkit originating from      *
00007  * Simbios, the NIH National Center for Physics-Based Simulation of           *
00008  * Biological Structures at Stanford, funded under the NIH Roadmap for        *
00009  * Medical Research, grant U54 GM072970. See https://simtk.org.               *
00010  *                                                                            *
00011  * Portions copyright (c) 2009 Stanford University and the Authors.           *
00012  * Authors: Michael Sherman                                                   *
00013  * Contributors: Chris Bruns                                                  *
00014  *                                                                            *
00015  * Permission is hereby granted, free of charge, to any person obtaining a    *
00016  * copy of this software and associated documentation files (the "Software"), *
00017  * to deal in the Software without restriction, including without limitation  *
00018  * the rights to use, copy, modify, merge, publish, distribute, sublicense,   *
00019  * and/or sell copies of the Software, and to permit persons to whom the      *
00020  * Software is furnished to do so, subject to the following conditions:       *
00021  *                                                                            *
00022  * The above copyright notice and this permission notice shall be included in *
00023  * all copies or substantial portions of the Software.                        *
00024  *                                                                            *
00025  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
00026  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   *
00027  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    *
00028  * THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,    *
00029  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR      *
00030  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE  *
00031  * USE OR OTHER DEALINGS IN THE SOFTWARE.                                     *
00032  * -------------------------------------------------------------------------- */
00033 
00040 #include "SimTKcommon.h"
00041 #include "simbody/internal/Force.h"
00042 
00043 namespace SimTK {
00044 
00138 class SimTK_SIMBODY_EXPORT Force::Thermostat : public Force {
00139 public:
00143     Thermostat(GeneralForceSubsystem&        forces, 
00144                const SimbodyMatterSubsystem& matter, 
00145                Real                          boltzmannsConstant, 
00146                Real                          bathTemperature, 
00147                Real                          relaxationTime,
00148                int                           numExcludedDofs = 6);
00149 
00154     Thermostat& excludeMobilizedBody(MobilizedBodyIndex);
00155 
00158     Thermostat& setDefaultNumChains(int numChains);
00159 
00163     Thermostat& setDefaultBathTemperature(Real bathTemperature);
00164 
00166     Thermostat& setDefaultRelaxationTime(Real relaxationTime);
00167 
00172     Thermostat& setDefaultNumExcludedDofs(int numExcludedDofs);
00173 
00177     int getDefaultNumChains() const;
00181     Real getDefaultBathTemperature() const;
00184     Real getDefaultRelaxationTime() const;
00189     int getDefaultNumExcludedDofs() const;
00190 
00193     Real getBoltzmannsConstant() const;
00194 
00198     const Thermostat& setNumChains(State&, int numChains) const;
00204     const Thermostat& setBathTemperature(State&, Real Tb) const;
00209     const Thermostat& setRelaxationTime(State&, Real t) const;
00214     const Thermostat& setNumExcludedDofs(State&, int numExcludedDofs) const;
00215 
00219     int getNumChains(const State&) const;
00224     Real getBathTemperature(const State&) const;
00227     Real getRelaxationTime(const State&) const;
00232     int getNumExcludedDofs(const State&) const;
00233 
00238     int getNumThermalDofs(const State&) const;
00239 
00243     Real getCurrentTemperature(const State&) const;
00244 
00246     void initializeChainState(State&) const;
00250     void setChainState(State&, const Vector&) const;
00251 
00255     Vector getChainState(const State&) const;
00256 
00260     Real calcBathEnergy(const State& state) const;
00261 
00264     Real getExternalPower(const State& state) const;
00265 
00268     Real getExternalWork(const State& state) const;
00269 
00272     void setExternalWork(State& state, Real work) const;
00273 
00277     void initializeSystemToBathTemperature(State&) const;
00278 
00284     void setSystemToTemperature(State&, Real T) const;
00285 
00286     // Don't show this in Doxygen.
00288     SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(Thermostat, ThermostatImpl, Force);
00290 };
00291 
00292 } // namespace SimTK
00293 
00294 
00295 #endif // SimTK_SIMBODY_FORCE_THERMOSTAT_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines