4#ifndef SVMP_FE_BASIS_LAGRANGEBASIS_H
5#define SVMP_FE_BASIS_LAGRANGEBASIS_H
7#include "BasisFunction.h"
14namespace svmp::FE::basis {
179 int dimension() const noexcept final {
return dimension_; }
182 int order() const noexcept final {
return order_; }
185 std::size_t
size() const noexcept final {
return nodes_.size(); }
196 const std::vector<math::Vector<double, 3>>&
nodes() const noexcept final {
return nodes_; }
209 std::span<double> values_out)
const final;
221 std::span<Gradient> gradients_out)
const final;
233 std::span<Hessian> hessians_out)
const final;
249 std::vector<double> nodes_1d_;
250 std::vector<double> nodes_1d_weights_;
251 std::vector<math::Vector<double, 3>> nodes_;
252 std::vector<TensorNodeIndex> tensor_indices_;
253 std::vector<SimplexExponent> simplex_exponents_;
254 std::vector<WedgeNodeIndex> wedge_indices_;
257 void build_point_nodes();
258 void build_tensor_product_nodes();
259 void build_simplex_nodes();
260 void build_wedge_nodes();
261 void init_tensor_axis_nodes();
263 void evaluate_all_to(
const math::Vector<double, 3>& xi,
264 std::span<double> values_out,
265 std::span<Gradient> gradients_out,
266 std::span<Hessian> hessians_out)
const override;
267 void evaluate_point_to(std::span<double> values_out,
268 std::span<Gradient> gradients_out,
269 std::span<Hessian> hessians_out)
const;
270 void evaluate_tensor_product_to(
const math::Vector<double, 3>& xi,
271 std::span<double> values_out,
272 std::span<Gradient> gradients_out,
273 std::span<Hessian> hessians_out)
const;
274 void evaluate_simplex_to(
const math::Vector<double, 3>& xi,
275 std::span<double> values_out,
276 std::span<Gradient> gradients_out,
277 std::span<Hessian> hessians_out)
const;
278 void evaluate_wedge_to(
const math::Vector<double, 3>& xi,
279 std::span<double> values_out,
280 std::span<Gradient> gradients_out,
281 std::span<Hessian> hessians_out)
const;
Reference-topology vocabulary (BasisTopology) and the internal ElementType/topology/order maps.
Abstract interface for finite-element basis-function families.
Definition BasisFunction.h:166
Nodal Lagrange basis on supported reference finite elements.
Definition LagrangeBasis.h:105
std::size_t size() const noexcept final
Return the number of basis functions and reference nodes.
Definition LagrangeBasis.h:185
int order() const noexcept final
Return the polynomial order represented by this basis.
Definition LagrangeBasis.h:182
std::array< int, 4 > SimplexExponent
Barycentric exponent tuple for simplex reference nodes.
Definition LagrangeBasis.h:111
int dimension() const noexcept final
Return the reference-space dimension of the basis.
Definition LagrangeBasis.h:179
std::array< std::size_t, 3 > TensorNodeIndex
Axis-index tuple for tensor-product reference nodes.
Definition LagrangeBasis.h:108
void evaluate_values_to(const math::Vector< double, 3 > &xi, std::span< double > values_out) const final
Evaluate Lagrange basis values into caller-provided storage.
Definition LagrangeBasis.cpp:578
BasisTopology topology() const noexcept final
Return the reference topology of this basis.
Definition LagrangeBasis.h:176
std::array< std::size_t, 2 > WedgeNodeIndex
Triangle-node and axis-node tuple for wedge reference nodes.
Definition LagrangeBasis.h:114
void evaluate_gradients_to(const math::Vector< double, 3 > &xi, std::span< Gradient > gradients_out) const final
Evaluate Lagrange basis gradients into caller-provided storage.
Definition LagrangeBasis.cpp:584
BasisType basis_type() const noexcept final
Return the concrete basis family.
Definition LagrangeBasis.h:173
void evaluate_hessians_to(const math::Vector< double, 3 > &xi, std::span< Hessian > hessians_out) const final
Evaluate Lagrange basis Hessians into caller-provided storage.
Definition LagrangeBasis.cpp:590
const std::vector< math::Vector< double, 3 > > & nodes() const noexcept final
Return the reference interpolation nodes in basis ordering.
Definition LagrangeBasis.h:196
BasisTopology
Reference-cell topology of a basis (the shape, independent of order).
Definition BasisTraits.h:28
@ Unknown
Unrecognized or uninitialized topology.
BasisType
Basis function families.
Definition Types.h:247
ElementType
Reference element types supported by the FE library.
Definition Types.h:215
@ Lagrange
Standard nodal Lagrange basis.
Eigen::Matrix< T, static_cast< int >(N), 1 > Vector
Fixed-size column vector for element-level computations.
Definition Vector.h:51