1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! A library for defining and tabulating finite elements on 1D, 2D, or 3D reference cells.
//!
//! `ndelement` provides definition of many frequently used low and high order finite elements
//! and provides routines for the tabulation of their values.
//!
//! The following presents a simple example of how to use `ndelement`.
//!
//! ```
//! use ndelement::ciarlet::{LagrangeElementFamily, LagrangeVariant};
//! use ndelement::traits::{ElementFamily, FiniteElement};
//! use ndelement::types::{Continuity, ReferenceCellType};
//! use rlst::DynArray;
//!
//! // Create the degree 2 Lagrange element family. A family is a set of finite elements with the
//! // same family type, degree, and continuity across a set of cells
//! let family = LagrangeElementFamily::<f64>::new(2, Continuity::Standard, LagrangeVariant::Equispaced);
//!
//! // Get the element in the family on a triangle
//! let element = family.element(ReferenceCellType::Triangle);
//! println!("Cell: {:?}", element.cell_type());
//!
//! // Get the element in the family on a quadrilateral
//! let element = family.element(ReferenceCellType::Quadrilateral);
//! println!("Cell: {:?}", element.cell_type());
//!
//! // Create an array to store the basis function values
//! let mut basis_values = DynArray::<f64, 4>::from_shape(element.tabulate_array_shape(0, 1));
//! // Create array containing the point [1/2, 1/2]
//! let mut points = DynArray::<f64, 2>::from_shape([2, 1]);
//! points[[0, 0]] = 1.0 / 2.0;
//! points[[1, 0]] = 1.0 / 2.0;
//! // Tabulate the element's basis functions at the point
//! element.tabulate(&points, 0, &mut basis_values);
//! println!(
//! "The values of the basis functions at the point (1/2, 1/2) are: {:?}",
//! basis_values.data()
//! );
//! ```
use openblas_src as _;