The topics covered in this section include:
The OpenSim API uses the Simbios "simulation toolkit" SimTK as its low-level, domain-independent computational layer. Some familiarity with SimTK is required to use the OpenSim API because some of the SimTK objects are visible there. This chapter presents a brief introduction to the parts of SimTK that are most commonly used with the OpenSim API; you can find more documentation for SimTK elsewhere (see https://simtk.org/home/simtkcore, Documents tab). The intent, however, is that there is enough material here so that you can use the OpenSim API for many purposes without having to look further.
SimTK provides a broad base of functionality. We will discuss the subset needed for the OpenSim API in six groups:
Together, the numerical objects and numerical methods provide Matlab-like functionality accessible from C++. We will cover the low-level numerical objects in detail, provide an introduction to the available numerical methods, and introduce basic concepts for Simbody and the SimTK simulation architecture as employed by OpenSim.
All symbol names that come from SimTK are in the SimTK namespace, while symbols introduced by OpenSim are in the OpenSim namespace. In most cases you will want to include the following line at the top of your source files so that you do not have to repeat the namespace for every SimTK symbol:
using namespace SimTK;
Alternatively, you can introduce symbols selectively with statements like
Or you can prefix the symbols with SimTK:: when you use them. There are a few symbols, typically pre-processor macros, that cannot be put in a C++ namespace; those symbols begin with the six-character string "SimTK_" instead.
SimTK uses mixedUpperAndLowerCase names with a capital letter used to begin a new word. Class names and constants begin with a CapitalLetter. Method (function) names and variable names begin with a lowerCaseLetter. Pre-processor macros, except for the initial SimTK prefix, are written in ALL_CAPS with underscores separating words.
This chapter provides a quick look at SimTK, but there is much more to learn if you are interested. A good place to start is https://simtk.org/home/simtkcore, Documents tab, where you will find several tutorials and theory manuals. More information and source code for the projects making up SimTK can be found on Simtk.org under projects: simbody, simmath, cpodes, simtkcommon, and lapack.
Next: Numbers and Constants in SimTK