Skip to content

Commit

Permalink
Add Tet20 to Poisson convergence tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andlon committed Sep 7, 2023
1 parent d69cf21 commit 9609a73
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
16 changes: 11 additions & 5 deletions notebooks/convergence/Poisson_MMS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"fig = prepare_convergence_plot(summaries_2d, error_type='H1_seminorm')\n",
"draw_convergence_line(fig.gca(), p=1, x0=0.25, y0=1.0, label_xoffset = -0.1)\n",
"draw_convergence_line(fig.gca(), p=2, x0=0.25, y0=2e-2, label_xoffset = 0.1)\n",
"plt.show(fig)\n"
"plt.show(fig)"
]
},
{
Expand All @@ -147,7 +147,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"def summary_key_3d(summary):\n",
Expand All @@ -162,20 +164,24 @@
" return 4\n",
" elif element == 'Hex27':\n",
" return 5\n",
" elif element == 'Tet20':\n",
" return 6\n",
" return 3\n",
" \n",
"data_folder_3d = os.path.join(data_folder, \"poisson_3d_mms\")\n",
"# Sort summaries according to order in plot\n",
"summaries_3d = sorted(load_summaries(data_folder_3d), key = summary_key_3d)\n",
"\n",
"fig = prepare_convergence_plot(summaries_3d, error_type='L2')\n",
"draw_convergence_line(fig.gca(), p=3, x0=0.25, y0=2e-4, label_xoffset = 0.1)\n",
"draw_convergence_line(fig.gca(), p=3, x0=0.25, y0=2e-4, label_xoffset = 0.025)\n",
"draw_convergence_line(fig.gca(), p=2, x0=0.25, y0=2e-2, label_xoffset = -0.06)\n",
"draw_convergence_line(fig.gca(), p=4, x0=0.25, y0=2e-5, label_xoffset = -0.06)\n",
"plt.show(fig)\n",
"\n",
"fig = prepare_convergence_plot(summaries_3d, error_type='H1_seminorm')\n",
"draw_convergence_line(fig.gca(), p=1, x0=0.25, y0=0.5, label_xoffset = -0.1)\n",
"draw_convergence_line(fig.gca(), p=2, x0=0.25, y0=1e-2, label_xoffset = 0.1)\n",
"draw_convergence_line(fig.gca(), p=2, x0=0.25, y0=1e-2, label_xoffset = 0.025)\n",
"draw_convergence_line(fig.gca(), p=3, x0=0.25, y0=2e-3, label_xoffset = -0.06)\n",
"plt.show(fig)"
]
},
Expand Down Expand Up @@ -210,7 +216,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.11.0"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions tests/convergence_tests/poisson_3d_mms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn poisson_3d_tet4() {

#[test]
fn poisson_3d_tet10() {
let resolutions = [1, 2, 4, 8];
let resolutions = [1, 2, 4, 8, 12];
let mesh_producer = |res| Tet10Mesh::from(&create_unit_box_uniform_tet_mesh_3d(res));
// TODO: Use "correct" quadrature
let quadrature = quadrature::total_order::tetrahedron(2).unwrap();
Expand All @@ -129,7 +129,7 @@ fn poisson_3d_tet10() {

#[test]
fn poisson_3d_tet20() {
let resolutions = [1, 2, 4, 6];
let resolutions = [1, 2, 4, 6, 8, 12];
let mesh_producer = |res| Tet20Mesh::from(&create_unit_box_uniform_tet_mesh_3d(res));
// TODO: Use "correct" quadrature
let quadrature = quadrature::total_order::tetrahedron(4).unwrap();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"element_name": "Tet20",
"L2_errors": [
0.012361276300542956,
0.001509168514155594,
0.00007103909496921032,
0.000012701774471002328,
3.7865348231681897e-6,
6.98971864504528e-7
],
"H1_seminorm_errors": [
0.22706854268845975,
0.04924709368992659,
0.0050160118594366745,
0.001390799921766539,
0.0005639142794850233,
0.00015975072103506234
],
"resolutions": [
1.4142135623730951,
0.7071067811865476,
0.3535533905932738,
0.23570226039551595,
0.1767766952966369,
0.11785113019775798
]
}

0 comments on commit 9609a73

Please sign in to comment.