28 #ifndef T8_CMESH_PART_TREE_H
29 #define T8_CMESH_PART_TREE_H
124 #define T8_TREE_FIRST_ATT(t) ((char *) (t) + (t)->att_offset)
127 #define T8_TREE_ATTR_INFO(t, i) \
128 ((t8_attribute_info_struct_t *) ((char *) (t) + (t)->att_offset + (i) * sizeof (t8_attribute_info_struct_t)))
131 #define T8_TREE_ATTR(t, ai) (T8_TREE_FIRST_ATT (t) + (ai)->attribute_offset)
134 #define T8_TREE_FACE(t) ((char *) (t) + (t)->neigh_offset)
137 #define T8_TREE_TTF(t) (T8_TREE_FACE (t) + t8_eclass_num_faces[(t)->eclass] * sizeof (t8_locidx_t))
140 #define T8_GHOST_FIRST_ATT(g) T8_TREE_FIRST_ATT (g)
143 #define T8_GHOST_ATTR_INFO(g, i) T8_TREE_ATTR_INFO (g, i)
146 #define T8_GHOST_ATTR(g, ai) T8_TREE_ATTR (g, ai)
149 #define T8_GHOST_FACE(g) T8_TREE_FACE (g)
152 #define T8_GHOST_TTF(g) (int8_t *) (T8_GHOST_FACE (g) + t8_eclass_num_faces[(g)->eclass] * sizeof (t8_gloidx_t))
412 const int key,
size_t *size,
int is_ghost);
438 t8_locidx_t local_ghost_id,
size_t index,
size_t *attribute_data_offset);
Definition: t8_cmesh_types.h:157
Definition: t8_cmesh_types.h:230
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:88
This structure holds the data of a local tree including the information about face neighbors.
Definition: t8_cmesh_types.h:189
Definition: t8_cmesh_types.h:242
The attribute information that is stored before a cmesh is committed.
Definition: t8_cmesh_stash.h:63
This struct is an entry of the trees global_id to local_id hash table for ghost trees.
Definition: t8_cmesh_trees.h:157
t8_gloidx_t global_id
The global id.
Definition: t8_cmesh_trees.h:158
t8_locidx_t local_id
The local id.
Definition: t8_cmesh_trees.h:159
This is the administrative header file for t8code.
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:100
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:89
We define the coarse mesh of trees in this file.
t8_ctree_t t8_cmesh_trees_get_tree_ext(t8_cmesh_trees_t trees, t8_locidx_t ltree_id, t8_locidx_t **face_neigh, int8_t **ttf)
Return a pointer to a specific tree in a trees struct plus pointers to its face_neighbor and tree_to_...
Definition: t8_cmesh_trees.c:473
void t8_cmesh_trees_add_tree(t8_cmesh_trees_t trees, t8_locidx_t ltree_id, int proc, t8_eclass_t eclass)
Add a tree to a trees structure.
Definition: t8_cmesh_trees.c:88
void t8_cmesh_trees_copy_toproc(t8_cmesh_trees_t trees_dest, t8_cmesh_trees_t trees_src, t8_locidx_t lnum_trees, t8_locidx_t lnum_ghosts)
Copy the tree_to_proc and ghost_to_proc arrays of one tree structure to another one.
Definition: t8_cmesh_trees.c:596
t8_cghost_t t8_cmesh_trees_get_ghost(t8_cmesh_trees_t trees, t8_locidx_t lghost)
Return a pointer to a specific ghost in a trees struct.
Definition: t8_cmesh_trees.c:530
size_t t8_cmesh_trees_attribute_size(t8_ctree_t tree)
Return the total size of all attributes stored at a specified tree.
Definition: t8_cmesh_trees.c:381
size_t t8_cmesh_trees_get_numproc(const t8_cmesh_trees_t trees)
Return the number of parts of a trees structure.
Definition: t8_cmesh_trees.c:792
void t8_cmesh_trees_set_all_boundary(t8_cmesh_t cmesh, t8_cmesh_trees_t trees)
Set all neighbor fields of all local trees and ghosts to boundary.
Definition: t8_cmesh_trees.c:329
void t8_cmesh_trees_add_ghost(t8_cmesh_trees_t trees, t8_locidx_t lghost_index, t8_gloidx_t gtree_id, int proc, t8_eclass_t eclass, t8_locidx_t num_local_trees)
Add a ghost to a trees structure.
Definition: t8_cmesh_trees.c:109
void t8_cmesh_trees_copy_part(t8_cmesh_trees_t trees_dest, int part_dest, t8_cmesh_trees_t trees_src, int part_src)
Copy the trees array from one part to another.
Definition: t8_cmesh_trees.c:447
t8_gloidx_t t8_cmesh_trees_get_ghost_face_neighbor_ext(const t8_cghost_t ghost, const int face, int8_t *ttf)
Given a coarse ghost and a face number, return the local id of the neighbor tree together with its tr...
Definition: t8_cmesh_trees.c:512
t8_locidx_t t8_cmesh_trees_get_face_neighbor_ext(const t8_ctree_t tree, const int face, int8_t *ttf)
Given a coarse tree and a face number, return the local id of the neighbor tree together with its tre...
Definition: t8_cmesh_trees.c:487
t8_part_tree_t t8_cmesh_trees_get_part(const t8_cmesh_trees_t trees, const int proc)
Return one part of a specified tree array.
Definition: t8_cmesh_trees.c:60
t8_locidx_t t8_cmesh_trees_get_ghost_local_id(t8_cmesh_trees_t trees, t8_gloidx_t global_id)
Given the global tree id of a ghost tree in a trees structure, return its local ghost id.
Definition: t8_cmesh_trees.c:557
void t8_cmesh_trees_init(t8_cmesh_trees_t *ptrees, int num_procs, t8_locidx_t num_trees, t8_locidx_t num_ghosts)
Initialize a trees structure and allocate its parts.
Definition: t8_cmesh_trees.c:67
int8_t t8_cmesh_tree_to_face_encode(const int dimension, const t8_locidx_t face, const int orientation)
Compute the tree-to-face information given a face and orientation value of a face connection.
Definition: t8_cmesh_trees.c:806
void t8_cmesh_trees_print(t8_cmesh_t cmesh, t8_cmesh_trees_t trees)
Print the trees,ghosts and their neighbors in ASCII format t stdout.
Definition: t8_cmesh_trees.c:842
void t8_cmesh_trees_bcast(t8_cmesh_t cmesh_in, int root, sc_MPI_Comm comm)
Broadcast an existing valid trees structure from a root rank to all other ranks.
Definition: t8_cmesh_trees.c:911
t8_cghost_t t8_cmesh_trees_get_ghost_ext(t8_cmesh_trees_t trees, t8_locidx_t lghost_id, t8_gloidx_t **face_neigh, int8_t **ttf)
Return a pointer to a specific ghost in a trees struct plus pointers to its face_neighbor and tree_to...
Definition: t8_cmesh_trees.c:542
void * t8_cmesh_trees_get_attribute(const t8_cmesh_trees_t trees, const t8_locidx_t ltree_id, const int package_id, const int key, size_t *size, int is_ghost)
Return an attribute that is stored at a tree.
Definition: t8_cmesh_trees.c:728
void t8_cmesh_trees_destroy(t8_cmesh_trees_t *trees)
Free all memory allocated with a trees structure.
Definition: t8_cmesh_trees.c:1175
void t8_cmesh_tree_to_face_decode(const int dimension, const int8_t tree_to_face, int *face, int *orientation)
Given a tree-to-face value, get its encoded face number and orientation.
Definition: t8_cmesh_trees.c:830
t8_ctree_t t8_cmesh_trees_get_tree(t8_cmesh_trees_t trees, t8_locidx_t ltree)
Return a pointer to a specific tree in a trees struct.
Definition: t8_cmesh_trees.c:461
void t8_cmesh_trees_init_attributes(t8_cmesh_trees_t trees, t8_locidx_t ltree_id, size_t num_attributes, size_t attr_bytes)
For one tree in a trees structure set the number of attributes and temporarily store the total size o...
Definition: t8_cmesh_trees.c:604
size_t t8_cmesh_trees_ghost_attribute_size(t8_cghost_t ghost)
Return the total size of all attributes stored at a specified ghost.
Definition: t8_cmesh_trees.c:396
t8_locidx_t t8_cmesh_trees_get_face_neighbor(const t8_ctree_t tree, const int face)
Given a coarse tree and a face number, return the local id of the neighbor tree.
Definition: t8_cmesh_trees.c:505
void t8_cmesh_trees_start_part(t8_cmesh_trees_t trees, int proc, t8_locidx_t lfirst_tree, t8_locidx_t num_trees, t8_locidx_t lfirst_ghost, t8_locidx_t num_ghosts, int alloc)
Allocate the first_tree array of a given tree_part in a tree struct with a given number of trees and ...
Definition: t8_cmesh_trees.c:185
size_t t8_cmesh_trees_finish_part(t8_cmesh_trees_t trees, int proc)
After all classes of trees and ghosts have been set and after the number of tree attributes was set a...
Definition: t8_cmesh_trees.c:220
t8_locidx_t t8_cmesh_trees_get_face_info(t8_cmesh_trees_t trees, t8_locidx_t ltreeid, int face, int8_t *ttf)
Return the face neighbor of a tree at a given face and return the tree_to_face info.
int t8_cmesh_trees_is_face_consistent(t8_cmesh_t cmesh, t8_cmesh_trees_t trees)
Check whether the face connection of a trees structure are consistent.
Definition: t8_cmesh_trees.c:991
We define here the datatypes needed for internal cmesh routines.
enum t8_eclass t8_eclass_t
This enumeration contains all possible element classes.