OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
ref_tetrahedron.hpp
Go to the documentation of this file.
1// Copyright (C) 2026 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#include <xtensor/core/xtensor_forward.hpp>
9
10#include "oiseau/dg/nodal/ref_element.hpp"
11
20
21namespace oiseau::dg::nodal {
22
32class RefTetrahedron : public RefElement {
33 public:
40 explicit RefTetrahedron(unsigned order);
41
57 static xt::xarray<double> basis_function(const xt::xarray<double>& rst, int i, int j, int k);
58
71 static xt::xarray<double> grad_basis_function(const xt::xarray<double>& rst, int i, int j, int k);
72
73 private:
84 xt::xarray<double> vandermonde(const xt::xarray<double>& rst) const override;
85
97 xt::xarray<double> grad_vandermonde(const xt::xarray<double>& rst) const;
98
113 static xt::xarray<double> grad_operator(const xt::xarray<double>& v,
114 const xt::xarray<double>& gv);
115};
116
117namespace detail {
118
130xt::xarray<double> equilateral_xyz_to_rst(const xt::xarray<double>& coords);
131
146xt::xarray<double> rst_to_abc(const xt::xarray<double>& rst);
147
157xt::xarray<double> generate_tetrahedron_nodes(unsigned p);
158
169xt::xarray<double> generate_tetrahedron_equidistant_nodes(unsigned n);
170
186xt::xarray<double> warp_shift_face_3d(int p, double pval, const xt::xarray<double>& l2,
187 const xt::xarray<double>& l3, const xt::xarray<double>& l4);
202xt::xarray<double> eval_shift(int p, double pval, const xt::xarray<double>& l1,
203 const xt::xarray<double>& l2, const xt::xarray<double>& l3);
218xt::xarray<double> eval_warp(int p, const xt::xarray<double>& xnodes,
219 const xt::xarray<double>& xout);
220
221} // namespace detail
222
223} // namespace oiseau::dg::nodal
static xt::xarray< double > grad_basis_function(const xt::xarray< double > &rst, int i, int j, int k)
Computes the gradient of a 3D basis function on the reference tetrahedron.
Definition ref_tetrahedron.cpp:49
static xt::xarray< double > basis_function(const xt::xarray< double > &rst, int i, int j, int k)
Evaluates a 3D basis function on the reference tetrahedron.
Definition ref_tetrahedron.cpp:38
RefTetrahedron(unsigned order)
Constructs a RefTetrahedron object of a specific polynomial order.
Definition ref_tetrahedron.cpp:29