p4est 2.8.7.456-de8c6
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
p8est_tnodes.h File Reference

Generate a conforming tetrahedron mesh from a 2:1 balanced p8est. More...

#include <p8est_lnodes.h>
Include dependency graph for p8est_tnodes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  p8est_tnodes
 Lookup table structure defining a conforming tetrahedral mesh. More...
 

Macros

#define P8EST_TNODES_SIMPLEX_CORNERS   4
 Number of corners of a simplex.
 
#define P8EST_TNODES_CUBE_SIMPLICES   6
 Number of coarse simplices in a cube.
 

Typedefs

typedef struct p8est_tnodes p8est_tnodes_t
 Lookup table structure defining a conforming tetrahedral mesh.
 

Functions

int p4est_tnodes_simplex_parent (int p, int c, int k)
 Compute the number of the parent simplex that contains this one.
 
int p8est_tnodes_simplex_parent_is_valid (int p, int kp, int c, int kc)
 Verify that a given child simplex is contained in a parent.
 
int p8est_tnodes_quadrant_Q1_simplices (p8est_lnodes_code_t fc, int pc)
 Based on a face code and the parent's id, calculate simplex count.
 
int p8est_tnodes_quadrant_Q2_simplices (p8est_lnodes_code_t fc)
 Based on the face code of an element, calculate contained simplices.
 
p8est_tnodes_t * p8est_tnodes_new_Q1_P1 (p8est_t *p4est, p8est_lnodes_t *lnodes)
 Generate a conforming tetrahedral mesh from a Q1 lnodes structure.
 
p8est_tnodes_t * p8est_tnodes_new_Q2_P1 (p8est_t *p4est, p8est_lnodes_t *lnodes)
 Generate a conforming tetrahedral mesh from a Q2 lnodes structure.
 
p8est_tnodes_t * p8est_tnodes_new_Q2_P1_ind (p8est_t *p4est, p8est_lnodes_t *lnodes)
 Generate a conforming tetrahedron mesh from a Q2 lnodes structure.
 
size_t p8est_tnodes_memory_used (p8est_tnodes_t *tnodes)
 Calculate memory allocated in a tnodes structure.
 
void p8est_tnodes_destroy (p8est_tnodes_t *tnodes)
 Free the memory in a conforming tetrahedron mesh structure.
 

Variables

const int p8est_tnodes_face_normal [6]
 For every simplex number the normal direction of its outside face.
 
const int p8est_tnodes_simplex_reverse [6]
 The number of the congruent simplex that starts at the antipode.
 
const int p8est_tnodes_simplex_edgeswap [6]
 The simplex that shares the face direction and swaps the edge.
 

Detailed Description

Generate a conforming tetrahedron mesh from a 2:1 balanced p8est.

This mesh is based on a given p8est_lnodes structure. Additional lookup tables define the simplex mesh.

Please see a textual overview under Conforming simplex export.

Function Documentation

◆ p4est_tnodes_simplex_parent()

int p4est_tnodes_simplex_parent ( int  p,
int  c,
int  k 
)

Compute the number of the parent simplex that contains this one.

Parameters
[in]pChild id of parent element in [0, 8).
[in]cChild id of child element in [0, 8).
[in]kNumber of simplex in [0, 6) within child. return Number of simplex in [0, 6) within parent.

◆ p8est_tnodes_destroy()

void p8est_tnodes_destroy ( p8est_tnodes_t *  tnodes)

Free the memory in a conforming tetrahedron mesh structure.

Parameters
[in]tnodesMemory is deallocated. Do not use after return.

◆ p8est_tnodes_memory_used()

size_t p8est_tnodes_memory_used ( p8est_tnodes_t *  tnodes)

Calculate memory allocated in a tnodes structure.

Parameters
[in]tnodesValid tnodes structure.
Returns
Total memory allocation in bytes.

◆ p8est_tnodes_new_Q1_P1()

p8est_tnodes_t * p8est_tnodes_new_Q1_P1 ( p8est_t *  p4est,
p8est_lnodes_t *  lnodes 
)

Generate a conforming tetrahedral mesh from a Q1 lnodes structure.

Parameters
[in]p4estForest underlying the mesh. It must not contain any root-level elements: to avoid this, it should be refined a priori.
[in]lnodesValid node structure of degree 1. Must be derived from the p4est.
Returns
Valid conforming tetrahedral mesh. Each tetrahedron overlaps one or more elements. It is assigned to exactly one of their owner processes. The tetrahedra are right-handed with respect to the tree coordinate system containing their element.

◆ p8est_tnodes_new_Q2_P1()

p8est_tnodes_t * p8est_tnodes_new_Q2_P1 ( p8est_t *  p4est,
p8est_lnodes_t *  lnodes 
)

Generate a conforming tetrahedral mesh from a Q2 lnodes structure.

Parameters
[in]p4estForest underlying the mesh. It must not contain any elements at P4EST_QMAXLEVEL. To avoid this, it should not be refined that deep.
[in]lnodesValid node structure of degree 2. Must be derived from the p4est.
Returns
Valid conforming tetrahedral mesh. Each tetrahedron is contained in exactly one process. The tetrahedra are right-handed with respect to the tree coordinate system containing their element.

◆ p8est_tnodes_new_Q2_P1_ind()

p8est_tnodes_t * p8est_tnodes_new_Q2_P1_ind ( p8est_t *  p4est,
p8est_lnodes_t *  lnodes 
)

Generate a conforming tetrahedron mesh from a Q2 lnodes structure.

This function uses a method distinct from p8est_tnodes_new_Q2_P1 but produces an identical result. It is useful for verification.

Parameters
[in]p4estForest underlying the mesh. It must not contain any elements at P4EST_QMAXLEVEL. To avoid this, it should not be refined that deep.
[in]lnodesValid node structure of degree 2. Must be derived from the p4est.
Returns
Valid conforming tetrahedral mesh. Each tetrahedron is contained in exactly one process. The tetrahedra are right-handed with respect to the tree coordinate system containing their element.

◆ p8est_tnodes_quadrant_Q1_simplices()

int p8est_tnodes_quadrant_Q1_simplices ( p8est_lnodes_code_t  fc,
int  pc 
)

Based on a face code and the parent's id, calculate simplex count.

Parameters
[in]fcValid face code as defined in p8est_lnodes.h.
[in]pcChild id of quadrant's parent.
Returns
Element simplex count between 2 and 6 inclusive.

◆ p8est_tnodes_quadrant_Q2_simplices()

int p8est_tnodes_quadrant_Q2_simplices ( p8est_lnodes_code_t  fc)

Based on the face code of an element, calculate contained simplices.

Parameters
[in]fcValid face code as defined in p8est_lnodes.h.
Returns
Element simplex count between 24 and 48 inclusive.

◆ p8est_tnodes_simplex_parent_is_valid()

int p8est_tnodes_simplex_parent_is_valid ( int  p,
int  kp,
int  c,
int  kc 
)

Verify that a given child simplex is contained in a parent.

Parameters
[in]pNumber of parent element in [0, 8).
[in]kpNumber of simplex in [0, 6) within parent.
[in]cNumber of child element in [0, 8).
[in]kcNumber of simplex in [0, 6) within child.
Returns
True if contained, false if not.

Variable Documentation

◆ p8est_tnodes_face_normal

const int p8est_tnodes_face_normal[6]
extern

For every simplex number the normal direction of its outside face.

The normal is for every k = 2i + j, with i in [0, 3), j in [0, 2). The edge direction is i, and j indexes the normals of the two faces touching an edge of this direction in ascending order. The result is a normal direction in [0, 3).

◆ p8est_tnodes_simplex_reverse

const int p8est_tnodes_simplex_reverse[6]
extern

The number of the congruent simplex that starts at the antipode.

There is exactly one simplex that starts at the antipode corner for every one starting at the anchor corner, in reverse order.