OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
ref_line.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 <xtensor/core/xtensor_forward.hpp>
10
11#include "oiseau/dg/nodal/ref_element.hpp"
12
13namespace oiseau::dg::nodal {
14
31class RefLine : public RefElement {
32 public:
37 explicit RefLine(unsigned order);
38
45 static xt::xarray<double> basis_function(const xt::xarray<double>& r, int i);
46
54 static xt::xarray<double> grad_basis_function(const xt::xarray<double>& r, int i);
55
56 private:
62 xt::xarray<double> vandermonde(const xt::xarray<double>& r) const;
63
69 xt::xarray<double> grad_vandermonde(const xt::xarray<double>& r) const;
70
77 xt::xarray<double> grad_operator(const xt::xarray<double>& v, const xt::xarray<double>& gv) const;
78};
79
80namespace detail {
81
91xt::xarray<double> generate_line_nodes(unsigned order);
92
93} // namespace detail
94} // namespace oiseau::dg::nodal
static xt::xarray< double > basis_function(const xt::xarray< double > &r, int i)
Evaluates the i-th Lagrange basis function at the given reference points.
Definition ref_line.cpp:33
static xt::xarray< double > grad_basis_function(const xt::xarray< double > &r, int i)
Evaluates the gradient of the i-th Lagrange basis function at the given reference points.
Definition ref_line.cpp:37
RefLine(unsigned order)
Constructs a RefLine element of the given polynomial order.
Definition ref_line.cpp:24