OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
ref_tetrahedron.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#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 xt::xarray<double> basis_function(const xt::xarray<double> &rst, int i, int j, int k) const;
58
71 xt::xarray<double> grad_basis_function(const xt::xarray<double> &rst, int i, int j, int k) const;
72
73 private:
84 xt::xarray<double> vandermonde(const xt::xarray<double> &rst) const;
85
97 xt::xarray<double> grad_vandermonde(const xt::xarray<double> &rst) const;
98
113 xt::xarray<double> grad_operator(const xt::xarray<double> &v, const xt::xarray<double> &gv) const;
114};
115
116namespace detail {
117
129xt::xarray<double> equilateral_xyz_to_rst(const xt::xarray<double> &coords);
130
145xt::xarray<double> rst_to_abc(const xt::xarray<double> &rst);
146
156xt::xarray<double> generate_tetrahedron_nodes(unsigned p);
157
168xt::xarray<double> generate_tetrahedron_equidistant_nodes(unsigned n);
169
185xt::xarray<double> warp_shift_face_3d(int p, double pval, const xt::xarray<double> &l2,
186 const xt::xarray<double> &l3, const xt::xarray<double> &l4);
201xt::xarray<double> eval_shift(int p, double pval, const xt::xarray<double> &l1,
202 const xt::xarray<double> &l2, const xt::xarray<double> &l3);
217xt::xarray<double> eval_warp(int p, const xt::xarray<double> &xnodes,
218 const xt::xarray<double> &xout);
219
220} // namespace detail
221
222} // namespace oiseau::dg::nodal
xt::xarray< double > grad_basis_function(const xt::xarray< double > &rst, int i, int j, int k) const
Computes the gradient of a 3D basis function on the reference tetrahedron.
Definition ref_tetrahedron.cpp:49
RefTetrahedron(unsigned order)
Constructs a RefTetrahedron object of a specific polynomial order.
Definition ref_tetrahedron.cpp:29
xt::xarray< double > basis_function(const xt::xarray< double > &rst, int i, int j, int k) const
Evaluates a 3D basis function on the reference tetrahedron.
Definition ref_tetrahedron.cpp:38