Simbody
3.4 (development)
|
00001 #ifndef SimTK_SIMBODY_FORCE_LINEAR_BUSHING_H_ 00002 #define SimTK_SIMBODY_FORCE_LINEAR_BUSHING_H_ 00003 00004 /* -------------------------------------------------------------------------- * 00005 * Simbody(tm) * 00006 * -------------------------------------------------------------------------- * 00007 * This is part of the SimTK biosimulation toolkit originating from * 00008 * Simbios, the NIH National Center for Physics-Based Simulation of * 00009 * Biological Structures at Stanford, funded under the NIH Roadmap for * 00010 * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. * 00011 * * 00012 * Portions copyright (c) 2009-12 Stanford University and the Authors. * 00013 * Authors: Michael Sherman * 00014 * Contributors: * 00015 * * 00016 * Licensed under the Apache License, Version 2.0 (the "License"); you may * 00017 * not use this file except in compliance with the License. You may obtain a * 00018 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * 00019 * * 00020 * Unless required by applicable law or agreed to in writing, software * 00021 * distributed under the License is distributed on an "AS IS" BASIS, * 00022 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 00023 * See the License for the specific language governing permissions and * 00024 * limitations under the License. * 00025 * -------------------------------------------------------------------------- */ 00026 00027 #include "SimTKcommon.h" 00028 #include "simbody/internal/Force.h" 00029 00036 namespace SimTK { 00101 class SimTK_SIMBODY_EXPORT Force::LinearBushing : public Force { 00102 public: 00124 LinearBushing(GeneralForceSubsystem& forces, 00125 const MobilizedBody& body1, const Transform& frameFOnB1, 00126 const MobilizedBody& body2, const Transform& frameMOnB2, 00127 const Vec6& stiffness, const Vec6& damping); 00128 00146 LinearBushing(GeneralForceSubsystem& forces, 00147 const MobilizedBody& body1, 00148 const MobilizedBody& body2, 00149 const Vec6& stiffness, const Vec6& damping); 00150 00152 LinearBushing() {} 00153 00154 00155 //-------------------------------------------------------------------------- 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 LinearBushing& setDefaultFrameOnBody1(const Transform& X_B1F); 00189 LinearBushing& setDefaultFrameOnBody2(const Transform& X_B2M); 00198 LinearBushing& setDefaultStiffness(const Vec6& stiffness); 00207 LinearBushing& setDefaultDamping(const Vec6& damping); 00208 00215 const Transform& getDefaultFrameOnBody1() const; 00222 const Transform& getDefaultFrameOnBody2() const; 00227 const Vec6& getDefaultStiffness() const; 00233 const Vec6& getDefaultDamping() const; 00235 00236 00237 00238 //-------------------------------------------------------------------------- 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 const LinearBushing& setFrameOnBody1(State& state, 00269 const Transform& X_B1F) const; 00282 const LinearBushing& setFrameOnBody2(State& state, 00283 const Transform& X_B2M) const; 00295 const LinearBushing& setStiffness(State& state, 00296 const Vec6& stiffness) const; 00308 const LinearBushing& setDamping(State& state, 00309 const Vec6& damping) const; 00310 00320 const Transform& getFrameOnBody1(const State& state) const; 00330 const Transform& getFrameOnBody2(const State& state) const; 00340 const Vec6& getStiffness(const State& state) const; 00350 const Vec6& getDamping(const State& state) const; 00352 00353 00354 00355 //-------------------------------------------------------------------------- 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 const Vec6& getQ(const State& state) const; 00380 00388 const Transform& getX_GF(const State& state) const; 00389 00397 const Transform& getX_GM(const State& state) const; 00398 00406 const Transform& getX_FM(const State& state) const; 00408 00409 00410 00411 //-------------------------------------------------------------------------- 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433 00434 00435 const Vec6& getQDot(const State& state) const; 00436 00448 const SpatialVec& getV_GF(const State& state) const; 00449 00461 const SpatialVec& getV_GM(const State& state) const; 00462 00475 const SpatialVec& getV_FM(const State& state) const; 00477 00478 00479 00480 //-------------------------------------------------------------------------- 00491 00492 00493 00494 00495 00496 00497 00498 00499 00500 00501 00502 00503 00504 00505 const Vec6& getF(const State& state) const; 00506 00516 const SpatialVec& getF_GM(const State& state) const; 00517 00528 const SpatialVec& getF_GF(const State& state) const; 00530 00531 00532 00533 //-------------------------------------------------------------------------- 00539 00540 00541 00542 00543 00544 00545 00546 00547 00548 Real getPotentialEnergy(const State& state) const; 00549 00560 Real getPowerDissipation(const State& state) const; 00561 00575 Real getDissipatedEnergy(const State& state) const; 00576 00589 void setDissipatedEnergy(State& state, Real energy) const; 00591 00592 // Don't show this in Doxygen. 00594 SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS 00595 (LinearBushing, LinearBushingImpl, Force); 00597 }; 00598 00599 } // namespace SimTK 00600 00601 #endif // SimTK_SIMBODY_FORCE_LINEAR_BUSHING_H_