Skip to content

Commit 0137405

Browse files
authored
Add regular sphere with quadrilateral cells (#28)
* use macros in tests * add regular sphere meshed using quads * correct faces of cube * remove print
1 parent 0ed8708 commit 0137405

File tree

5 files changed

+232
-85
lines changed

5 files changed

+232
-85
lines changed

ndelement/examples/lagrange_element.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn main() {
2222
element.tabulate(&points, 0, &mut basis_values);
2323
println!(
2424
"The values of the basis functions at the point (1/3, 1/3) are: {:?}",
25-
basis_values.data()
25+
basis_values.data().unwrap()
2626
);
2727

2828
// Set point to [1, 0]
@@ -32,6 +32,6 @@ fn main() {
3232
element.tabulate(&points, 0, &mut basis_values);
3333
println!(
3434
"The values of the basis functions at the point (1, 0) are: {:?}",
35-
basis_values.data()
35+
basis_values.data().unwrap()
3636
);
3737
}

ndfunctionspace/examples/test_mass_matrix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rlst::{DynArray, rlst_dynamic_array};
1616

1717
/// Test values in Lagrange mass matrix
1818
fn test_lagrange_mass_matrix() {
19-
let grid = regular_sphere(0);
19+
let grid = regular_sphere(0, ReferenceCellType::Triangle);
2020

2121
let family = LagrangeElementFamily::<f64>::new(1, Continuity::Standard);
2222
let space = FunctionSpaceImpl::new(&grid, &family);
@@ -84,7 +84,7 @@ fn test_lagrange_mass_matrix() {
8484

8585
/// Test values in Raviart-Thomas mass matrix
8686
fn test_rt_mass_matrix() {
87-
let grid = regular_sphere(0);
87+
let grid = regular_sphere(0, ReferenceCellType::Triangle);
8888

8989
let family = RaviartThomasElementFamily::<f64>::new(1, Continuity::Standard);
9090
let space = FunctionSpaceImpl::new(&grid, &family);

ndgrid/src/io/gmsh.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,11 @@ mod test {
776776

777777
#[test]
778778
fn test_regular_sphere_gmsh_io() {
779-
let g = regular_sphere::<f64>(2);
779+
let g = regular_sphere::<f64>(2, ReferenceCellType::Triangle);
780780
g.export_as_gmsh("_test_io_sphere.msh");
781+
782+
let g = regular_sphere::<f64>(2, ReferenceCellType::Quadrilateral);
783+
g.export_as_gmsh("_test_io_sphere_quads.msh");
781784
}
782785

783786
#[test]

ndgrid/src/io/ron.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mod test {
4040

4141
#[test]
4242
fn test_ron_export_and_import() {
43-
let g = regular_sphere::<f64>(1);
43+
let g = regular_sphere::<f64>(1, ReferenceCellType::Triangle);
4444
let n = g.entity_count(ReferenceCellType::Interval);
4545
g.export_as_ron("_test_export.ron");
4646

0 commit comments

Comments
 (0)