Skip to content

Commit

Permalink
removed old TES structs
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed Sep 15, 2023
1 parent cbbdd77 commit 9deab39
Showing 1 changed file with 65 additions and 206 deletions.
271 changes: 65 additions & 206 deletions src/rebound.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ int gettimeofday(struct timeval * tp, struct timezone * tzp);
int asprintf(char **strp, const char *fmt, ...);
int rand_r (unsigned int *seed);
FILE *fmemopen( void *buf, size_t len, const char *type);

#include <io.h>
#else // _WIN32
#include <sys/time.h>
Expand Down Expand Up @@ -328,146 +327,6 @@ struct reb_simulation_integrator_bs {
int user_ode_needs_nbody; // Do not set manually. Use needs_nbody in reb_ode instead.
};

typedef struct _StumpfCoefficients
{
double * __restrict__ c0;
double * __restrict__ c1;
double * __restrict__ c2;
double * __restrict__ c3;
}StumpfCoefficients;

typedef struct UNIVERSAL_VARS
{
double * __restrict__ t0;
double * __restrict__ tLast;
double * uv_csq;
double * uv_csp;
double * uv_csv;
double * dt;
double * __restrict__ Q0;
double * __restrict__ V0;
double * __restrict__ P0;
double * __restrict__ Q1;
double * __restrict__ V1;
double * __restrict__ P1;
double * __restrict__ X;
double * __restrict__ Q0_norm;
double * __restrict__ beta;
double * __restrict__ eta;
double * __restrict__ zeta;
double * __restrict__ period;
double * __restrict__ Xperiod;
uint32_t stateVectorSize;
uint32_t controlVectorSize;

StumpfCoefficients C;

double mu; /// G*mCentral

// Variables for storing classical orbital elements.
double * e;
double * a;
double * h;
double * h_norm;
double * peri;
double * apo;
}UNIVERSAL_VARS;

typedef struct _controlVars {
double* __restrict__ p0;
double* __restrict__ p1;
double* __restrict__ p2;
double* __restrict__ p3;
double* __restrict__ p4;
double* __restrict__ p5;
double* __restrict__ p6;
uint32_t size;
}controlVars;

typedef struct RADAU
{
// State vectors
double * dX;
double * dQ;
double * dP;
// Buffers for rectifying into before performing a synchronisation.
double * Xout;
double * Qout;
double * Pout;
uint32_t * rectifiedArray;
// Buffer for predictors
double * predictors;
// Derivatives at start of the step.
double * __restrict__ dState0;
double * __restrict__ ddState0;
// Intermediate derivatives.
double * __restrict__ dState;
double * __restrict__ ddState;
// Compensated summation arrays for gravity
double * __restrict__ cs_dState0;
double * __restrict__ cs_ddState0;
double * __restrict__ cs_dState;
double * __restrict__ cs_ddState;
// Compensated summation arrays for B's.
controlVars cs_B;
controlVars cs_B1st;
// Compensated summation array for the predictor and corrector.
double * cs_dX;
double * cs_dq;
double * cs_dp;
// Integrator coefficients.
controlVars G;
controlVars B;
controlVars Blast;
controlVars Blast_1st;
controlVars G_1st;
controlVars B_1st;
// Variables for performance metrics
uint64_t fCalls;
uint64_t rectifications;
uint32_t convergenceIterations;
// Iteration convergence variables.
double * b6_store;
double * acc_ptr;
}RADAU;

typedef struct DHEM
{
// Pointers to osculating orbits at a single point in time.
double * Xosc;
double * Qosc;
double * Posc;
// Osculating orbits for all stages within a step.
double * XoscStore;
double ** XoscArr;
double * XoscPredStore;
double ** XoscPredArr;
// CS variables for the osculating orbits.
double * Xosc_cs;
double * XoscStore_cs;
double ** XoscArr_cs;
double * Qosc_cs;
double * Posc_cs;
// Pointers to osculating orbit derivatives at a single point in time.
double * Xosc_dot;
double * Qosc_dot;
double * Posc_dot;
// Osculating orbits derivatives for all stages within a step.
double * Xosc_dotStore;
double ** Xosc_dotArr;
// Variables for summing Xosc+dX into.
double * X;
double * Q;
double * P;
// Mass variables.
double * __restrict__ m;
double * __restrict__ m_inv;
double mTotal;
// Rectification variables.
double * rectifyTimeArray; /// The time at which we need to rectify each body.
double * rectificationPeriod; /// Elapsed time to trigger a rectification.
}DHEM;

enum REB_EOS_TYPE {
REB_EOS_LF = 0x00,
REB_EOS_LF4 = 0x01,
Expand Down Expand Up @@ -977,71 +836,71 @@ void reb_var_rescale(struct reb_simulation* const r);
// The following variables are supported: a, e, inc, f, omega, Omega, h, k, ix, iy and m (mass).
// The functions return the derivative as a particle structre. Each structure element is a derivative.
// The paramter po is the original particle for which the derivative is to be calculated.
struct reb_particle reb_derivatives_lambda(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_h(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_k(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_k_k(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_h_h(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_lambda_lambda(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_k_lambda(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_h_lambda(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_k_h(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_a(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_ix(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_ix_ix(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_iy(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_iy_iy(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_k_ix(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_h_ix(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_lambda_ix(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_lambda_iy(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_h_iy(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_k_iy(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_ix_iy(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_ix(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_iy(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_lambda(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_h(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_k(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_a(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_lambda(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_h(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_k(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_ix(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_iy(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_m(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_e(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_e_e(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_inc(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_inc_inc(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_Omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_Omega_Omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_omega_omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_f(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_f_f(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_e(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_inc(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_Omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_a_f(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_e_inc(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_e_Omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_e_omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_e_f(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_e(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_inc_Omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_inc_omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_inc_f(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_inc(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_omega_Omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_Omega_f(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_Omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_omega_f(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_omega(double G, struct reb_particle primary, struct reb_particle po);
struct reb_particle reb_derivatives_m_f(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_lambda(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_h(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_k(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_k_k(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_h_h(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_lambda_lambda(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_k_lambda(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_h_lambda(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_k_h(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_a(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_ix(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_ix_ix(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_iy(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_iy_iy(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_k_ix(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_h_ix(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_lambda_ix(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_lambda_iy(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_h_iy(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_k_iy(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_ix_iy(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_ix(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_iy(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_lambda(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_h(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_k(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_a(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_lambda(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_h(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_k(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_ix(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_iy(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_m(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_e(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_e_e(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_inc(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_inc_inc(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_Omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_Omega_Omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_omega_omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_f(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_f_f(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_e(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_inc(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_Omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_a_f(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_e_inc(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_e_Omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_e_omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_e_f(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_e(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_inc_Omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_inc_omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_inc_f(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_inc(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_omega_Omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_Omega_f(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_Omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_omega_f(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_omega(double G, struct reb_particle primary, struct reb_particle po);
DLLEXPORT struct reb_particle reb_derivatives_m_f(double G, struct reb_particle primary, struct reb_particle po);

// Functions to operate on particles
DLLEXPORT void reb_particle_isub(struct reb_particle* p1, struct reb_particle* p2);
Expand Down

0 comments on commit 9deab39

Please sign in to comment.