Skip to content

Commit

Permalink
pySDC & FEniCS solver for partitioned-heat-equation (#557)
Browse files Browse the repository at this point in the history
Add SDC time stepping as an option for FEniCS-bases partitioned heat conduction scenario.
---------

Co-authored-by: Benjamin Rodenberg <benjamin.rodenberg@cit.tum.de>
  • Loading branch information
TobiasEppacher and BenjaminRodenberg authored Sep 2, 2024
1 parent ff04dc4 commit 88873b3
Show file tree
Hide file tree
Showing 6 changed files with 566 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog-entries/557.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added SDC from pySDC as new time-stepping scheme in [partitioned-heat-conduction tutorial](https://precice.org/tutorials-partitioned-heat-conduction.html) with FEniCS.
36 changes: 35 additions & 1 deletion partitioned-heat-conduction/dirichlet-fenics/run.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
#!/usr/bin/env bash
set -e -u

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 ../solver-fenics/heat.py Dirichlet
if [ $# -eq 0 ]
then
echo "Running simulation with default FEniCS implementation"
python3 ../solver-fenics/heat.py Dirichlet
else
case "$1" in
-[hH]|--help)
echo "Usage: $0 [highorder|sdc|*]"
echo ""
echo " irk : Run simulation with higher-order implicit Runge-Kutta schemes FEniCS implementation"
echo " sdc : Run simulation with pySDC+FEniCS implementation"
echo " * : For every other input run the simulation with default FEniCS implementation"
exit 0
;;
irk)
echo "Running simulation with higher-order implicit Runge-Kutta schemes FEniCS implementation"
python3 ../solver-fenics/heatHigherOrder.py Dirichlet
;;
sdc)
# install pySDC + its dependencies only if needed
pip install git+https://github.com/Parallel-in-Time/pySDC@5.4.3
pip install pySDC~=5.4
echo "Running simulation with pySDC+FEniCS implementation"
python3 ../solver-fenics/heat_pySDC.py Dirichlet
;;
*)
echo "Running simulation with default FEniCS implementation"
python3 ../solver-fenics/heat.py Dirichlet
;;
esac
fi

close_log
4 changes: 4 additions & 0 deletions partitioned-heat-conduction/neumann-fenics/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env bash
set -e -u

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

Expand Down
Loading

0 comments on commit 88873b3

Please sign in to comment.