proto.hΒΆ

Functions

void init(void)

Main initialisation function.

void strip_string_quotes(std::string & s)

Simple function which searches a string for surrounding quote characters and removes them.

Parameters
  • s -

    address of string to operate on

void strip_string_quotes(char * s)
void InitialiseArguments(void)

Function in which all code input parameters are specified as members of an ArgumentList.

See
GeneralInputArgument, ArgumentList

void ParameterFileRead(const char * fName)

Function which searches a parameter file for all parameters expected from the ArgumentList and reads their values.

See
ArgumentList
Parameters
  • parameter_file_location -

    path to target parameter file

void G2_read(const char * fName, int * npart, int mode)
void translate_sys(double X, double Y, double Z)
void rotate_sys(double Theta, double Phi, double x_r, double y_r, double z_r)
void kernel_init(int form)

Control function which initialises the chosen SPH smoothing kernel and sets function pointers.

Parameters
  • form -

    an integer representing the desired smoothing kernel

double kernel_h3(double & h)

Inline function returning h^2 or h^3 depending on whether 2D or 3D.

double kernel_norm(double & h3)

Inline function returning the 2D or 3D kernel normalisation.

double CS_kernel_eval(double r, double h)

Function returning the value of the cubic spline kernel at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double CS_dw_kernel_eval(double r, double h)

Function returning the value of the cubic spline kernel gradient at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double WC2_kernel_eval(double r, double h)

Function returning the value of the second order Wendland kernel at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double WC2_dw_kernel_eval(double r, double h)

Function returning the value of the second order Wendland kernel gradient at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double WC4_kernel_eval(double r, double h)

Function returning the value of the fourth order Wendland kernel at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double WC4_dw_kernel_eval(double r, double h)

Function returning the value of the fourth order Wendland kernel gradient at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double WC6_kernel_eval(double r, double h)

Function returning the value of the sixth order Wendland kernel at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double WC6_dw_kernel_eval(double r, double h)

Function returning the value of the sixth order Wendland kernel gradient at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double HOCT_kernel_eval_3D(double r, double h)

Function returning the value of the 3D higher order OCT kernel at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double HOCT_dw_kernel_eval_3D(double r, double h)

Function returning the value of the 3D higher order OCT kernel gradient at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double HOCT_kernel_eval_2D(double r, double h)

Function returning the value of the 2D higher order OCT kernel at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

double HOCT_dw_kernel_eval_2D(double r, double h)

Function returning the value of the 2D higher order OCT kernel gradient at a given position.

Return
kernel value
Parameters
  • r -

    the radius at which to evaluate the kernel

  • h -

    the kernel smoothing length

void HOCT_kernel_init_3D(void)

Function to numerically evaluate and initialise the normalisations of the 3D higher order OCT kernel.

void HOCT_kernel_init_2D(void)

Function to numerically evaluate and initialise the normalisations of the 2D higher order OCT kernel.

double trapIntegral(int indexA, int indexB, double * Xs, double * FXs)

Utility function which numerically evaluates the trapezoidal rule integration on an array.

Return
the outcome of the integral calculation
Parameters
  • indexA -

    index of the left-hand array entry for the integration

  • indexB -

    index of the right-hand array entry for the integration

  • Xs -

    array of x values where the evaluated function is f(x)

  • FXs -

    array of function values where the evaluated function is f(x)

double linterp(double x, double lowx, double upx, double lowfx, double upfx)

Utility function which numerically evaluates the linear interpolation between supplied values.

Return
the outcome of the interpolation calculation
Parameters
  • x -

    position at which the function is approximated, where function is f(x)

  • lowx -

    lower coordinate value

  • upx -

    upper coordinate value

  • lowfx -

    lower function value, f(lowx)

  • upfx -

    upper function value, f(upx)

double dX(double X0, double X1)

Function returns difference in positions in arbitrary dimension, non-periodic.

Return
distance between coordinates
Parameters
  • X0 -

    position for differencing

  • X1 -

    position for differencing

int dbin(int dbin, int NDim)
void grid_construct(void)

Function which constructs the grid onto which particle properties are smoothed.

void bin_parts(void)

Function calculates which bin/cell particles lie in by assuming cells are evenly spaced.

void prop_assignment(void)
void data_write(const char * fname)
void cleanup(void)

Variables

double(* kernel_eval)(double r, double h)

function pointer to SPH kernel in use

double(* dw_kernel_eval)(double r, double h)

function pointer to SPH gradient kernel in use