28 #ifndef T8_CMESH_PART_TREE_H
29 #define T8_CMESH_PART_TREE_H
123 #define T8_TREE_FIRST_ATT(t) ((char *)(t) + (t)->att_offset)
126 #define T8_TREE_ATTR_INFO(t,i) ((t8_attribute_info_struct_t *) \
127 ((char*)(t) + (t)->att_offset + \
128 (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) + \
138 t8_eclass_num_faces[(t)->eclass] * sizeof(t8_locidx_t))
141 #define T8_GHOST_FIRST_ATT(g) T8_TREE_FIRST_ATT (g)
144 #define T8_GHOST_ATTR_INFO(g,i) T8_TREE_ATTR_INFO (g, i)
147 #define T8_GHOST_ATTR(g,ai) T8_TREE_ATTR(g,ai)
150 #define T8_GHOST_FACE(g) T8_TREE_FACE(g)
153 #define T8_GHOST_TTF(g) (int8_t *) (T8_GHOST_FACE(g) + \
154 t8_eclass_num_faces[(g)->eclass] * sizeof(t8_gloidx_t))
335 int face, int8_t *ttf);
422 size_t num_attributes,
440 int package_id,
int key,
441 size_t *size,
int is_ghost);
481 const int orientation);
494 const int8_t tree_to_face,
534 int t8_cmesh_trees_is_equal (
t8_cmesh_t cmesh,
Definition: t8_cmesh_types.h:156
Definition: t8_cmesh_types.h:231
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:83
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:244
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:159
t8_gloidx_t global_id
The global id.
Definition: t8_cmesh_trees.h:160
t8_locidx_t local_id
The local id.
Definition: t8_cmesh_trees.h:161
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:105
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:94
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:480
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:95
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:610
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:540
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:383
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:326
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:117
t8_part_tree_t t8_cmesh_trees_get_part(t8_cmesh_trees_t trees, int proc)
Return one part of a specified tree array.
Definition: t8_cmesh_trees.c:61
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:453
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:521
size_t t8_cmesh_trees_get_numproc(t8_cmesh_trees_t trees)
Return the number of parts of a trees structure.
Definition: t8_cmesh_trees.c:787
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:495
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:569
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:68
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:801
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:840
void * t8_cmesh_trees_get_attribute(t8_cmesh_trees_t trees, t8_locidx_t ltree_id, int package_id, int key, size_t *size, int is_ghost)
Return an attribute that is stored at a tree.
Definition: t8_cmesh_trees.c:716
void t8_cmesh_trees_bcast(t8_cmesh_t cmesh_in, int root, sc_MPI_Comm comm)
Brodcast an existing valid trees structure from a root rank to all other ranks.
Definition: t8_cmesh_trees.c:918
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:553
void t8_cmesh_trees_destroy(t8_cmesh_trees_t *trees)
Free all memory allocated with a trees structure.
Definition: t8_cmesh_trees.c:1211
void 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:237
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:827
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:468
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:621
int t8_cmesh_trees_is_face_consistend(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:1002
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:398
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:514
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:198
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 neigbor of a tree at a given face and return the tree_to_face info.
We define here the datatypes needed for internal cmesh routines.
enum t8_eclass t8_eclass_t
This enumeration contains all possible element classes.