-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
construct higher degree elements in example run, not test (#68)
* construct higher degree elements in example run, not test * update version numbers
- Loading branch information
Showing
7 changed files
with
65 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ default = ["sleef"] | |
|
||
[package] | ||
name = "ndelement" | ||
version = "0.2.0-dev" | ||
version = "0.2.1" | ||
edition = "2021" | ||
authors = ["Matthew Scroggs <[email protected]>"] | ||
description = "n-dimensional finite element definition library." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
//! Finite element definitions | ||
use ndelement::ciarlet::{lagrange, nedelec, raviart_thomas}; | ||
use ndelement::types::{Continuity, ReferenceCellType}; | ||
use paste::paste; | ||
|
||
fn main() { | ||
macro_rules! construct_lagrange { | ||
($cell:ident, $max_degree:expr) => { | ||
paste! { | ||
for d in 1..[<$max_degree>] { | ||
println!("Constructing Lagrange(degree={d}, cell={:?})", ReferenceCellType::[<$cell>]); | ||
let _e = lagrange::create::<f64>(ReferenceCellType::[<$cell>], d, Continuity::Standard); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
macro_rules! construct_raviart_thomas { | ||
($cell:ident, $max_degree:expr) => { | ||
paste! { | ||
for d in 1..[<$max_degree>] { | ||
println!("Constructing RaviartThomas(degree={d}, cell={:?})", ReferenceCellType::[<$cell>]); | ||
let _e = raviart_thomas::create::<f64>(ReferenceCellType::[<$cell>], d, Continuity::Standard); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
macro_rules! construct_nedelec { | ||
($cell:ident, $max_degree:expr) => { | ||
paste! { | ||
for d in 1..[<$max_degree>] { | ||
println!("Constructing Nedelec(degree={d}, cell={:?})", ReferenceCellType::[<$cell>]); | ||
let _e = nedelec::create::<f64>(ReferenceCellType::[<$cell>], d, Continuity::Standard); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
construct_lagrange!(Interval, 14); | ||
construct_lagrange!(Triangle, 8); | ||
construct_lagrange!(Quadrilateral, 8); | ||
construct_lagrange!(Tetrahedron, 6); | ||
construct_lagrange!(Hexahedron, 6); | ||
|
||
construct_raviart_thomas!(Triangle, 8); | ||
construct_raviart_thomas!(Quadrilateral, 8); | ||
construct_raviart_thomas!(Tetrahedron, 6); | ||
construct_raviart_thomas!(Hexahedron, 6); | ||
|
||
construct_nedelec!(Triangle, 8); | ||
construct_nedelec!(Quadrilateral, 8); | ||
construct_nedelec!(Tetrahedron, 6); | ||
construct_nedelec!(Hexahedron, 6); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters