galhabit

Contents

galhabit.c

Subroutines that simulate the galactic habitat of a stellar system.

Author

Russell Deitrick (deitrr)

Date

July 7 2015

Functions

void BodyCopyGalHabit(BODY *dest, BODY *src, int iTideModel, int iNumBodies, int iBody)
void ReadGalacDensity(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadRForm(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadStarScaleL(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTMigration(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadRadialMigr(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadGasDensity(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadDMDensity(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadRandSeed(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadEncounterRad(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadStellarEnc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadOutputEnc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTimeEvolVelDisp(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHostBinary(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadGalacTides(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHostBinSemi(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadMinStellarApproach(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHostBinEcc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHostBinArgP(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHostBinLongA(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHostBinInc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHostBinMass1(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void InitializeOptionsGalHabit(OPTIONS *options, fnReadOption fnRead[])
void ReadOptionsGalHabit(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, fnReadOption fnRead[], int iBody)
void InitializeEccXGalHabit(BODY *body, UPDATE *update, int iBody, int iEqn)
void InitializeEccYGalHabit(BODY *body, UPDATE *update, int iBody, int iEqn)
void InitializeEccZGalHabit(BODY *body, UPDATE *update, int iBody, int iEqn)
void InitializeAngMXGalHabit(BODY *body, UPDATE *update, int iBody, int iEqn)
void InitializeAngMYGalHabit(BODY *body, UPDATE *update, int iBody, int iEqn)
void InitializeAngMZGalHabit(BODY *body, UPDATE *update, int iBody)
void VerifyTidesBinary(BODY *body, CONTROL *control, OPTIONS *options, char cFile[], int iBody, int iVerbose)
void AssignGalHabitDerivatives(BODY *body, EVOLVE *evolve, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
void NullGalHabitDerivatives(BODY *body, EVOLVE *evolve, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
void VerifyGalHabit(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, OUTPUT *output, SYSTEM *system, UPDATE *update, int iBody, int iModule)
void InitializeUpdateGalHabit(BODY *body, UPDATE *update, int iBody)
void FinalizeUpdateEccXGalHabit(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateEccYGalHabit(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateEccZGalHabit(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateAngMXGalHabit(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateAngMYGalHabit(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateAngMZGalHabit(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
int HaltDisrupt(BODY *body, EVOLVE *evolve, HALT *halt, IO *io, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
int HaltBadImpulse(BODY *body, EVOLVE *evolve, HALT *halt, IO *io, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
void CountHaltsGalHabit(HALT *halt, int *iNumHalts)
void VerifyHaltGalHabit(BODY *body, CONTROL *control, OPTIONS *options, int iBody, int *iHalt)
void WriteBodyPeriQ(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteBodyEccX(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteBodyEccY(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteBodyEccZ(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteBodyAngMX(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteBodyAngMY(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteBodyAngMZ(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteNEncounters(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteNBadImpulse(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteFVelDisp(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDEccDtGalHTidal(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDIncDtGalHTidal(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDLongADtGalHTidal(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDArgPDtGalHTidal(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void InitializeOutputGalHabit(OUTPUT *output, fnWriteOutput fnWrite[])
void LogOptionsGalHabit(CONTROL *control, FILE *fp)
void LogGalHabit(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UPDATE *update, fnWriteOutput fnWrite[], FILE *fp)
void LogBodyGalHabit(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UPDATE *update, fnWriteOutput fnWrite[], FILE *fp, int iBody)
void AddModuleGalHabit(CONTROL *control, MODULE *module, int iBody, int iModule)
void PropsAuxGalHabit(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update, int iBody)
void ForceBehaviorGalHabit(BODY *body, MODULE *module, EVOLVE *evolve, IO *io, SYSTEM *system, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody, int iModule)
void Rot2Bin(BODY *body, int iBody)
void CalcEccVec(BODY *body, int iBody)
void CalcAngMVec(BODY *body, int iBody)
int fniCheck_disrupt(BODY *body, SYSTEM *system, int iBody)
double fndRandom_double()
int fniRandom_int(int n)
int fniCheck_dr(BODY *body, EVOLVE *evolve, SYSTEM *system, int iBody)
void GetStarVelocity(SYSTEM *system)
double fndNsMinus6to15(double dMagV)
double fndMag2mass(double dMagV)
void CalcEncounterRate(SYSTEM *system)
void GetStarMass(SYSTEM *system)
void CalcMeanVelDispSolar(SYSTEM *system)
void VelocityDisp(SYSTEM *system)
void VelocityApex(SYSTEM *system)
void GetRelativeVelocity(SYSTEM *system)
double fndNearbyStarDist(double dMagV)
double fndNearbyStarFrEnc(SYSTEM *system, double dMagV)
void GetStarPosition(SYSTEM *system)
void CalcImpactParam(BODY *body, SYSTEM *system, int iBody)
void ApplyDeltaV(BODY *body, SYSTEM *system, int iBody)
void AdvanceMA(BODY *body, SYSTEM *system, int iBody)
void NextEncounterTime(SYSTEM *system, EVOLVE *evolve, double dTime)
void testrand(SYSTEM *system)
double fndDarkMatterDensity(SYSTEM *system, double dRad)
double fndISMDensity(SYSTEM *system, double dRad)
double fndDexDJ(BODY *body, int iBody)
double fndDexDla(double dEccY)
double fndDexDap(BODY *body, int iBody)
double fndDeyDJ(BODY *body, int iBody)
double fndDeyDla(double dEccX)
double fndDeyDap(BODY *body, int iBody)
double fndDezDJ(BODY *body, int iBody)
double fndDezDap(double dArgP, double dEcc, double dInc)
double fndGalHabitDJDt(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDArgPDt(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDLongADt(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDEccXDtTidal(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDEccYDtTidal(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDEccZDtTidal(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDAngMXDtTidal(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDAngMYDtTidal(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDAngMZDtTidal(BODY *body, SYSTEM *system, int *iaBody)
double fndQuadC2(BODY *body, int *iaBody)
double fndDQuadDEccXInner(BODY *body, int *iaBody)
double fndDQuadDEccYInner(BODY *body, int *iaBody)
double fndDQuadDEccZInner(BODY *body, int *iaBody)
double fndDQuadDAngMXInner(BODY *body, int *iaBody)
double fndDQuadDAngMYInner(BODY *body, int *iaBody)
double fndDQuadDAngMZInner(BODY *body, int *iaBody)
double fndDQuadDAngMXOuter(BODY *body, int *iaBody)
double fndDQuadDAngMYOuter(BODY *body, int *iaBody)
double fndDQuadDAngMZOuter(BODY *body, int *iaBody)
double fndGalHabitDAngMXDtBV(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDAngMYDtBV(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDAngMZDtBV(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDEccXDtBV(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDEccYDtBV(BODY *body, SYSTEM *system, int *iaBody)
double fndGalHabitDEccZDtBV(BODY *body, SYSTEM *system, int *iaBody)
double fndOctC3(BODY *body, int *iaBody)
double fndDOctDEccXInner(BODY *body, int *iaBody)
double fndDOctDEccYInner(BODY *body, int *iaBody)
double fndDOctDEccZInner(BODY *body, int *iaBody)
double fndDOctDAngMXInner(BODY *body, int *iaBody)
double fndDOctDAngMYInner(BODY *body, int *iaBody)
double fndDOctDAngMZInner(BODY *body, int *iaBody)
double fndDOctDEccXOuter(BODY *body, int *iaBody)
double fndDOctDEccYOuter(BODY *body, int *iaBody)
double fndDOctDEccZOuter(BODY *body, int *iaBody)
double fndDOctDAngMXOuter(BODY *body, int *iaBody)
double fndDOctDAngMYOuter(BODY *body, int *iaBody)
double fndDOctDAngMZOuter(BODY *body, int *iaBody)

galhabit.h

Subroutines that simulate the galactic habitat of a stellar system.

Author

Russell Deitrick (deitrr)

Date

July 7 2015

Defines

OPTSTARTGALHABIT
OPTENDGALHABIT
OPT_GALACDENSITY
OPT_RANDSEED
OPT_ENCOUNTERRAD
OPT_RFORM
OPT_TMIGRATION
OPT_RADIALMIGR
OPT_GASDENSITY
OPT_DMDENSITY
OPT_STARSCALEL
OPT_STELLARENC
OPT_TIMEEVOLVELDISP
OPT_OUTPUTENC
OPT_PERIQ
OPT_HOSTBINARY
OPT_HOSTBINSEMI
OPT_HOSTBINECC
OPT_HOSTBININC
OPT_HOSTBINARGP
OPT_HOSTBINLONGA
OPT_HOSTBINMASS1
OPT_MINSTELLARAPPROACH
OPT_GALACTIDES
OUTSTARTGALHABIT
OUTENDGALHABIT
OUTBODYSTARTGALHABIT
OUT_PERIQ
OUT_NENCOUNTERS
OUT_FVELDISP
OUT_ECCX
OUT_ECCY
OUT_ECCZ
OUT_ANGMX
OUT_ANGMY
OUT_ANGMZ
OUT_NBADIMPULSE
OUT_DECCDTGALHTIDAL
OUT_DINCDTGALHTIDAL
OUT_DLONGADTGALHTIDAL
OUT_DARGPDTGALHTIDAL