Simbody  3.7
Force_Thermostat.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMBODY_FORCE_THERMOSTAT_H_
2 #define SimTK_SIMBODY_FORCE_THERMOSTAT_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * Simbody(tm) *
6  * -------------------------------------------------------------------------- *
7  * This is part of the SimTK biosimulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11  * *
12  * Portions copyright (c) 2009-12 Stanford University and the Authors. *
13  * Authors: Michael Sherman *
14  * Contributors: Christopher Bruns *
15  * *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17  * not use this file except in compliance with the License. You may obtain a *
18  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19  * *
20  * Unless required by applicable law or agreed to in writing, software *
21  * distributed under the License is distributed on an "AS IS" BASIS, *
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23  * See the License for the specific language governing permissions and *
24  * limitations under the License. *
25  * -------------------------------------------------------------------------- */
26 
33 #include "SimTKcommon.h"
34 #include "simbody/internal/Force.h"
35 
36 namespace SimTK {
37 
132 public:
137  const SimbodyMatterSubsystem& matter,
138  Real boltzmannsConstant,
139  Real bathTemperature,
140  Real relaxationTime,
141  int numExcludedDofs = 6);
142 
143 
146 
151  Thermostat& excludeMobilizedBody(MobilizedBodyIndex);
152 
155  Thermostat& setDefaultNumChains(int numChains);
156 
160  Thermostat& setDefaultBathTemperature(Real bathTemperature);
161 
163  Thermostat& setDefaultRelaxationTime(Real relaxationTime);
164 
169  Thermostat& setDefaultNumExcludedDofs(int numExcludedDofs);
170 
174  int getDefaultNumChains() const;
178  Real getDefaultBathTemperature() const;
181  Real getDefaultRelaxationTime() const;
186  int getDefaultNumExcludedDofs() const;
187 
190  Real getBoltzmannsConstant() const;
191 
195  const Thermostat& setNumChains(State&, int numChains) const;
201  const Thermostat& setBathTemperature(State&, Real Tb) const;
206  const Thermostat& setRelaxationTime(State&, Real t) const;
211  const Thermostat& setNumExcludedDofs(State&, int numExcludedDofs) const;
212 
216  int getNumChains(const State&) const;
221  Real getBathTemperature(const State&) const;
224  Real getRelaxationTime(const State&) const;
229  int getNumExcludedDofs(const State&) const;
230 
235  int getNumThermalDofs(const State&) const;
236 
240  Real getCurrentTemperature(const State&) const;
241 
243  void initializeChainState(State&) const;
247  void setChainState(State&, const Vector&) const;
248 
252  Vector getChainState(const State&) const;
253 
257  Real calcBathEnergy(const State& state) const;
258 
261  Real getExternalPower(const State& state) const;
262 
265  Real getExternalWork(const State& state) const;
266 
269  void setExternalWork(State& state, Real work) const;
270 
274  void initializeSystemToBathTemperature(State&) const;
275 
281  void setSystemToTemperature(State&, Real T) const;
282 
283  // Don't show this in Doxygen.
287 };
288 
289 } // namespace SimTK
290 
291 
292 #endif // SimTK_SIMBODY_FORCE_THERMOSTAT_H_
This is the base class from which all Force element handle classes derive.
Definition: Force.h:50
This is a feedback-controlled force that uses Nose'-Hoover chains to maintain a particular temperatur...
Definition: Force_Thermostat.h:131
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:606
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
Includes internal headers providing declarations for the basic SimTK Core classes, including Simmatrix.
#define SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(DERIVED, DERIVED_IMPL, PARENT)
Definition: PrivateImplementation.h:343
This is a concrete subsystem which can apply arbitrary forces to a MultibodySystem.
Definition: GeneralForceSubsystem.h:47
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:68
Thermostat()
Default constructor creates an empty handle.
Definition: Force_Thermostat.h:145
This subsystem contains the bodies ("matter") in the multibody system, the mobilizers (joints) that d...
Definition: SimbodyMatterSubsystem.h:133