Snoopy Version 6.0 (Albert)
common.c File Reference
#include "snoopy.h"
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "error.h"
#include "gfft.h"
#include "debug.h"
Include dependency graph for common.c:

Functions

void allocate_field (struct Field *fldi)
void deallocate_field (struct Field *fldi)
void init_N2_profile ()
void init_real_mask ()
void init_common (void)
void finish_common (void)
double randm (void)
double randm_normal (void)
void projector (double complex qx[], double complex qy[], double complex qz[])
double energy (const double complex q[])
double get_c_time (void)
void reduce (double *var, const int op)
float big_endian (float in_number)
void c_nan (double xi, const char ErrorRoutine[], const int line, const char Filename[])

Variables

double * kx
double * ky
double * kz
double * kxt
double * k2t
double * ik2t
double kxmax
double kymax
double kzmax
double kmax
double * mask
double * wr1
double * wr2
double * wr3
double * wr4
double * wr5
double * wr6
double * wr7
double * wr8
double * wr9
double * wr10
double * wr11
double * wr12
double * wr13
double * wr14
double * wr15
double complex * w1
double complex * w2
double complex * w3
double complex * w4
double complex * w5
double complex * w6
double complex * w7
double complex * w8
double complex * w9
double complex * w10
double complex * w11
double complex * w12
double complex * w13
double complex * w14
double complex * w15
struct Parameters param
double nu
int rank
int nthreads

Function Documentation

void allocate_field ( struct Field fldi)

Allocate a field structure according to the code current configuration This routine allows one to add extra fields to the code very easily.

Parameters:
*fldi,:pointer to a field structure to initialize

Here is the caller graph for this function:

float big_endian ( float  in_number)

Determines if the machine is little-endian. If so, it will force the data to be big-endian.

Parameters:
in_numberfloating point number to be converted in big endian

Here is the caller graph for this function:

void c_nan ( double  xi,
const char  ErrorRoutine[],
const int  line,
const char  Filename[] 
)

Test a double for Not a Number error

Parameters:
xidouble to be checked

Here is the call graph for this function:

void deallocate_field ( struct Field fldi)

Deallocate a field structure created by allocate_field

Here is the caller graph for this function:

double energy ( const double complex  q[])

Compute the energy of a given field.

Parameters:
qcomplex array containing the field for which we want the total energy

Here is the caller graph for this function:

void finish_common ( void  )

Here is the caller graph for this function:

double get_c_time ( void  )

Return the localtime in seconds. Use different implementation depending on the avaiable libraries

Here is the caller graph for this function:

void init_common ( void  )

Init all global variables, aligning them in memory

Here is the caller graph for this function:

void init_N2_profile ( )
void init_real_mask ( )
void projector ( double complex  qx[],
double complex  qy[],
double complex  qz[] 
)

Remove the divergence from a 3D field using the projector operator: q=q-k.q/k^2

Parameters:
qx,:x component of the field
qy,:y component of the field
qz,:z component of the field

Here is the caller graph for this function:

double randm ( void  )

Customized random number generator Allow one to have consistant random numbers generators on different architectures.

Here is the caller graph for this function:

double randm_normal ( void  )

Normal distribution Algorithm by D.E. Knut, 1997, The Art of Computer Programmin, Addison-Wesley.

Here is the call graph for this function:

void reduce ( double *  var,
const int  op 
)

Reduce a variable over all the avaiable processes Can add a value on all the process, find a maximum or a minimum.

NOTE: This routine makes sense only when MPI_SUPPORT is set. If not, this routine does nothing.

Parameters:
*var,:variable to be reduced
op,:operation needed to be done. Can be set to: 1= Sum over all the processes 2= Find the maximum over all the processes 3= Find the minimum over all the processes

Here is the caller graph for this function:


Variable Documentation

double* ik2t

inverse of k2t Wavevector, function of time when SHEAR is present. set to 0 wheh k2t=0 to avoid singularity

double* k2t

k squared Wavevector, function of time when SHEAR is present.

double kmax

Maximum wavevectors

double* kx

x Wavevector

double kxmax
double* kxt

Time dependant x Wavevector. Different from kx only when SHEAR is present.

double* ky

y Wavevector

double kymax
double* kz

z Wavevector

double kzmax
double* mask

Deasliasing Mask

int nthreads

Number of OpenMP threads

double nu
struct Parameters param
int rank
double complex* w1
double complex* w10
double complex * w11
double complex * w12
double complex* w13
double complex * w14
double complex * w15
double complex * w2
double complex * w3

Temporary complex array (alias of real wr**)

double complex* w4
double complex * w5
double complex * w6

Temporary complex array (alias of real wr**)

double complex* w7
double complex * w8
double complex * w9

Temporary complex array (alias of real wr**)

double* wr1
double* wr10

Temporary real array (alias of complex w**)

double * wr11
double * wr12
double* wr13
double * wr14
double * wr15
double * wr2
double * wr3
double* wr4

Temporary real array (alias of complex w**)

double * wr5
double * wr6
double* wr7

Temporary real array (alias of complex w**)

double * wr8
double * wr9