Gravity Engine 2 3.0
Loading...
Searching...
No Matches
GravityEngine2.ExternalAccel Class Reference

The integrators in the GEPhysicsCore can be configured to include additional forces (beyond gravity) to their force computations. Typical examples include a continuous thrust rocket, atmospheric drag or changes to the gravitation force itself (e.g. 1/R) More...

Classes

struct  EADesc
 Struct to hold arbitrary parameters for an external acceleration computation and body. More...
 
struct  EAStateData
 Data passed to an external accel function call. The state information for each of the two bodies and their effective masses are provided. More...
 

Public Types

enum  AccelType {
  INVERSE_R = 0 , GRAVITY_J2 = 1 , ION_DRIVE = 2 , BOOSTER = 3 ,
  EARTH_ATMOSPHERE = 4 , CUSTOM = 100
}
 
enum  ExtAccelType { SELF , ON_OTHER }
 

Public Member Functions

delegate bool EAInteraction (int index, ref EADesc eaDescs, NativeArray< double3 > eaData)
 Optional delegate to handle interactions between External Forces. Triggered by a returning value from an EAFn call.
 

Static Public Member Functions

static double3[] ExtAccelData (ref GEPhysicsJob gePhysJob, int eaIndex)
 
static void ExtAccelDataAlloc (double3[] data, ref GEPhysicsJob gePhysJob, ref EADesc eaDesc)
 
static void ExtAccelDataFree (ref GEPhysicsJob gePhysicsJob, int eaIndex)
 
static void ExtAccelDataUpdate (ref GEPhysicsJob gePhysJob, int eaIndex, double3[] newData)
 
static int ExtAccelFactory (ref EADesc eaDesc, ref EAStateData eaState, double t, double dt, double3 a_in, NativeArray< double3 > eaData, out double3 a_out, ref GEPhysicsJob gePhysJob)
 
static double LUValue (uint luIndex, NativeArray< double3 > data)
 Extract a value from the data array given a look-up index. a LUIndex is encoded as 2 bits to designate x, y, z entry and then the upper bits to encode the entry number in the eaData array.
 

Static Public Attributes

const int STATUS_NO_FORCE = 1
 

Detailed Description

The integrators in the GEPhysicsCore can be configured to include additional forces (beyond gravity) to their force computations. Typical examples include a continuous thrust rocket, atmospheric drag or changes to the gravitation force itself (e.g. 1/R)

See https://nbodyphysics.com/ge2/html/majorFeatures.html#external-forces-gsexternalacceleration

This class holds the common code to configure the properties of an external acceleration.

Member Enumeration Documentation

◆ ExtAccelType

There are two types of external acceleration: SELF: Force invocation only affects the body the force is registered to. e.g. ion drive, rocket engine ON_OTHER: Force from body only affects other body e.g. model of an atmosphere

Member Function Documentation

◆ EAInteraction()

delegate bool GravityEngine2.ExternalAccel.EAInteraction ( int index,
ref EADesc eaDescs,
NativeArray< double3 > eaData )

Optional delegate to handle interactions between External Forces. Triggered by a returning value from an EAFn call.

One example is staging. Stage 0 can hold a reference to the ExtId of stage 1 and can signal that it has finished and it's time to activate the next stage.

This needs to be down in the core, so that a job-mode full launch sim can run through without needing intervention from GECore/GSController.

Parameters
eaDescs
eaData
Returns

◆ LUValue()

static double GravityEngine2.ExternalAccel.LUValue ( uint luIndex,
NativeArray< double3 > data )
static

Extract a value from the data array given a look-up index. a LUIndex is encoded as 2 bits to designate x, y, z entry and then the upper bits to encode the entry number in the eaData array.

Typical use is e.g. to allow the Earth atmosphere model to retrive the inertial mass of a rocket booster and the booster mass is being decremented timestep by timestep during numerical integration.

Parameters
luIndex
data
Returns

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