Simbody
3.4 (development)
|
00001 #ifndef SimTK_SIMBODY_FORCE_SUBSYSTEM_GUTS_H 00002 #define SimTK_SIMBODY_FORCE_SUBSYSTEM_GUTS_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) 2005-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 00031 #include "SimTKcommon.h" 00032 00033 #include "simbody/internal/common.h" 00034 #include "simbody/internal/MultibodySystem.h" 00035 00036 namespace SimTK { 00037 00039 class ForceSubsystem::Guts : public Subsystem::Guts { 00040 public: 00041 Guts(const String& name, const String& version) 00042 : Subsystem::Guts(name,version) 00043 { 00044 } 00045 00046 // Make sure the virtual destructor in Subsystem::Guts remains 00047 // virtual in this intermediate class. 00048 virtual ~Guts() { } 00049 00050 // All the other Subsystem::Guts virtuals remain unresolved. 00051 00052 // Return the MultibodySystem which owns this ForceSubsystem. 00053 const MultibodySystem& getMultibodySystem() const { 00054 return MultibodySystem::downcast(getSystem()); 00055 } 00056 00059 virtual Real calcPotentialEnergy(const State& state) const = 0; 00060 00061 SimTK_DOWNCAST(ForceSubsystem::Guts, Subsystem::Guts); 00062 }; 00063 00064 // typedef ForceSubsystem::Guts ForceSubsystemRep; 00065 00066 } // namespace SimTK 00067 00068 #endif // SimTK_SIMBODY_FORCE_SUBSYSTEM_GUTS_H