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

Generate a conforming triangle mesh from a 2:1 balanced p4est. More...

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

Go to the source code of this file.

Data Structures

struct  p4est_tnodes
 Lookup table structure defining a conforming triangle mesh. More...
 

Macros

#define P4EST_TNODES_SIMPLEX_CORNERS   3
 Number of corners of a simplex.
 
#define P4EST_TNODES_CUBE_SIMPLICES   2
 Number of coarse simplices in a cube.
 

Typedefs

typedef struct p4est_tnodes p4est_tnodes_t
 Lookup table structure defining a conforming triangle 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 p4est_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 p4est_tnodes_quadrant_Q1_simplices (p4est_lnodes_code_t fc, int pc)
 Based on a face code and the parent's id, calculate simplex count.
 
int p4est_tnodes_quadrant_Q2_simplices (p4est_lnodes_code_t fc)
 Based on the face code of an element, calculate contained simplices.
 
p4est_tnodes_t * p4est_tnodes_new_Q1_P1 (p4est_t *p4est, p4est_lnodes_t *lnodes)
 Generate a conforming triangle mesh from a Q1 lnodes structure.
 
p4est_tnodes_t * p4est_tnodes_new_Q2_P1 (p4est_t *p4est, p4est_lnodes_t *lnodes)
 Generate a conforming triangle mesh from a Q2 lnodes structure.
 
p4est_tnodes_t * p4est_tnodes_new_Q2_P1_ind (p4est_t *p4est, p4est_lnodes_t *lnodes)
 Generate a conforming triangle mesh from a Q2 lnodes structure.
 
size_t p4est_tnodes_memory_used (p4est_tnodes_t *tnodes)
 Calculate memory allocated in a tnodes structure.
 
void p4est_tnodes_destroy (p4est_tnodes_t *tnodes)
 Free the memory in a conforming triangle mesh structure.
 

Variables

const int p4est_tnodes_simplex_reverse [2]
 The number of the congruent simplex that starts at the antipode.
 

Detailed Description

Generate a conforming triangle mesh from a 2:1 balanced p4est.

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

Please see a textual overview under Conforming simplex export.

Typedef Documentation

◆ p4est_tnodes_t

typedef struct p4est_tnodes p4est_tnodes_t

Lookup table structure defining a conforming triangle mesh.

Trying to conform to latest status of paper repository:

7c96f3bbefad364e3fa657272bca757d13d82a82
d43b2e54f939b186ef765c65638fde2fe792aa55
6bc25f04355eef8d73ec53bdcf6f5915a5748559
711e76748721665bdebb3d5f0bfd53dbd1702a8e

In the meantime, we have added a Q2 recursive bisection construction that works in both 2D and 3D and is identical to a Q2-via-Q1 method. Starting a fresh paper repository for the latest writeup:

6db206b36bcbc3f602bfce39ef03756b9cc2c845
63402d42f575eab6b201206e089fcb05e538da80
3ebb195e4cefebdb993b3f30f28603e7dbd277b0
2ec5cf52f7da2159aa983e6c34ffb3e1c13f741b

Function Documentation

◆ p4est_tnodes_destroy()

void p4est_tnodes_destroy ( p4est_tnodes_t *  tnodes)

Free the memory in a conforming triangle mesh structure.

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

◆ p4est_tnodes_memory_used()

size_t p4est_tnodes_memory_used ( p4est_tnodes_t *  tnodes)

Calculate memory allocated in a tnodes structure.

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

◆ p4est_tnodes_new_Q1_P1()

p4est_tnodes_t * p4est_tnodes_new_Q1_P1 ( p4est_t *  p4est,
p4est_lnodes_t *  lnodes 
)

Generate a conforming triangle 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 triangle mesh. Each triangle overlaps one or more elements. It is assigned to exactly one of their owner processes. The triangles are right-handed with respect to the tree coordinate system containing their element.

◆ p4est_tnodes_new_Q2_P1()

p4est_tnodes_t * p4est_tnodes_new_Q2_P1 ( p4est_t *  p4est,
p4est_lnodes_t *  lnodes 
)

Generate a conforming triangle 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 triangle mesh. Each triangle is contained in exactly one process. The triangles are right-handed with respect to the tree coordinate system containing their element.

◆ p4est_tnodes_new_Q2_P1_ind()

p4est_tnodes_t * p4est_tnodes_new_Q2_P1_ind ( p4est_t *  p4est,
p4est_lnodes_t *  lnodes 
)

Generate a conforming triangle mesh from a Q2 lnodes structure.

This function uses a method distinct from p4est_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 triangle mesh. Each triangle is contained in exactly one process. The triangles are right-handed with respect to the tree coordinate system containing their element.

◆ p4est_tnodes_quadrant_Q1_simplices()

int p4est_tnodes_quadrant_Q1_simplices ( p4est_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 p4est_lnodes.h.
[in]pcChild id of quadrant's parent.
Returns
Element simplex count between 1 and 2 inclusive.

◆ p4est_tnodes_quadrant_Q2_simplices()

int p4est_tnodes_quadrant_Q2_simplices ( p4est_lnodes_code_t  fc)

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

Parameters
[in]fcValid face code as defined in p4est_lnodes.h.
Returns
Element simplex count between 6 and 8 inclusive.

◆ 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, 4).
[in]cChild id of child element in [0, 4).
[in]kNumber of simplex in [0, 2) within child. return Number of simplex in [0, 2) within parent.

◆ p4est_tnodes_simplex_parent_is_valid()

int p4est_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, 4).
[in]kpNumber of simplex in [0, 2) within parent.
[in]cNumber of child element in [0, 4).
[in]kcNumber of simplex in [0, 2) within child.
Returns
True if contained, false if not.

Variable Documentation

◆ p4est_tnodes_simplex_reverse

const int p4est_tnodes_simplex_reverse[2]
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.