PLUTO  4.4-patch2
Functions
math_misc.c File Reference

Miscellaneous math functions. More...

#include "pluto.h"

Functions

double BesselJ0 (double x)
 
double BesselJ1 (double x)
 
double BesselI0 (double x)
 
double BesselI1 (double x)
 
double BesselK0 (double x)
 
double BesselK1 (double x)
 
double BesselKn (int n, double x)
 
void QuickSort (int *x, int first, int last)
 
void SortArray (double *z, int n)
 
void VectorCartesianComponents (double *v, double x1, double x2, double x3)
 

Detailed Description

Author
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it) B. Vaidya
Date
June 27, 2019

Function Documentation

◆ BesselI0()

double BesselI0 ( double  x)

Returns the modified Bessel function I0(x) for any real x. (Adapted from Numerical Recipes)

◆ BesselI1()

double BesselI1 ( double  x)

Returns the modified Bessel function I1(x) for any real x. (Adapted from Numerical Recipes)

◆ BesselJ0()

double BesselJ0 ( double  x)

Returns the Bessel function J0(x) for any real x. (Adapted from Numerical Recipes)

◆ BesselJ1()

double BesselJ1 ( double  x)

Returns the Bessel function J1(x) for any real x. (Adapted from Numerical Recipes)

◆ BesselK0()

double BesselK0 ( double  x)

Returns the modified Bessel function K0(x) for any real x. (Adapted from Numerical Recipes)

◆ BesselK1()

double BesselK1 ( double  x)

Returns the modified Bessel function K1(x) for any real x. (Adapted from Numerical Recipes)

◆ BesselKn()

double BesselKn ( int  n,
double  x 
)

Returns the modified Bessel function Kn(x) for positive x and n >= 2. (Adapted from Numerical Recipes)

◆ QuickSort()

void QuickSort ( int *  x,
int  first,
int  last 
)

Sort an integer array x in ascending order. Taken from http://www.cquestions.com/2008/01/c-program-for-quick-sort.html

Parameters
[in,out]*xthe array to be sorted.
[in]firstthe starting element of the array
[in]lastthe final element of the array

◆ SortArray()

void SortArray ( double *  z,
int  n 
)

Sort array elements using straight insertion.

Parameters
[in,out]zpointer to 1D array in double precision
[in]nthe number of elements (starting at 0)

Reference: -"Numerical Recipes in C", sect. 8.1

◆ VectorCartesianComponents()

void VectorCartesianComponents ( double *  v,
double  x1,
double  x2,
double  x3 
)

Transform the vector $ v = (v_{x1}, v_{x2}, v_{x3})$ from the chosen coordinate system (= GEOMETRY) to Cartesian components.

Parameters
[in,out]*vthe original vector. On output v is replaced by the three Cartesian components.
[in]x1,x2,x3the grid coordinates