Skip to content

t8_time_fractal.cxx

Prasanna Ponnusamy edited this page Jul 1, 2025 · 1 revision

t8_time_fractal

Overview

t8_time_fractal is a benchmarking and visualization tool included in the t8code adaptive mesh refinement (AMR) library. It generates fractal-like meshes using various element types (e.g., triangles, quadrilaterals, hexahedra) and supports both 2D and 3D configurations.

The tool is valuable for:

  • Evaluating AMR performance.
  • Visualizing refinement patterns.
  • Testing recursive and iterative refinement strategies.

Usage

The basic syntax for running t8_time_fractal is:

./t8_time_fractal [OPTIONS]

Options

Option(s) Argument(s) Description Values/Defaults
-h, --help Display help message
-u, --uniform_level INT Initial uniform refinement level (must be even and > 0 for quads/hexahedra)
-f, --final_level INT Final refinement level (must be greater than -u)
-e, --elements INT Element type: 2: Quadrilateral
3: Triangle
4: Hexahedron (default)
5: Tetrahedron
6: Prism
7: Pyramid
-r, --runs INT Number of fractal construction iterations Default: 1
-i, --iterative INT Refinement method: 0: Recursive (default)
1: Iterative
-d, --delete INT Element deletion after refinement: 0: Never delete
1: Delete elements (default)
-t, --trees INT Number of trees in the forest (must be 1 if -o 1 is set) Default: 512
-o, --output INT Output mesh: 0: No visual output (default)
1: Visual output (VTK)
-c, --coarse INT Number of coarsening steps applied to holes

Constraints

  • For quadrilateral and hexahedral elements (-e 2 or -e 4), both -u and -f must be even numbers greater than 0.
  • If visual output is enabled (-o 1), the number of trees (-t) must be set to 1.

Examples

1. Basic Quadrilateral Mesh with Visual Output

./t8_time_fractal -u 2 -f 4 -e 2 -r 1 -o 1 -t 1

Generates a quadrilateral mesh with:

  • -u 2: Starts with a 2-level uniformly refined square mesh.
  • -f 4: Refines to level 4 (higher resolution).
  • -e 2: Uses quadrilateral elements (squares).
  • -r 1: Applies the fractal hole-cutting process once.
  • -o 1 & -t 1: Enables VTK visual output for a single tree (a single, centered structure). fractal1

2. Triangle Mesh with Iterative Refinement and Deletion

./t8_time_fractal -u 2 -f 4 -e 3 -i 1 -r 2 -d 1 -o 1 -t 1
  • -u 2: Start with uniform refinement level 2.
  • -f 4: Refine up to level 4.
  • -e 3: Use triangle elements.
  • -i 1: Use iterative (not recursive) refinement.
  • -r 2: Apply two fractal refinement passes.
  • -d 1: Delete elements during fractal pattern creation.
  • -o 1 -t 1: Output to VTK file (requires only 1 tree).

fractal2

Creates a triangular mesh using one iterative refinement pass, where elements are deleted according to a fractal pattern. The resulting mesh is written to a .vtu file for visualization (requires one tree).


Output

If visual output is enabled (-o 1), the program generates a VTK file (e.g., output.vtu) that can be opened with visualization tools like ParaView to inspect the mesh structure and refinement patterns.


Troubleshooting

  • Invalid Option or Missing Argument:
    Ensure all options are provided with the required arguments. For example, -r must be followed by an integer.

  • Refinement Level Errors:
    For quadrilateral and hexahedral elements, both -u and -f must be even numbers greater than 0, with -f greater than -u.

  • Visual Output Constraints:
    When enabling visual output (-o 1), set the number of trees (-t) to 1.

Clone this wiki locally