Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

O_SESSAME::Environment Class Reference
[Environment Toolkit]

#include <Environment.h>

Collaboration diagram for O_SESSAME::Environment:

Collaboration graph
[legend]
List of all members.

Detailed Description

Encapsulation of a spacecraft environment (disturbance forces, torques, central body, etc.).

The Environment class is used to contain all the different aspects of the external environment of the spacecraft. This currently includes disturbance forces (gravity, drag, solar radiation pressure), disturbance torques (gravity gradient, magnetic dipole, fuel slosh), and central body (for constants).

To use the Environment class, the user should create (or include) and assign the desired force and torque disturbance functions (EnvFunction), and CentralBody. The integrator or propagator would then use the GetTorque() and GetForce() functions to modify the dynamics.

Example:
 Environment* pEarthEnv = new Environment;
 EarthCentralBody *pCBEarth = new EarthCentralBody;
 pEarthEnv->SetCentralBody(pCBEarth);
    
 // Add Gravity force function
 EnvFunction TwoBodyGravity(&GravityForceFunction);
 double Mass = 100; \\kg
 TwoBodyGravity.AddParameter(reinterpret_cast<void*>(&Mass), 1);
 pEarthEnv->AddForceFunction(TwoBodyGravity);
    
 // Add Drag Force Function
 EnvFunction DragForce(&DragForceFunction);
 double BallisticCoefficient = 200;
 DragForce.AddParameter(reinterpret_cast<void*>(&BallisticCoefficient), 1);
 pEarthEnv->AddForceFunction(DragForce);
        
 // Add Magnetic Dipole
 EnvFunction MagDipole(&MagneticDipoleFunction);
 MagDiple.AddParameter(reinterpret_cast<void*>(&Spacecraft.GetDipole(), 1);
 pEarthEnv->AddTorqueFunction(MagDipole);

Definition at line 179 of file Environment.h.

Public Member Functions

 Environment ()
 Create an instance of Environment.
virtual ~Environment ()
 Default Deconstructor.
Vector GetTorques (const ssfTime &_currentTime, const OrbitState &_currentOrbitState, const AttitudeState &_currentAttitudeState)
 Evaluate the current disturbance torques given a state.
Vector GetForces (const ssfTime &_currentTime, const OrbitState &_currentOrbitState, const AttitudeState &_currentAttitudeState)
 Evaluate the current disturbance forces given a state.
void AddForceFunction (const EnvFunction &_forceFunc)
 Add a force disturbance function to the list of force functions.
void AddTorqueFunction (const EnvFunction &_torqueFunc)
 Add a torque disturbance function to the list of force functions.
const FunctorGetForceFunction () const
 Get the reference to the Environment::GetForces() function.
const FunctorGetTorqueFunction () const
 Get the reference to the Environment::GetTorques() function.
void SetCentralBody (CentralBody *_pCB)
 Set the pointer to the central body to use for modeling the environment.
const CentralBodyGetCentralBody () const
 Get the pointer to the environment's central body.

Private Attributes

vector< EnvFunctionm_ForceFunctions
 internal vector of the pointers to the force disturbance functions
vector< EnvFunctionm_TorqueFunctions
 internal vector of the pointers to the torque disturbance functions
vector< EnvFunction >::iterator m_funcIterator
 internal iterator for stepping through the disturbance function vectors
CentralBodym_pCB
 internal pointer to the environment central body
Vector m_CalculatedForces
 internal Vector of the most recent calculated disturbance forces
Vector m_CalculatedTorques
 internal Vector of the most recent calculated disturbance torques
ObjectFunctor< Environmentm_ForcesFunctor
 internal pointer to the Environment::GetForces() function
ObjectFunctor< Environmentm_TorquesFunctor
 internal pointer to the Environment::GetTorques() function


Constructor & Destructor Documentation

O_SESSAME::Environment::Environment  ) 
 

Create an instance of Environment.

Definition at line 18 of file Environment.cpp.

References m_pCB.

O_SESSAME::Environment::~Environment  )  [virtual]
 

Default Deconstructor.

Definition at line 27 of file Environment.cpp.

References m_pCB, and O_SESSAME::CentralBody::ReleaseReference().


Member Function Documentation

void O_SESSAME::Environment::AddForceFunction const EnvFunction _forceFunc  ) 
 

Add a force disturbance function to the list of force functions.

Parameters:
_forceFunc Pointer to a force function that matches the EnvFunction prototype.

Todo:
Check to prevent overlapping force functions

Definition at line 89 of file Environment.cpp.

References m_ForceFunctions.

Referenced by ChangeEnvironment(), main(), and SetupEnvironment().

void O_SESSAME::Environment::AddTorqueFunction const EnvFunction _torqueFunc  ) 
 

Add a torque disturbance function to the list of force functions.

Parameters:
_forceFunc Pointer to a torque function that matches the EnvFunction prototype.

Todo:
Check to prevent overlapping torque functions

Definition at line 105 of file Environment.cpp.

References m_TorqueFunctions.

Referenced by ChangeEnvironment(), and SetupEnvironment().

const CentralBody * O_SESSAME::Environment::GetCentralBody  )  const
 

Get the pointer to the environment's central body.

Returns:
pointer to the CentralBody object.

Definition at line 81 of file Environment.cpp.

const Functor & O_SESSAME::Environment::GetForceFunction  )  const
 

Get the reference to the Environment::GetForces() function.

Returns:
reference to the environment's GetForces() function.

Definition at line 122 of file Environment.cpp.

Vector O_SESSAME::Environment::GetForces const ssfTime _currentTime,
const OrbitState _currentOrbitState,
const AttitudeState _currentAttitudeState
 

Evaluate the current disturbance forces given a state.

Parameters:
_currentTime current time to evaluate at.
_currentOrbitState current orbital state.
_currentAttitudeState current attitude state.
Returns:
3-element vector of disturbance forces in the body frame (N).

Definition at line 57 of file Environment.cpp.

References m_CalculatedForces, m_ForceFunctions, m_funcIterator, CAMvectorBase::setToValue(), and O_SESSAME::Vector.

const Functor & O_SESSAME::Environment::GetTorqueFunction  )  const
 

Get the reference to the Environment::GetTorques() function.

Returns:
reference to environment's GetTorques() function.

Definition at line 130 of file Environment.cpp.

Vector O_SESSAME::Environment::GetTorques const ssfTime _currentTime,
const OrbitState _currentOrbitState,
const AttitudeState _currentAttitudeState
 

Evaluate the current disturbance torques given a state.

Parameters:
_currentTime current time to evaluate at.
_currentOrbitState current orbital state.
_currentAttitudeState current attitude state.
Returns:
3-element vector of disturbance torques in the body frame (N).

Definition at line 39 of file Environment.cpp.

References m_CalculatedTorques, m_funcIterator, m_TorqueFunctions, CAMvectorBase::setToValue(), and O_SESSAME::Vector.

void O_SESSAME::Environment::SetCentralBody CentralBody _pCB  ) 
 

Set the pointer to the central body to use for modeling the environment.

Parameters:
_pCB pointer to the CentralBody object.

Definition at line 72 of file Environment.cpp.

References m_pCB.

Referenced by main(), and SetupEnvironment().


Member Data Documentation

Vector O_SESSAME::Environment::m_CalculatedForces [private]
 

internal Vector of the most recent calculated disturbance forces

Definition at line 213 of file Environment.h.

Referenced by GetForces().

Vector O_SESSAME::Environment::m_CalculatedTorques [private]
 

internal Vector of the most recent calculated disturbance torques

Definition at line 215 of file Environment.h.

Referenced by GetTorques().

vector<EnvFunction> O_SESSAME::Environment::m_ForceFunctions [private]
 

internal vector of the pointers to the force disturbance functions

Definition at line 204 of file Environment.h.

Referenced by AddForceFunction(), and GetForces().

ObjectFunctor<Environment> O_SESSAME::Environment::m_ForcesFunctor [private]
 

internal pointer to the Environment::GetForces() function

Definition at line 217 of file Environment.h.

vector<EnvFunction>::iterator O_SESSAME::Environment::m_funcIterator [private]
 

internal iterator for stepping through the disturbance function vectors

Definition at line 208 of file Environment.h.

Referenced by GetForces(), and GetTorques().

CentralBody* O_SESSAME::Environment::m_pCB [private]
 

internal pointer to the environment central body

Definition at line 210 of file Environment.h.

Referenced by Environment(), SetCentralBody(), and ~Environment().

vector<EnvFunction> O_SESSAME::Environment::m_TorqueFunctions [private]
 

internal vector of the pointers to the torque disturbance functions

Definition at line 206 of file Environment.h.

Referenced by AddTorqueFunction(), and GetTorques().

ObjectFunctor<Environment> O_SESSAME::Environment::m_TorquesFunctor [private]
 

internal pointer to the Environment::GetTorques() function

Definition at line 219 of file Environment.h.


The documentation for this class was generated from the following files:
Generated on Wed Sep 5 12:54:48 2007 for DSACSS Operational Code by  doxygen 1.3.9.1