GeneralForceSubsystem Class Reference

This is a concrete subsystem which can apply arbitrary forces to a MultibodySystem. More...

#include <GeneralForceSubsystem.h>

Inheritance diagram for GeneralForceSubsystem:
ForceSubsystem Subsystem

List of all members.

Public Member Functions

 GeneralForceSubsystem ()
 GeneralForceSubsystem (MultibodySystem &)
ForceIndex adoptForce (Force &force)
 Attach a new force to this subsystem.
int getNumForces () const
 Get the number of Forces which have been added.
const ForcegetForce (ForceIndex index) const
 Get a const reference to a Force by index.
ForceupdForce (ForceIndex index)
 Get a modifiable reference to a Force by index.
bool isForceDisabled (const State &state, ForceIndex index) const
 Get whether a force is disabled.
void setForceIsDisabled (State &state, ForceIndex index, bool disabled)
 Set whether a force is disabled.
 SimTK_PIMPL_DOWNCAST (GeneralForceSubsystem, ForceSubsystem)
int getNForces () const

Detailed Description

This is a concrete subsystem which can apply arbitrary forces to a MultibodySystem.

Each force is represented by a Force object. For example, to add a spring between two bodies, you would write

 GeneralForceSubsystem forces(system);
 ...
 Force::TwoPointLinearSpring(forces, body1, station1, body2, station2, k, x0);
 

Constructor & Destructor Documentation

GeneralForceSubsystem ( MultibodySystem  )  [explicit]

Member Function Documentation

ForceIndex adoptForce ( Force force  ) 

Attach a new force to this subsystem.

The subsystem takes over ownership of the force, leaving the passed in handle as a reference to it.

const Force& getForce ( ForceIndex  index  )  const

Get a const reference to a Force by index.

int getNForces (  )  const [inline]
int getNumForces (  )  const

Get the number of Forces which have been added.

bool isForceDisabled ( const State state,
ForceIndex  index 
) const

Get whether a force is disabled.

void setForceIsDisabled ( State state,
ForceIndex  index,
bool  disabled 
)

Set whether a force is disabled.

SimTK_PIMPL_DOWNCAST ( GeneralForceSubsystem  ,
ForceSubsystem   
)
Force& updForce ( ForceIndex  index  ) 

Get a modifiable reference to a Force by index.


The documentation for this class was generated from the following file:

Generated on Wed Dec 30 11:05:14 2009 for SimTKcore by  doxygen 1.6.1