OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
ref_triangle.hpp File Reference

Defines the reference triangle element used in nodal Discontinuous Galerkin methods. More...

#include "oiseau/dg/nodal/ref_element.hpp"
#include "xtensor/core/xtensor_forward.hpp"

Go to the source code of this file.

Classes

class  oiseau::dg::nodal::RefTriangle
 Represents a reference triangular element for nodal Discontinuous Galerkin methods. More...

Functions

xt::xarray< double > oiseau::dg::nodal::detail::rs_to_ab (const xt::xarray< double > &rs)
 Converts (r, s) coordinates to collapsed (a, b) coordinates for the triangle.
xt::xarray< double > oiseau::dg::nodal::detail::generate_triangle_nodes (unsigned order)
 Generates nodal points on an equilateral triangle via Warp & Blend.
xt::xarray< double > oiseau::dg::nodal::detail::equilateral_xy_to_rs (const xt::xarray< double > &xy)
 Maps equilateral triangle (x, y) to reference (r, s) coordinates.
xt::xarray< double > oiseau::dg::nodal::detail::warp_factor (unsigned order, const xt::xarray< double > &rs)
 Computes 1D warp factor for node distribution on triangle edges.

Detailed Description

Defines the reference triangle element used in nodal Discontinuous Galerkin methods.

This file contains the declaration of the RefTriangle class, which represents a reference triangular element, and associated internal helper functions in the detail namespace for generating nodes, basis functions, and performing coordinate transformations.

ASCII representation of the reference triangle node numbering (order=4):

(14) | \ (12) (13) | \ (9) (10) (11) | \ (5) (6) (7) (8) | \ (0)–(1)–(2)–(3)–(4)

Function Documentation

◆ equilateral_xy_to_rs()

xt::xarray< double > oiseau::dg::nodal::detail::equilateral_xy_to_rs ( const xt::xarray< double > & xy)

Maps equilateral triangle (x, y) to reference (r, s) coordinates.

Parameters
xy2D array (N_points × 2) of equilateral (x, y).
Returns
2D array (N_points × 2) of reference (r, s).

◆ generate_triangle_nodes()

xt::xarray< double > oiseau::dg::nodal::detail::generate_triangle_nodes ( unsigned order)

Generates nodal points on an equilateral triangle via Warp & Blend.

The result is then mapped to the (r, s) reference triangle.

Parameters
orderPolynomial order (number of points = (order+1)*(order+2)/2).
Returns
2D array (N_points × 2) of (x, y) on the equilateral triangle.

◆ rs_to_ab()

xt::xarray< double > oiseau::dg::nodal::detail::rs_to_ab ( const xt::xarray< double > & rs)

Converts (r, s) coordinates to collapsed (a, b) coordinates for the triangle.

a = 2*(1+r)/(1-s) - 1, b = s; with special handling when s == 1.

Parameters
rs2D array (shape: N_points × 2) of (r, s) coordinates.
Returns
2D array (shape: N_points × 2) of (a, b) coordinates.

◆ warp_factor()

xt::xarray< double > oiseau::dg::nodal::detail::warp_factor ( unsigned order,
const xt::xarray< double > & rs )

Computes 1D warp factor for node distribution on triangle edges.

Parameters
orderPolynomial order.
rs1D array (length = order+1) of coordinates along an edge.
Returns
1D array (length = order+1) of warp offsets.