Skip to content

Commit

Permalink
Use "Standard" not "Continuous"
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Jul 22, 2024
1 parent b43e9ee commit 0cf7eb2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/element_family.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extern crate lapack_src;
fn main() {
// 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::Continuous);
let family = LagrangeElementFamily::<f64>::new(2, Continuity::Standard);

// Get the element in the family on a triangle
let element = family.element(ReferenceCellType::Triangle);
Expand Down
2 changes: 1 addition & 1 deletion examples/lagrange_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern crate lapack_src;

fn main() {
// Create a P2 element on a triangle
let element = lagrange::create::<f64>(ReferenceCellType::Triangle, 2, Continuity::Continuous);
let element = lagrange::create::<f64>(ReferenceCellType::Triangle, 2, Continuity::Standard);

println!("This element has {} basis functions.", element.dim());

Expand Down
38 changes: 18 additions & 20 deletions src/ciarlet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ mod test {

#[test]
fn test_lagrange_1() {
let e = lagrange::create::<f64>(ReferenceCellType::Triangle, 1, Continuity::Continuous);
let e = lagrange::create::<f64>(ReferenceCellType::Triangle, 1, Continuity::Standard);
assert_eq!(e.value_size(), 1);
}

Expand All @@ -370,7 +370,7 @@ mod test {

#[test]
fn test_lagrange_1_interval() {
let e = lagrange::create::<f64>(ReferenceCellType::Interval, 1, Continuity::Continuous);
let e = lagrange::create::<f64>(ReferenceCellType::Interval, 1, Continuity::Standard);
assert_eq!(e.value_size(), 1);
let mut data = rlst_dynamic_array4!(f64, e.tabulate_array_shape(0, 4));
let mut points = rlst_dynamic_array2!(f64, [4, 1]);
Expand Down Expand Up @@ -423,7 +423,7 @@ mod test {

#[test]
fn test_lagrange_1_triangle() {
let e = lagrange::create::<f64>(ReferenceCellType::Triangle, 1, Continuity::Continuous);
let e = lagrange::create::<f64>(ReferenceCellType::Triangle, 1, Continuity::Standard);
assert_eq!(e.value_size(), 1);
let mut data = rlst_dynamic_array4!(f64, e.tabulate_array_shape(0, 6));
let mut points = rlst_dynamic_array2!(f64, [6, 2]);
Expand Down Expand Up @@ -460,10 +460,10 @@ mod test {

#[test]
fn test_lagrange_higher_degree_triangle() {
lagrange::create::<f64>(ReferenceCellType::Triangle, 2, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Triangle, 3, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Triangle, 4, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Triangle, 5, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Triangle, 2, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Triangle, 3, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Triangle, 4, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Triangle, 5, Continuity::Standard);

lagrange::create::<f64>(ReferenceCellType::Triangle, 2, Continuity::Discontinuous);
lagrange::create::<f64>(ReferenceCellType::Triangle, 3, Continuity::Discontinuous);
Expand All @@ -473,10 +473,10 @@ mod test {

#[test]
fn test_lagrange_higher_degree_interval() {
lagrange::create::<f64>(ReferenceCellType::Interval, 2, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Interval, 3, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Interval, 4, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Interval, 5, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Interval, 2, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Interval, 3, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Interval, 4, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Interval, 5, Continuity::Standard);

lagrange::create::<f64>(ReferenceCellType::Interval, 2, Continuity::Discontinuous);
lagrange::create::<f64>(ReferenceCellType::Interval, 3, Continuity::Discontinuous);
Expand All @@ -486,10 +486,10 @@ mod test {

#[test]
fn test_lagrange_higher_degree_quadrilateral() {
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 2, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 3, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 4, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 5, Continuity::Continuous);
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 2, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 3, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 4, Continuity::Standard);
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 5, Continuity::Standard);

lagrange::create::<f64>(
ReferenceCellType::Quadrilateral,
Expand Down Expand Up @@ -545,8 +545,7 @@ mod test {

#[test]
fn test_lagrange_1_quadrilateral() {
let e =
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 1, Continuity::Continuous);
let e = lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 1, Continuity::Standard);
assert_eq!(e.value_size(), 1);
let mut data = rlst_dynamic_array4!(f64, e.tabulate_array_shape(0, 6));
let mut points = rlst_dynamic_array2!(f64, [6, 2]);
Expand Down Expand Up @@ -588,8 +587,7 @@ mod test {

#[test]
fn test_lagrange_2_quadrilateral() {
let e =
lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 2, Continuity::Continuous);
let e = lagrange::create::<f64>(ReferenceCellType::Quadrilateral, 2, Continuity::Standard);
assert_eq!(e.value_size(), 1);
let mut data = rlst_dynamic_array4!(f64, e.tabulate_array_shape(0, 6));
let mut points = rlst_dynamic_array2!(f64, [6, 2]);
Expand Down Expand Up @@ -661,7 +659,7 @@ mod test {

#[test]
fn test_raviart_thomas_1_triangle() {
let e = raviart_thomas::create(ReferenceCellType::Triangle, 1, Continuity::Continuous);
let e = raviart_thomas::create(ReferenceCellType::Triangle, 1, Continuity::Standard);
assert_eq!(e.value_size(), 2);
let mut data = rlst_dynamic_array4!(f64, e.tabulate_array_shape(0, 6));
let mut points = rlst_dynamic_array2!(f64, [6, 2]);
Expand Down
2 changes: 1 addition & 1 deletion src/ciarlet/lagrange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn create<T: RlstScalar + MatrixInverse>(
let entity_counts = reference_cell::entity_counts(cell_type);
let vertices = reference_cell::vertices::<T::Real>(cell_type);
if degree == 0 {
if continuity == Continuity::Continuous {
if continuity == Continuity::Standard {
panic!("Cannot create continuous degree 0 Lagrange element");
}
for (d, counts) in entity_counts.iter().enumerate() {
Expand Down
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub enum Continuity {
/// For some element, this option does not indicate that the values are fully continuous.
/// For example, for Raviart-Thomas elements it only indicates that the normal components
/// are continuous across edges
Continuous = 0,
Standard = 0,
/// The element is discontinuous betweeen cells
Discontinuous = 1,
}
Expand Down

0 comments on commit 0cf7eb2

Please sign in to comment.