|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
Go to the source code of this file.
Data Structures | |
| struct | Memalloc |
| struct | Memrange |
| struct | _Memindex |
Macros | |
| #define | Memindex struct _Memindex * |
| #define | mem_allocated(m, i, j) |
The mem_data() macros return the data stored at a specific (multidimensional) index. | |
| #define | mem_data(m, i, j) ((m)->b[i][j]) |
Functions | |
| void | memrange_alloc (Memrange *r, Memalloc *mem, int i) |
| bool | memrange_free (Memrange *r, Memalloc *mem, int i) |
| struct _Memindex * | mem_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 j, 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). | |
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().
The mem_assign() function assigns a (pointer) value to a given index.
Definition at line 220 of file range.h.
References b, i, j, m(), mem_data, memrange_alloc(), and x.
The mem_destroy() function frees all the memory allocated by a given Memindex.
Definition at line 183 of file range.h.
References free(), i, j, and m().
Referenced by destroy_layer().
The mem_free() function frees a given index.
Definition at line 261 of file range.h.
References i, j, m(), memrange_free(), and x.
The memrange_alloc() function allocates the memory of the arrays defined by mem and updates the corresponding index range r for a (new) element of index i.
The mem argument is an array of Memalloc structures ending with a NULL pointer for element p.
Definition at line 36 of file range.h.
References calloc(), Memrange::end, i, m(), Memalloc::p, realloc(), Memrange::start, and x.
Referenced by mem_assign().
The memrange_free() function takes the same arguments as memrange_alloc() but performs the inverse operation. It returns true if the arrays are empty after deallocation (i.e. the range of indices is empty).
Definition at line 75 of file range.h.
References assert, Memrange::end, free(), i, m(), Memalloc::p, realloc(), Memalloc::size, Memrange::start, and x.
Referenced by mem_free().