28 #ifndef T8_CONTAINERS_H
29 #define T8_CONTAINERS_H
96 size_t offset,
size_t length);
128 size_t num_elements);
183 *element_array,
int index);
This struct holds virtual functions for a particular element class.
Definition: t8_element_cxx.hxx:47
The t8_element_array_t is an array to store t8_element_t * of a given eclass_scheme implementation.
Definition: t8_containers.h:42
sc_array_t array
The array in which the elements are stored.
Definition: t8_containers.h:44
t8_eclass_scheme_c * scheme
An eclass scheme of which elements should be stored.
Definition: t8_containers.h:43
This is the administrative header file for t8code.
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:94
t8_element_array_t * t8_element_array_new_count(t8_eclass_scheme_c *scheme, size_t num_elements)
Creates a new array structure with a given length (number of elements) and calls t8_element_new for t...
Definition: t8_containers.cxx:72
void t8_element_array_init(t8_element_array_t *element_array, t8_eclass_scheme_c *scheme)
Initializes an already allocated (or static) array structure.
Definition: t8_containers.cxx:86
void t8_element_array_reset(t8_element_array_t *element_array)
Sets the array count to zero and frees all elements.
Definition: t8_containers.cxx:295
void t8_element_array_init_copy(t8_element_array_t *element_array, t8_eclass_scheme_c *scheme, t8_element_t *data, size_t num_elements)
Initializes an already allocated (or static) array structure and copy an existing array of t8_element...
Definition: t8_containers.cxx:149
t8_element_array_t * t8_element_array_new(t8_eclass_scheme_c *scheme)
Creates a new array structure with 0 elements.
Definition: t8_containers.cxx:58
t8_element_t * t8_element_array_push(t8_element_array_t *element_array)
Enlarge an array by one element.
Definition: t8_containers.cxx:212
t8_element_t * t8_element_array_index_locidx(t8_element_array_t *element_array, t8_locidx_t index)
Return a given element in an array.
Definition: t8_containers.cxx:236
void t8_element_array_init_view(t8_element_array_t *view, t8_element_array_t *array, size_t offset, size_t length)
Initializes an already allocated (or static) view from existing t8_element_array.
Definition: t8_containers.cxx:123
t8_element_t * t8_element_array_get_data(t8_element_array_t *element_array)
Return a pointer to the real data array stored in a t8_element_array.
Definition: t8_containers.cxx:274
size_t t8_element_array_get_size(t8_element_array_t *element_array)
Return the data size of elements stored in a t8_element_array_t.
Definition: t8_containers.cxx:267
size_t t8_element_array_get_count(t8_element_array_t *element_array)
Return the number of elements stored in a t8_element_array_t.
Definition: t8_containers.cxx:260
sc_array_t * t8_element_array_get_array(t8_element_array_t *element_array)
Return a pointer to the sc_array stored in a t8_element_array.
Definition: t8_containers.cxx:287
void t8_element_array_resize(t8_element_array_t *element_array, size_t new_count)
Change the number of elements stored in an element array.
Definition: t8_containers.cxx:182
t8_eclass_scheme_c * t8_element_array_get_scheme(t8_element_array_t *element_array)
Return the eclass scheme associated to a t8_element_array.
Definition: t8_containers.cxx:253
void t8_element_array_copy(t8_element_array_t *dest, t8_element_array_t *src)
Copy the contents of an array into another.
Definition: t8_containers.cxx:203
void t8_element_array_truncate(t8_element_array_t *element_array)
Sets the array count to zero, but does not free elements.
Definition: t8_containers.cxx:302
void t8_element_array_init_size(t8_element_array_t *element_array, t8_eclass_scheme_c *scheme, size_t num_elements)
Initializes an already allocated (or static) array structure and allocates a given number of elements...
Definition: t8_containers.cxx:102
t8_element_t * t8_element_array_push_count(t8_element_array_t *element_array, size_t count)
Enlarge an array by a number of elements.
Definition: t8_containers.cxx:223
void t8_element_array_init_data(t8_element_array_t *view, t8_element_t *base, t8_eclass_scheme_c *scheme, size_t elem_count)
Initializes an already allocated (or static) view from given plain C data (array of t8_element_t).
Definition: t8_containers.cxx:137
t8_element_t * t8_element_array_index_int(t8_element_array_t *element_array, int index)
Return a given element in an array.
Definition: t8_containers.cxx:245
This file defines basic operations on an element in a refinement tree.
struct t8_element t8_element_t
Opaque structure for a generic element, only used as pointer.
Definition: t8_element.h:42