From d8e6a295a405d7434c889047710fabf9430683fd Mon Sep 17 00:00:00 2001 From: Niklas Date: Tue, 22 Oct 2024 20:11:04 +0200 Subject: [PATCH 1/4] revert changes --- perpendicular-flap/solid-fenics/solid.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/perpendicular-flap/solid-fenics/solid.py b/perpendicular-flap/solid-fenics/solid.py index 20d3e1f07..dc07af7cc 100644 --- a/perpendicular-flap/solid-fenics/solid.py +++ b/perpendicular-flap/solid-fenics/solid.py @@ -158,14 +158,16 @@ def update_v(a, u_old, v_old, a_old, ufl=True): def update_fields(u, u_old, v_old, a_old): """Update all fields at the end of a timestep.""" + u_vec, u0_vec = u.vector(), u_old.vector() + v0_vec, a0_vec = v_old.vector(), a_old.vector() + # call update functions - a_new = update_a(u, u_old, v_old, a_old) - v_new = update_v(u, u_old, v_old, a_old) + a_vec = update_a(u_vec, u0_vec, v0_vec, a0_vec, ufl=False) + v_vec = update_v(a_vec, u0_vec, v0_vec, a0_vec, ufl=False) - # update values - a_old.assign(project(a_new, V)) - v_old.assign(project(v_new, V)) - u_old.assign(u) + # assign u->u_old + v_old.vector()[:], a_old.vector()[:] = v_vec, a_vec + u_old.vector()[:] = u.vector() def avg(x_old, x_new, alpha): @@ -236,6 +238,7 @@ def avg(x_old, x_new, alpha): n = n_cp else: update_fields(u_np1, u_n, v_n, a_n) + u_n.assign(u_np1) t += float(dt) n += 1 From 4319fce03384de9034830261a41c5d65e6b40a55 Mon Sep 17 00:00:00 2001 From: Niklas Date: Tue, 22 Oct 2024 20:14:20 +0200 Subject: [PATCH 2/4] Remove changelog entry --- changelog-entries/554.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 changelog-entries/554.md diff --git a/changelog-entries/554.md b/changelog-entries/554.md deleted file mode 100644 index 0896242d2..000000000 --- a/changelog-entries/554.md +++ /dev/null @@ -1 +0,0 @@ -- Use `assign` function instead of directly accessing vectors in perpendicular-flap/solid-fenics. Fixes problem with checkpointing. From 804175ccfaa3d05ec49b201da74126a1dac12bf4 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Fri, 25 Oct 2024 17:43:15 +0200 Subject: [PATCH 3/4] Require fenicsprecice==2.2.0rc1 to avoid subcycling bug. --- perpendicular-flap/solid-fenics/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perpendicular-flap/solid-fenics/requirements.txt b/perpendicular-flap/solid-fenics/requirements.txt index fe29958de..e7a847a98 100644 --- a/perpendicular-flap/solid-fenics/requirements.txt +++ b/perpendicular-flap/solid-fenics/requirements.txt @@ -1,4 +1,4 @@ -fenicsprecice~=2.0 +fenicsprecice==2.2.0rc1 numpy >1, <2 matplotlib From 53fea5c744f4490c35830d10ecd49529a19918bd Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 4 Nov 2024 13:38:13 +0100 Subject: [PATCH 4/4] Update perpendicular-flap/solid-fenics/requirements.txt --- perpendicular-flap/solid-fenics/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perpendicular-flap/solid-fenics/requirements.txt b/perpendicular-flap/solid-fenics/requirements.txt index e7a847a98..9bfbff756 100644 --- a/perpendicular-flap/solid-fenics/requirements.txt +++ b/perpendicular-flap/solid-fenics/requirements.txt @@ -1,4 +1,4 @@ -fenicsprecice==2.2.0rc1 +fenicsprecice~=2.2 numpy >1, <2 matplotlib