OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
ref_triangle.hpp
Go to the documentation of this file.
1// Copyright (C) 2025 Tiago V. L. Amorim (@tiagovla)
2//
3// This file is part of oiseau (https://github.com/tiagovla/oiseau)
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6
7#pragma once
8
9#include "oiseau/dg/nodal/ref_element.hpp"
10#include "xtensor/core/xtensor_forward.hpp"
11
32
33namespace oiseau::dg::nodal {
34
44class RefTriangle : public RefElement {
45 public:
51 explicit RefTriangle(unsigned order);
52
66 static xt::xarray<double> basis_function(const xt::xarray<double>& ab, int i, int j);
67
79 static xt::xarray<double> grad_basis_function(const xt::xarray<double>& ab, int i, int j);
80
81 private:
91 xt::xarray<double> vandermonde(const xt::xarray<double>& rs) const;
92
99 xt::xarray<double> grad_vandermonde(const xt::xarray<double>& rs) const;
100
112 xt::xarray<double> grad_operator(const xt::xarray<double>& v, const xt::xarray<double>& gv) const;
113};
114
115namespace detail {
116
125xt::xarray<double> rs_to_ab(const xt::xarray<double>& rs);
126
135xt::xarray<double> generate_triangle_nodes(unsigned order);
136
143xt::xarray<double> equilateral_xy_to_rs(const xt::xarray<double>& xy);
144
152xt::xarray<double> warp_factor(unsigned order, const xt::xarray<double>& rs);
153
154} // namespace detail
155} // namespace oiseau::dg::nodal
RefTriangle(unsigned order)
Constructs a RefTriangle object of a specific polynomial order.
Definition ref_triangle.cpp:29
static xt::xarray< double > basis_function(const xt::xarray< double > &ab, int i, int j)
Static member function that evaluates a 2D orthonormal basis function on the reference triangle in co...
Definition ref_triangle.cpp:38
static xt::xarray< double > grad_basis_function(const xt::xarray< double > &ab, int i, int j)
Static member function that computes the gradient of a 2D orthonormal basis function on the reference...
Definition ref_triangle.cpp:46