Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
simple.h File Reference

Go to the source code of this file.

Data Structures

struct  _Memindex
 

Macros

#define Memindex   struct _Memindex *
 
#define mem_data(m, i, j)   ((m)->b[i][j])
 

Functions

static const bool mem_allocated (const struct _Memindex *m, const int i, const int j)
 The mem_data() macros return the data stored at a specific (multidimensional) index.
 
struct _Memindexmem_new (int len)
 The mem_new() function returns a new (empty) Memindex.
 
void mem_destroy (struct _Memindex *m, int len)
 The mem_destroy() function frees all the memory allocated by a given Memindex.
 
void mem_assign (struct _Memindex *m, int i, int len, void *b)
 The mem_assign() function assigns a (pointer) value to a given index.
 
void mem_free (struct _Memindex *m, int i, int j, int len, void *b)
 The mem_free() function frees a given index.
 
macro foreach_mem (struct _Memindex *index, int len, int _i)
 The foreach_mem() macro traverses every _i allocated elements of array _m taking into account a periodicity of _len (and ghost cells).
 

Macro Definition Documentation

◆ mem_data

#define mem_data (   m,
  i,
  j 
)    ((m)->b[i][j])

Definition at line 45 of file simple.h.

◆ Memindex

#define Memindex   struct _Memindex *

Definition at line 26 of file simple.h.

Function Documentation

◆ foreach_mem()

macro foreach_mem ( struct _Memindex index,
int  len,
int  _i 
)

The foreach_mem() macro traverses every _i allocated elements of array _m taking into account a periodicity of _len (and ghost cells).

Definition at line 149 of file simple.h.

References _i, GHOSTS, Point::i, index, max, Memindex, min, Period, point, and x.

◆ mem_allocated()

static const bool mem_allocated ( const struct _Memindex m,
const int  i,
const int  j 
)
inlinestatic

The mem_data() macros return the data stored at a specific (multidimensional) index.

It assumes that the index is allocated. This can be checked with mem_allocated().

Definition at line 41 of file simple.h.

References i, j, m(), and x.

Here is the call graph for this function:

◆ mem_assign()

void mem_assign ( struct _Memindex m,
int  i,
int  len,
void b 
)

The mem_assign() function assigns a (pointer) value to a given index.

Definition at line 90 of file simple.h.

References b, calloc(), i, m(), and mem_data.

Here is the call graph for this function:

◆ mem_destroy()

void mem_destroy ( struct _Memindex m,
int  len 
)

The mem_destroy() function frees all the memory allocated by a given Memindex.

Definition at line 69 of file simple.h.

References free(), i, j, and m().

Here is the call graph for this function:

◆ mem_free()

void mem_free ( struct _Memindex m,
int  i,
int  j,
int  len,
void b 
)

The mem_free() function frees a given index.

Definition at line 133 of file simple.h.

References i, j, m(), mem_data, and x.

Here is the call graph for this function:

◆ mem_new()

struct _Memindex * mem_new ( int  len)

The mem_new() function returns a new (empty) Memindex.

Definition at line 59 of file simple.h.

References calloc(), m(), and Memindex.

Here is the call graph for this function: