OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
utils.hpp
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 <utility>
10#include <xtensor/containers/xarray.hpp>
11#include <xtensor/core/xtensor_forward.hpp>
12
13namespace oiseau::dg::nodal::utils {
14
22std::pair<xt::xarray<double>, xt::xarray<double>> jacobi_gq(unsigned n, double alpha, double beta);
23
31xt::xarray<double> jacobi_gl(unsigned n, double alpha, double beta);
32
33xt::xarray<double> d_matrix_1d(const xt::xarray<double> &v, const xt::xarray<double> &gv);
34xt::xarray<double> d_matrix_1d(unsigned n, const xt::xarray<double> &r);
35
42xt::xarray<double> vandermonde_1d(unsigned n, const xt::xarray<double> &r);
43xt::xarray<double> grad_vandermonde_1d(unsigned n, const xt::xarray<double> &r);
44
45xt::xarray<double> d_matrix_2d(const xt::xarray<double> &v, const xt::xarray<double> &gv);
46xt::xarray<double> vandermonde_2d(unsigned n, const xt::xarray<double> &rs);
47xt::xarray<double> vandermonde_2d_tensor(unsigned n, const xt::xarray<double> &rs);
48xt::xarray<double> grad_vandermonde_2d(unsigned n, const xt::xarray<double> &rs);
49xt::xarray<double> grad_vandermonde_2d_tensor(unsigned n, const xt::xarray<double> &rs);
50
51xt::xarray<double> simplexp_2d(const xt::xarray<double> &ab, int i, int j);
52xt::xarray<double> tensorp_2d(const xt::xarray<double> &rs, int i, int j);
53xt::xarray<double> grad_simplexp_2d(const xt::xarray<double> &ab, int i, int j);
54xt::xarray<double> grad_tensorp_2d(const xt::xarray<double> &rs, int i, int j);
55
56xt::xarray<double> generate_triangle_equidistant_nodes(unsigned n);
57xt::xarray<double> warp_factor(unsigned n, const xt::xarray<double> &rout);
58xt::xarray<double> conversion_equilateral_xy_to_rs(const xt::xarray<double> &coords);
59xt::xarray<double> conversion_rs_to_ab(const xt::xarray<double> &rs);
60xt::xarray<double> generate_triangle_nodes(unsigned n);
61xt::xarray<double> generate_tetrahedron_equidistant_nodes(unsigned n);
62xt::xarray<double> generate_quadrilateral_nodes(unsigned n);
63xt::xarray<double> generate_hexahedron_nodes(unsigned n);
64xt::xarray<double> eval_warp(int p, const xt::xarray<double> &xnodes,
65 const xt::xarray<double> &xout);
66xt::xarray<double> eval_shift(int p, double pval, const xt::xarray<double> &l1,
67 const xt::xarray<double> &l2, const xt::xarray<double> &l3);
68xt::xarray<double> generate_tetrahedron_nodes(unsigned n);
69xt::xarray<double> warp_shift_face_3d(int p, double pval, double pval2,
70 const xt::xarray<double> &l1, const xt::xarray<double> &l2,
71 const xt::xarray<double> &l3, const xt::xarray<double> &l4);
72xt::xarray<double> conversion_equilateral_xyz_to_rst(const xt::xarray<double> &coords);
73xt::xarray<double> conversion_rst_to_abc(const xt::xarray<double> &rst);
74
75xt::xarray<double> d_matrix_3d(const xt::xarray<double> &v, const xt::xarray<double> &gv);
76xt::xarray<double> vandermonde_3d(unsigned n, const xt::xarray<double> &rst);
77xt::xarray<double> vandermonde_3d_tensor(unsigned n, const xt::xarray<double> &rst);
78xt::xarray<double> grad_simplexp_3d(const xt::xarray<double> &abc, int i, int j, int k);
79xt::xarray<double> grad_tensorp_3d(const xt::xarray<double> &rst, int i, int j, int k);
80xt::xarray<double> grad_vandermonde_3d(unsigned n, const xt::xarray<double> &rst);
81xt::xarray<double> grad_vandermonde_3d_tensor(unsigned n, const xt::xarray<double> &rst);
82
83xt::xarray<double> simplexp_3d(const xt::xarray<double> &abc, int i, int j, int k);
84xt::xarray<double> tensorp_3d(const xt::xarray<double> &abc, int i, int j, int k);
85
86} // namespace oiseau::dg::nodal::utils