PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
Functions
tools.c File Reference

Collection of general-purpose functions. More...

#include "pluto.h"

Functions

int LUDecomp (double **a, int n, int *indx, double *d)
 
void LUBackSubst (double **a, int n, int *indx, double b[])
 
void Trace (double xx)
 
void Show (double **a, int ip)
 
int CheckNaN (double **u, int is, int ie, int id)
 
void Where (int i, Grid *grid)
 
void PlutoError (int condition, char *str)
 
void print (const char *fmt,...)
 
void print1 (const char *fmt,...)
 
void MakeState (State_1D *state)
 
int IsLittleEndian (void)
 
void SwapEndian (void *x, const int nbytes)
 
void ShowMatrix (double **A, double eps)
 

Detailed Description

This file contains some general Detailed description of the file goes here.

Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Sep 20, 2012

Function Documentation

int CheckNaN ( double **  u,
int  is,
int  ie,
int  id 
)

Cheeck whether the array u contains Not-a-Number (NaN)

int IsLittleEndian ( void  )

Return 1 if the current architecture has little endian order

void LUBackSubst ( double **  a,
int  n,
int *  indx,
double  b[] 
)

Solve a linear system after LUDecomp has been called. Adapted from Numerical Recipe.

int LUDecomp ( double **  a,
int  n,
int *  indx,
double *  d 
)

Perform LU decomposition. Adapted from Numerical Recipe

void MakeState ( State_1D state)

Allocate memory areas for arrays inside the state structure.

void PlutoError ( int  condition,
char *  str 
)

If condition is true, issue an error and quit the code.

void print ( const char *  fmt,
  ... 
)

Define print function for the static grid version of PLUTO. The Chombo version is defined in Chombo/amrPLUTO.cpp

void print1 ( const char *  fmt,
  ... 
)

Define print1 function

void Show ( double **  a,
int  ip 
)

Print the component of the array a at grid index ip

void ShowMatrix ( double **  A,
double  eps 
)

Make a nice printing of a 2D matrix A Entries with values below eps will display "0.0"

void SwapEndian ( void *  x,
const int  nbytes 
)

Swap the byte order of x.

Parameters
[in]xpointer to the variable being swapped
[in]nbytesdata type size
Returns
This function has no return value.
void Trace ( double  xx)

Print a number xx and the number of times it has been called.

void Where ( int  i,
Grid grid 
)

Print the location of a particular zone (i,j,k) in the computational domain.

Note
This function must be initialized before using it to store grid information. This is done by calling Where(i, grid) the very first time. Subsequent calls can be then done by simply using Where(i,NULL).