element_family/
element_family.rs

1use ndelement::ciarlet::LagrangeElementFamily;
2use ndelement::traits::{ElementFamily, FiniteElement};
3use ndelement::types::{Continuity, ReferenceCellType};
4
5fn main() {
6    // Create the degree 2 Lagrange element family. A family is a set of finite elements with the
7    // same family type, degree, and continuity across a set of cells
8    let family = LagrangeElementFamily::<f64, f64>::new(2, Continuity::Standard);
9
10    // Get the element in the family on a triangle
11    let element = family.element(ReferenceCellType::Triangle);
12    println!("Cell: {:?}", element.cell_type());
13
14    // Get the element in the family on a quadrilateral
15    let element = family.element(ReferenceCellType::Quadrilateral);
16    println!("Cell: {:?}", element.cell_type());
17}