32 #ifndef P4EST_CONNECTIVITY_H
33 #define P4EST_CONNECTIVITY_H
36 #error "Including a p4est header with P4_TO_P8 defined"
47 #define P4EST_FACES (2 * P4EST_DIM)
51 #define P4EST_CHILDREN 4
53 #define P4EST_HALF (P4EST_CHILDREN / 2)
58 #define P4EST_ONLY_P8_LAND(x)
61 #define P4EST_ONLY_P8_COMMA(x)
64 #define P4EST_DIM_POW(a) ((a) * (a))
67 #define P4EST_FTRANSFORM 9
70 #define P4EST_STRING "p4est"
76 #define P4EST_ONDISK_FORMAT 0x2000009
90 P4EST_CONNECT_SELF = 20,
91 P4EST_CONNECT_FACE = 21,
92 P4EST_CONNECT_CORNER = 22,
93 P4EST_CONNECT_FULL = P4EST_CONNECT_CORNER
97 #ifdef P4EST_BACKWARD_DEALII
104 P4EST_CONN_ENCODE_NONE = SC_IO_ENCODE_NONE,
251 void p4est_connectivity_get_neighbor_transforms
284 (
int fc,
int f,
int nf,
int o);
295 (
int c,
int f,
int nf,
int o);
324 const double *vertices,
361 size_t bytes_per_tree);
382 sc_io_sink_t * sink);
619 int iface,
int ftransform[]);
666 int is_current_to_new);
667 #ifdef P4EST_WITH_METIS
691 void p4est_connectivity_reorder (
sc_MPI_Comm comm,
int k,
765 p4est_corner_array_index (
sc_array_t * array,
size_t it)
768 P4EST_ASSERT (it < array->elem_count);
General support types and functions.
int32_t p4est_qcoord_t
Typedef for quadrant coordinates.
Definition: p4est_base.h:81
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:93
p4est_topidx_t p4est_find_face_transform(p4est_connectivity_t *connectivity, p4est_topidx_t itree, int iface, int ftransform[])
Fill an array with the axis combinations of a tree neighbor transform.
p4est_connectivity_t * p4est_connectivity_refine(p4est_connectivity_t *conn, int num_per_edge)
Uniformly refine a connectivity.
void p4est_neighbor_transform_coordinates_reverse(const p4est_neighbor_transform_t *nt, const p4est_qcoord_t neigh_coords[P4EST_DIM], p4est_qcoord_t self_coords[P4EST_DIM])
Transform from neighbor's coordinate system to self's coordinate system.
p4est_connectivity_t * p4est_connectivity_new_icosahedron()
Create a connectivity for mapping the sphere using an icosahedron.
void p4est_connectivity_complete(p4est_connectivity_t *conn)
Internally connect a connectivity based on tree_to_vertex information.
void p4est_connectivity_set_attr(p4est_connectivity_t *conn, size_t bytes_per_tree)
Allocate or free the attribute fields in a connectivity.
p4est_connectivity_t * p4est_connectivity_new_moebius(void)
Create a connectivity structure for a five-tree moebius band.
void p4est_connectivity_destroy(p4est_connectivity_t *connectivity)
Destroy a connectivity structure.
p4est_connectivity_t * p4est_connectivity_new_star(void)
Create a connectivity structure for a six-tree star.
size_t p4est_connectivity_memory_used(p4est_connectivity_t *conn)
Calculate memory usage of a connectivity structure.
int p4est_connectivity_face_neighbor_face_corner(int fc, int f, int nf, int o)
Transform a face corner across one of the adjacent faces into a neighbor tree.
#define P4EST_DIM
The spatial dimension.
Definition: p4est_connectivity.h:45
p4est_connectivity_t * p4est_connectivity_new_cubed(void)
Create a connectivity structure for the six sides of a unit cube.
int p4est_connectivity_is_valid(p4est_connectivity_t *connectivity)
Examine a connectivity structure.
p4est_connectivity_t * p4est_connectivity_source(sc_io_source_t *source)
Read connectivity from a source object.
p4est_connectivity_t * p4est_connectivity_new_disk(int periodic_a, int periodic_b)
Create a connectivity structure for a five-tree flat spherical disk.
p4est_connectivity_t * p4est_connectivity_load(const char *filename, size_t *bytes)
Load a connectivity structure from disk.
const int p4est_corner_faces[4][2]
Store the face numbers 0..3 for each tree corner.
p4est_connectivity_t * p4est_connectivity_new_brick(int mi, int ni, int periodic_a, int periodic_b)
A rectangular m by n array of trees with configurable periodicity.
const int p4est_face_corners[4][2]
Store the corner numbers 0..4 for each tree face.
const int p4est_corner_face_corners[4][4]
Store the face corner numbers for the faces touching a tree corner.
void p4est_neighbor_transform_coordinates(const p4est_neighbor_transform_t *nt, const p4est_qcoord_t self_coords[P4EST_DIM], p4est_qcoord_t neigh_coords[P4EST_DIM])
Transform from self's coordinate system to neighbor's coordinate system.
void p4est_connectivity_reduce(p4est_connectivity_t *conn)
Removes corner information of a connectivity such that enough information is left to run p4est_connec...
p4est_connectivity_encode_t
Typedef for serialization method.
Definition: p4est_connectivity.h:103
@ P4EST_CONN_ENCODE_LAST
Invalid entry to close the list.
Definition: p4est_connectivity.h:105
void p4est_connectivity_join_faces(p4est_connectivity_t *conn, p4est_topidx_t tree_left, p4est_topidx_t tree_right, int face_left, int face_right, int orientation)
p4est_connectivity_join_faces This function takes an existing valid connectivity conn and modifies it...
struct p4est_connectivity p4est_connectivity_t
This structure holds the 2D inter-tree connectivity information.
int p4est_connectivity_is_equivalent(p4est_connectivity_t *conn1, p4est_connectivity_t *conn2)
p4est_connectivity_is_equivalent This function compares two connectivities for equivalence: it return...
p4est_connectivity_t * p4est_connectivity_new_pillow(void)
Create a connectivity structure for two trees on top of each other.
sc_array_t * p4est_connectivity_deflate(p4est_connectivity_t *conn, p4est_connectivity_encode_t code)
Allocate memory and store the connectivity information there.
p4est_connectivity_t * p4est_connectivity_new_disk2d(void)
Create a connectivity structure that maps a 2d disk.
int p4est_connect_type_int(p4est_connect_type_t btype)
Convert the p4est_connect_type_t into a number.
p4est_connectivity_t * p4est_connectivity_new_shell2d(void)
Create a connectivity structure that builds a 2d spherical shell.
p4est_connectivity_t * p4est_connectivity_new_twotrees(int l_face, int r_face, int orientation)
Create a connectivity structure for two trees being rotated w.r.t.
int p4est_connectivity_read_inp_stream(FILE *stream, p4est_topidx_t *num_vertices, p4est_topidx_t *num_trees, double *vertices, p4est_topidx_t *tree_to_vertex)
Read an ABAQUS input file from a file stream.
p4est_connectivity_t * p4est_connectivity_new_unitsquare(void)
Create a connectivity structure for the unit square.
p4est_connectivity_t * p4est_connectivity_new_rotwrap(void)
Create a connectivity structure for a periodic unit square.
const char * p4est_connect_type_string(p4est_connect_type_t btype)
Convert the p4est_connect_type_t into a const string.
void p4est_find_corner_transform(p4est_connectivity_t *connectivity, p4est_topidx_t itree, int icorner, p4est_corner_info_t *ci)
Fills an array with information about corner neighbors.
p4est_connectivity_t * p4est_connectivity_new(p4est_topidx_t num_vertices, p4est_topidx_t num_trees, p4est_topidx_t num_corners, p4est_topidx_t num_ctt)
Allocate a connectivity structure.
p4est_connectivity_t * p4est_connectivity_new_byname(const char *name)
Create connectivity structure from predefined catalogue.
p4est_connectivity_t * p4est_connectivity_new_disk_nonperiodic(void)
Create a connectivity structure for a five-tree flat spherical disk.
int p4est_connectivity_is_equal(p4est_connectivity_t *conn1, p4est_connectivity_t *conn2)
Check two connectivity structures for equality.
p4est_connectivity_t * p4est_connectivity_new_corner(void)
Create a connectivity structure for a three-tree mesh around a corner.
p4est_connect_type_t
Characterize a type of adjacency.
Definition: p4est_connectivity.h:88
const int p4est_face_dual[4]
Store the face numbers in the face neighbor's system.
p4est_connectivity_t * p4est_connectivity_new_periodic(void)
Create a connectivity structure for an all-periodic unit square.
p4est_connectivity_t * p4est_connectivity_bcast(p4est_connectivity_t *conn_in, int root, sc_MPI_Comm comm)
Broadcast a connectivity structure that exists only on one process to all.
int p4est_connectivity_face_neighbor_corner(int c, int f, int nf, int o)
Transform a corner across one of the adjacent faces into a neighbor tree.
const int p4est_child_corner_faces[4][4]
Store the faces for each child and corner, can be -1.
void p4est_expand_face_transform(int iface, int nface, int ftransform[])
Fill an array with the axis combination of a face neighbor transform.
p4est_connectivity_t * p4est_connectivity_new_copy(p4est_topidx_t num_vertices, p4est_topidx_t num_trees, p4est_topidx_t num_corners, const double *vertices, const p4est_topidx_t *ttv, const p4est_topidx_t *ttt, const int8_t *ttf, const p4est_topidx_t *ttc, const p4est_topidx_t *coff, const p4est_topidx_t *ctt, const int8_t *ctc)
Allocate a connectivity structure and populate from constants.
p4est_connectivity_t * p4est_connectivity_inflate(sc_array_t *buffer)
Create new connectivity from a memory buffer.
p4est_connectivity_t * p4est_connectivity_read_inp(const char *filename)
Create a p4est connectivity from an ABAQUS input file.
void p4est_connectivity_permute(p4est_connectivity_t *conn, sc_array_t *perm, int is_current_to_new)
p4est_connectivity_permute Given a permutation perm of the trees in a connectivity conn,...
int p4est_connectivity_save(const char *filename, p4est_connectivity_t *connectivity)
Save a connectivity structure to disk.
int p4est_connectivity_sink(p4est_connectivity_t *conn, sc_io_sink_t *sink)
Write connectivity to a sink object.
sc3_MPI_Comm_t sc_MPI_Comm
This structure holds the 2D inter-tree connectivity information.
Definition: p4est_connectivity.h:153
p4est_topidx_t num_vertices
the number of vertices that define the embedding of the forest (not the topology)
Definition: p4est_connectivity.h:154
p4est_topidx_t num_trees
the number of trees
Definition: p4est_connectivity.h:157
int8_t * tree_to_face
(4 * num_trees) face to face+orientation (see description)
Definition: p4est_connectivity.h:171
p4est_topidx_t * ctt_offset
corner to offset in corner_to_tree and corner_to_corner
Definition: p4est_connectivity.h:176
p4est_topidx_t num_corners
the number of corners that help define topology
Definition: p4est_connectivity.h:158
int8_t * corner_to_corner
list of tree-corners that meet at a corner
Definition: p4est_connectivity.h:179
p4est_topidx_t * tree_to_vertex
embed each tree into for e.g.
Definition: p4est_connectivity.h:162
p4est_topidx_t * tree_to_tree
(4 * num_trees) neighbors across faces
Definition: p4est_connectivity.h:169
char * tree_to_attr
not touched by p4est
Definition: p4est_connectivity.h:167
p4est_topidx_t * tree_to_corner
(4 * num_trees) or NULL (see description)
Definition: p4est_connectivity.h:174
p4est_topidx_t * corner_to_tree
list of trees that meet at a corner
Definition: p4est_connectivity.h:178
double * vertices
an array of size (3 * num_vertices)
Definition: p4est_connectivity.h:160
size_t tree_attr_bytes
bytes per tree in tree_to_attr
Definition: p4est_connectivity.h:166
Definition: p4est_connectivity.h:199