Streamer fluid modeling - An overview of ARCoS  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Typedefs | Functions | Variables
cstream.h File Reference

Global header file. More...

#include "tree.h"
#include "assert.h"
#include "stdlib.h"
Include dependency graph for cstream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TRUE   1
 
#define FALSE   0
 
#define debug(level,...)
 
#define NDEBUG   /* To supress the asserts */
 
#define warning(...)
 
#define fatal(...)
 
#define show_double(VAR_)   printf (#VAR_ " = %g\n", VAR_)
 
#define show_int(VAR_)   printf (#VAR_ " = %d\n", VAR_)
 
#define MYMAX(X_, Y_)   ((X_) > (Y_)? (X_): (Y_))
 
#define MYMIN(X_, Y_)   ((X_) < (Y_)? (X_): (Y_))
 
#define MAX_AT_LEVEL(X_, Y_, L_)   MYMAX(X_, (Y_) << (L_))
 
#define MIN_AT_LEVEL(X_, Y_, L_)   MYMIN(X_, (Y_) << (L_))
 
#define MAX_AT_LEVEL_WITH_SHIFT(X_, Y_, L_, S_)   MYMAX(X_, ((Y_) << (L_)) + ((L_) > 0? ((S_) << (L_ - 1)): 0))
 
#define MIN_AT_LEVEL_WITH_SHIFT(X_, Y_, L_, S_)   MYMIN(X_, ((Y_) << (L_)) + ((L_) > 0? ((S_) << (L_ - 1)): 0))
 
#define XCHG(X1_, X2_)
 
#define SQ(X_)   ((X_) * (X_))
 
#define decl_field_comp(_DIR)   double (*ext_e_ ## _DIR) (double r, double z, double theta)
 
#define _CSTREAM_H_
 

Typedefs

typedef char * string
 Information about each program parameter.
 
typedef double * doublep
 
typedef double REAL
 

Functions

 decl_field_comp (r)
 
 decl_field_comp (z)
 
 decl_field_comp (theta)
 
void * xmalloc (size_t size)
 Allocates memory with check and (eventually) error reporting.
 
void * xrealloc (void *ptr, size_t size)
 Reallocates memory.
 
void * xcalloc (size_t count, size_t size)
 Reallocates memory, but now initializes the memory to zero.
 

Variables

double * dr
 
double * dz
 
double dtheta
 
double * w2k
 
double * wk
 
char * invok_name
 
const double twopi
 
const double invfourpi
 
const double invpi32
 

Detailed Description

Global header file.

Definition in file cstream.h.

Macro Definition Documentation

#define TRUE   1

Definition at line 16 of file cstream.h.

#define FALSE   0

Definition at line 20 of file cstream.h.

#define debug (   level,
  ... 
)

Definition at line 38 of file cstream.h.

#define NDEBUG   /* To supress the asserts */

Definition at line 39 of file cstream.h.

#define warning (   ...)
Value:
do{ \
fprintf (stderr, "%s: Warning: ", invok_name); \
fprintf (stderr, ## __VA_ARGS__); \
} while(0)

Definition at line 42 of file cstream.h.

#define fatal (   ...)
Value:
do{ \
fprintf (stderr, "%s: Fatal error: ", invok_name); \
fprintf (stderr, ## __VA_ARGS__); \
exit(-1); \
} while(0)

Definition at line 47 of file cstream.h.

#define show_double (   VAR_)    printf (#VAR_ " = %g\n", VAR_)

Definition at line 54 of file cstream.h.

#define show_int (   VAR_)    printf (#VAR_ " = %d\n", VAR_)

Definition at line 55 of file cstream.h.

#define MYMAX (   X_,
  Y_ 
)    ((X_) > (Y_)? (X_): (Y_))

Definition at line 58 of file cstream.h.

#define MYMIN (   X_,
  Y_ 
)    ((X_) < (Y_)? (X_): (Y_))

Definition at line 59 of file cstream.h.

#define MAX_AT_LEVEL (   X_,
  Y_,
  L_ 
)    MYMAX(X_, (Y_) << (L_))

Definition at line 60 of file cstream.h.

#define MIN_AT_LEVEL (   X_,
  Y_,
  L_ 
)    MYMIN(X_, (Y_) << (L_))

Definition at line 61 of file cstream.h.

#define MAX_AT_LEVEL_WITH_SHIFT (   X_,
  Y_,
  L_,
  S_ 
)    MYMAX(X_, ((Y_) << (L_)) + ((L_) > 0? ((S_) << (L_ - 1)): 0))

Definition at line 62 of file cstream.h.

#define MIN_AT_LEVEL_WITH_SHIFT (   X_,
  Y_,
  L_,
  S_ 
)    MYMIN(X_, ((Y_) << (L_)) + ((L_) > 0? ((S_) << (L_ - 1)): 0))

Definition at line 64 of file cstream.h.

#define XCHG (   X1_,
  X2_ 
)
Value:
do { \
typeof(X1_) TMP_; \
TMP_ = X1_; \
X1_ = X2_; \
X2_ = TMP_; \
} while(0)

Definition at line 67 of file cstream.h.

#define SQ (   X_)    ((X_) * (X_))

Definition at line 75 of file cstream.h.

#define decl_field_comp (   _DIR)    double (*ext_e_ ## _DIR) (double r, double z, double theta)

The three components of the external field: ext_e_r, ext_e_z and ext_e_theta.

Definition at line 120 of file cstream.h.

#define _CSTREAM_H_

Definition at line 144 of file cstream.h.

Typedef Documentation

typedef char* string

Information about each program parameter.

These are the types for the global parameters.

Definition at line 87 of file cstream.h.

typedef double* doublep

Definition at line 88 of file cstream.h.

typedef double REAL

Definition at line 113 of file cstream.h.

Function Documentation

decl_field_comp ( )
decl_field_comp ( )
decl_field_comp ( theta  )
void* xmalloc ( size_t  size)

Allocates memory with check and (eventually) error reporting.

Definition at line 12 of file misc.c.

Here is the caller graph for this function:

void* xrealloc ( void *  ptr,
size_t  size 
)

Reallocates memory.

Definition at line 24 of file misc.c.

void* xcalloc ( size_t  count,
size_t  size 
)

Reallocates memory, but now initializes the memory to zero.

Definition at line 37 of file misc.c.

Here is the caller graph for this function:

Variable Documentation

double* dr

Definition at line 24 of file cstream.c.

double * dz

Definition at line 24 of file cstream.c.

double dtheta

The grid sizes

dr[i] and dz[i] represent the grid size at level i. Note that i can go from -extra_pois_levels...max_levels.

Definition at line 24 of file cstream.c.

double* w2k

Definition at line 29 of file cstream.c.

double * wk

See cstream.c

w2k[k] = 2 / dtheta^2 (1 - cos(k dtheta)). This numbers appear due to the finite-differences derivatives of a Fourier transform. If we would make a continuous fourier transform, they will approach k^2.

Definition at line 29 of file cstream.c.

char* invok_name

Name of this program.

Definition at line 36 of file cstream.c.

const double twopi

$ 2 \times \pi $.

Definition at line 39 of file cstream.c.

const double invfourpi

$ 1 / (4 \pi )$

Definition at line 42 of file cstream.c.

const double invpi32

$ 1 / (\pi ^ {3/2} )$

Definition at line 45 of file cstream.c.