From 0a969f82817595b1592f6e0e18cbc333ae822be0 Mon Sep 17 00:00:00 2001 From: adigitoleo Date: Fri, 19 Apr 2024 00:30:54 +1000 Subject: [PATCH] fix: Fix fl-corner2d example We need to spawn some particles to stop the h5part data from being cut off when particles start to exit the domain. Within the particle spawning shim, it's necessary to return an empty list (and not None) if particles should not be spawned at that particular time. --- examples/fluidity/corner2d/corner2d.flml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/fluidity/corner2d/corner2d.flml b/examples/fluidity/corner2d/corner2d.flml index ca5d0861..1a344bf3 100644 --- a/examples/fluidity/corner2d/corner2d.flml +++ b/examples/fluidity/corner2d/corner2d.flml @@ -83,6 +83,17 @@ return INITIAL_POSITIONS + + + def val(t): + from corner2d import INITIAL_POSITIONS + + if 8.7e13 < t < 8.75e13 or 4.3e14 < t < 4.4e14: + return INITIAL_POSITIONS + else: + return [] + +