From ff04dc46f301af6aa63261f768ad4782021efb8c Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Mon, 2 Sep 2024 13:19:04 +0200 Subject: [PATCH 1/3] Add requirements.txt to elastic-tube-1d (#564) --- elastic-tube-1d/fluid-python/requirements.txt | 3 +++ elastic-tube-1d/fluid-python/run.sh | 4 ++++ elastic-tube-1d/solid-python/requirements.txt | 2 ++ elastic-tube-1d/solid-python/run.sh | 4 ++++ 4 files changed, 13 insertions(+) create mode 100644 elastic-tube-1d/fluid-python/requirements.txt create mode 100644 elastic-tube-1d/solid-python/requirements.txt diff --git a/elastic-tube-1d/fluid-python/requirements.txt b/elastic-tube-1d/fluid-python/requirements.txt new file mode 100644 index 000000000..a7c8a22bd --- /dev/null +++ b/elastic-tube-1d/fluid-python/requirements.txt @@ -0,0 +1,3 @@ +matplotlib +numpy >1, <2 +pyprecice~=3.0 diff --git a/elastic-tube-1d/fluid-python/run.sh b/elastic-tube-1d/fluid-python/run.sh index 40f081acc..42eb172b5 100755 --- a/elastic-tube-1d/fluid-python/run.sh +++ b/elastic-tube-1d/fluid-python/run.sh @@ -4,6 +4,10 @@ set -e -u . ../../tools/log.sh exec > >(tee --append "$LOGFILE") 2>&1 +python3 -m venv .venv +. .venv/bin/activate +pip install -r requirements.txt + python3 ./FluidSolver.py ../precice-config.xml close_log diff --git a/elastic-tube-1d/solid-python/requirements.txt b/elastic-tube-1d/solid-python/requirements.txt new file mode 100644 index 000000000..dbffa144f --- /dev/null +++ b/elastic-tube-1d/solid-python/requirements.txt @@ -0,0 +1,2 @@ +numpy >1, <2 +pyprecice~=3.0 diff --git a/elastic-tube-1d/solid-python/run.sh b/elastic-tube-1d/solid-python/run.sh index e56711214..1ef66e4c7 100755 --- a/elastic-tube-1d/solid-python/run.sh +++ b/elastic-tube-1d/solid-python/run.sh @@ -4,6 +4,10 @@ set -e -u . ../../tools/log.sh exec > >(tee --append "$LOGFILE") 2>&1 +python3 -m venv .venv +. .venv/bin/activate +pip install -r requirements.txt + python3 ./SolidSolver.py ../precice-config.xml close_log From 88873b34994347e596e86a62e01e38ee23f31162 Mon Sep 17 00:00:00 2001 From: Tobias Eppacher <90399710+TobiasEppacher@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:40:56 +0200 Subject: [PATCH 2/3] pySDC & FEniCS solver for partitioned-heat-equation (#557) Add SDC time stepping as an option for FEniCS-bases partitioned heat conduction scenario. --------- Co-authored-by: Benjamin Rodenberg --- changelog-entries/557.md | 1 + .../dirichlet-fenics/run.sh | 36 +- .../neumann-fenics/run.sh | 4 + .../solver-fenics/heat_pySDC.py | 367 ++++++++++++++++++ .../solver-fenics/heat_pySDC_problem_class.py | 148 +++++++ .../solver-fenics/requirements.txt | 11 + 6 files changed, 566 insertions(+), 1 deletion(-) create mode 100644 changelog-entries/557.md create mode 100644 partitioned-heat-conduction/solver-fenics/heat_pySDC.py create mode 100644 partitioned-heat-conduction/solver-fenics/heat_pySDC_problem_class.py create mode 100644 partitioned-heat-conduction/solver-fenics/requirements.txt diff --git a/changelog-entries/557.md b/changelog-entries/557.md new file mode 100644 index 000000000..ee9c0385b --- /dev/null +++ b/changelog-entries/557.md @@ -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. \ No newline at end of file diff --git a/partitioned-heat-conduction/dirichlet-fenics/run.sh b/partitioned-heat-conduction/dirichlet-fenics/run.sh index 95cc2d28b..b75e8c84b 100755 --- a/partitioned-heat-conduction/dirichlet-fenics/run.sh +++ b/partitioned-heat-conduction/dirichlet-fenics/run.sh @@ -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 diff --git a/partitioned-heat-conduction/neumann-fenics/run.sh b/partitioned-heat-conduction/neumann-fenics/run.sh index 874fdec84..ef1398d56 100755 --- a/partitioned-heat-conduction/neumann-fenics/run.sh +++ b/partitioned-heat-conduction/neumann-fenics/run.sh @@ -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 diff --git a/partitioned-heat-conduction/solver-fenics/heat_pySDC.py b/partitioned-heat-conduction/solver-fenics/heat_pySDC.py new file mode 100644 index 000000000..e0bad82ac --- /dev/null +++ b/partitioned-heat-conduction/solver-fenics/heat_pySDC.py @@ -0,0 +1,367 @@ +""" +The basic example is taken from "Langtangen, Hans Petter, and Anders Logg. Solving PDEs in Python: The FEniCS +Tutorial I. Springer International Publishing, 2016." + +The example code has been extended with preCICE API calls and mixed boundary conditions to allow for a Dirichlet-Neumann +coupling of two separate heat equations. + +The original source code can be found on https://github.com/hplgit/fenics-tutorial/blob/master/pub/python/vol1/ft03_heat.py. + +Heat equation with Dirichlet conditions. (Dirichlet problem) + u'= Laplace(u) + f in the unit square [0,1] x [0,1] + u = u_C on the coupling boundary at x = 1 + u = u_D on the remaining boundary + u = u_0 at t = 0 + u = 1 + x^2 + alpha*y^2 + \beta*t + f = beta - 2 - 2*alpha + +Heat equation with mixed boundary conditions. (Neumann problem) + u'= Laplace(u) + f in the shifted unit square [1,2] x [0,1] + du/dn = f_N on the coupling boundary at x = 1 + u = u_D on the remaining boundary + u = u_0 at t = 0 + u = 1 + x^2 + alpha*y^2 + \beta*t + f = beta - 2 - 2*alpha + + +This variant of this tutorial example uses the open-source library pySDC for time-stepping. +pySDC can be installed via `pip install pySDC`. +If you want to use the developer version, the source code repository can be cloned from "https://github.com/Parallel-in-Time/pySDC". +For more information on pySDC, see also "https://parallel-in-time.org/pySDC/" +""" + +from __future__ import print_function, division +from fenics import Function, FunctionSpace, Expression, Constant, TrialFunction, TestFunction, \ + File, solve, grad, inner, dx, interpolate, VectorFunctionSpace, MeshFunction, MPI +from fenicsprecice import Adapter +from errorcomputation import compute_errors +from my_enums import ProblemType, DomainPart +import argparse +import numpy as np +from problem_setup import get_geometry +import sympy as sp + +from pySDC.implementations.sweeper_classes.imex_1st_order_mass import imex_1st_order_mass +from pySDC.implementations.controller_classes.controller_nonMPI import controller_nonMPI +from heat_pySDC_problem_class import fenics_heat_2d + + +def determine_gradient(V_g, u, flux): + """ + compute flux following http://hplgit.github.io/INF5620/doc/pub/fenics_tutorial1.1/tu2.html#tut-poisson-gradu + :param V_g: Vector function space + :param u: solution where gradient is to be determined + :param flux: returns calculated flux into this value + """ + + w = TrialFunction(V_g) + v = TestFunction(V_g) + + a = inner(w, v) * dx + L = inner(grad(u), v) * dx + solve(a == L, flux) + + +def setup_problem( + function_space, + coupling_boundary, + remaining_boundary, + u_D, forcing_expr, + coupling_expression, + precice, + dt, + logger_level=30, + quad_type='LOBATTO', + num_nodes=4, + restol=1e-11, + maxiter=40): + + # Create docstring for this function + """ + Setup the problem and controller for the heat equation problem. + + Args: + function_space: FEniCS function space object + coupling_boundary: FEniCS SubDomain object for the coupling boundary + remaining_boundary: FEniCS SubDomain object for the remaining boundary + u_D: FEniCS expression for the manufactured solution + forcing_expr: FEniCS expression for the forcing term + coupling_expression: FEniCS expression for the coupling boundary condition + precice: preCICE-FEniCS adapter object reference + dt: time step size + logger_level: logging level + quad_type: quadrature type + num_nodes: number of nodes + restol: residual tolerance + maxiter: maximum number of iterations + + Returns: + controller: pySDC controller object + P: problem object + """ + + # initialize controller parameters + controller_params = { + 'logger_level': logger_level + } + + # fill description dictionary for easy instantiation + description = { + 'problem_class': fenics_heat_2d, + 'problem_params': { + 'function_space': function_space, + 'coupling_boundary': coupling_boundary, + 'remaining_boundary': remaining_boundary, + 'solution_expr': u_D, + 'forcing_term_expr': forcing_expr, + 'precice_ref': precice, + 'coupling_expr': coupling_expression + }, + 'sweeper_class': imex_1st_order_mass, + 'sweeper_params': { + 'quad_type': quad_type, + 'num_nodes': num_nodes, + }, + 'level_params': { + 'restol': restol, + 'dt': dt + }, + 'step_params': { + 'maxiter': maxiter, + } + } + + # Controller for time stepping + controller = controller_nonMPI(num_procs=1, controller_params=controller_params, description=description) + + # Reference to problem class for easy access to exact solution + P = controller.MS[0].levels[0].prob + return controller, P + + +parser = argparse.ArgumentParser(description="Solving heat equation for simple or complex interface case") +parser.add_argument("participantName", help="Name of the solver.", type=str, choices=[p.value for p in ProblemType]) +parser.add_argument("-e", "--error-tol", help="set error tolerance", type=float, default=10**-8,) + +args = parser.parse_args() +participant_name = args.participantName + + +# preCICE error tolerance +# Error is bounded by coupling accuracy. In theory we would obtain the analytical solution. +error_tol = args.error_tol + +if participant_name == ProblemType.DIRICHLET.value: + problem = ProblemType.DIRICHLET + domain_part = DomainPart.LEFT +elif participant_name == ProblemType.NEUMANN.value: + problem = ProblemType.NEUMANN + domain_part = DomainPart.RIGHT + exit("Neumann problem not yet supported with pySDC") + +domain_mesh, coupling_boundary, remaining_boundary = get_geometry(domain_part) + +# Define function space using mesh +V = FunctionSpace(domain_mesh, 'P', 2) +V_g = VectorFunctionSpace(domain_mesh, 'P', 1) +W = V_g.sub(0).collapse() + + +# Time step size +# Should be integer fraction of the used time window size +pySDC_dt = 0.1 + +# Manufactured solution parameters +alpha = 3 # parameter alpha +beta = 1.2 # parameter beta + + +# create sympy expression of manufactured solution +x_sp, y_sp, t_sp = sp.symbols(['x[0]', 'x[1]', 't']) + +temporal_deg = 1 # temporal degree of the manufactured solution +u_D_sp = 1 + x_sp * x_sp + alpha * y_sp * y_sp + beta * (t_sp ** temporal_deg) +u_D = Expression(sp.ccode(u_D_sp), degree=2, alpha=alpha, beta=beta, temporal_deg=temporal_deg, t=0) + +u_D_function = interpolate(u_D, V) +f_sp = u_D_sp.diff(t_sp) - u_D_sp.diff(x_sp).diff(x_sp) - u_D_sp.diff(y_sp).diff(y_sp) +forcing_expr = Expression(sp.ccode(f_sp), degree=2, alpha=alpha, beta=beta, t=0) + + +if problem is ProblemType.DIRICHLET: + # Define flux in x direction + f_N = Expression(sp.ccode(u_D_sp.diff(x_sp)), degree=1, alpha=alpha, t=0) + f_N_function = interpolate(f_N, W) + +# Define initial value +u_n = interpolate(u_D, V) +u_n.rename("Temperature", "") + + +precice, precice_dt, initial_data = None, 0.0, None + +# Initialize the adapter according to the specific participant +precice = Adapter(adapter_config_filename="precice-adapter-config.json") + +if problem is ProblemType.DIRICHLET: + precice.initialize(coupling_boundary, read_function_space=V, write_object=f_N_function) +elif problem is ProblemType.NEUMANN: + precice.initialize(coupling_boundary, read_function_space=W, write_object=u_D_function) + +precice_dt = precice.get_max_time_step_size() +dt = Constant(0) +dt.assign(np.min([pySDC_dt, precice_dt])) + +coupling_expression = precice.create_coupling_expression() + + +controller, P = setup_problem(V, + coupling_boundary, + remaining_boundary, + u_D, forcing_expr, + coupling_expression, + precice, + pySDC_dt) + + +# Time-stepping +u_np1 = Function(V) +u_np1.rename("Temperature", "") +t = 0 + +# reference solution at t=0 +u_ref = interpolate(u_D, V) +u_ref.rename("reference", " ") + +# mark mesh w.r.t ranks +mesh_rank = MeshFunction("size_t", domain_mesh, domain_mesh.topology().dim()) +if problem is ProblemType.NEUMANN: + mesh_rank.set_all(MPI.rank(MPI.comm_world) + 4) +else: + mesh_rank.set_all(MPI.rank(MPI.comm_world) + 0) +mesh_rank.rename("myRank", "") + +# Generating output files +temperature_out = File("output/%s.pvd" % precice.get_participant_name()) +ref_out = File("output/ref%s.pvd" % precice.get_participant_name()) +error_out = File("output/error%s.pvd" % precice.get_participant_name()) +ranks = File("output/ranks%s.pvd" % precice.get_participant_name()) + +# output solution and reference solution at t=0, n=0 +n = 0 +print("output u^%d and u_ref^%d" % (n, n)) +ranks << mesh_rank + +error_total, error_pointwise = compute_errors(u_n, u_ref, V) + +# create buffer for output. We need this buffer, because we only want to +# write the converged output at the end of the window, but we also want to +# write the samples that are resulting from substeps inside the window +u_write = [] +ref_write = [] +error_write = [] +# copy data to buffer and rename +uu = u_n.copy() +uu.rename("u", "") +u_write.append((uu, t)) +uu_ref = u_ref.copy() +uu_ref.rename("u_ref", "") +ref_write.append(uu_ref) +err = error_pointwise.copy() +err.rename("err", "") +error_write.append(err) + +if problem is ProblemType.DIRICHLET: + flux = Function(V_g) + flux.rename("Heat-Flux", "") + +while precice.is_coupling_ongoing(): + + # write checkpoint + if precice.requires_writing_checkpoint(): + precice.store_checkpoint(u_n, t, n) + + # output solution and reference solution at t_n+1 and substeps (read from buffer) + print('output u^%d and u_ref^%d' % (n, n)) + for sample in u_write: + temperature_out << sample + + for sample in ref_write: + ref_out << sample + + for sample in error_write: + error_out << error_pointwise + + precice_dt = precice.get_max_time_step_size() + dt.assign(np.min([pySDC_dt, precice_dt])) + + # Update start time of the current preCICE time step within + # the problem class. + # This is necessary, that the coupling expression update in the problem class + # is executed correctly. + P.t_start = t + + # Retrieve the result at the end of the timestep from pySDC + uend, _ = controller.run(u_n, t0=t, Tend=t + float(dt)) + + # Update the buffer with the new solution values + u_np1 = uend.values + + # Write data to preCICE according to which problem is being solved + if problem is ProblemType.DIRICHLET: + # Dirichlet problem reads temperature and writes flux on boundary to Neumann problem + determine_gradient(V_g, u_np1, flux) + flux_x = interpolate(flux.sub(0), W) + precice.write_data(flux_x) + elif problem is ProblemType.NEUMANN: + # Neumann problem reads flux and writes temperature on boundary to Dirichlet problem + precice.write_data(u_np1) + + precice.advance(dt) + precice_dt = precice.get_max_time_step_size() + + # roll back to checkpoint + if precice.requires_reading_checkpoint(): + u_cp, t_cp, n_cp = precice.retrieve_checkpoint() + u_n.assign(u_cp) + t = t_cp + n = n_cp + # empty buffer if window has not converged + u_write = [] + ref_write = [] + error_write = [] + else: # update solution + u_n.assign(u_np1) + t += float(dt) + n += 1 + # copy data to buffer and rename + uu = u_n.copy() + uu.rename("u", "") + u_write.append((uu, t)) + uu_ref = u_ref.copy() + uu_ref.rename("u_ref", "") + ref_write.append(uu_ref) + err = error_pointwise.copy() + err.rename("err", "") + error_write.append(err) + + if precice.is_time_window_complete(): + u_ref = interpolate(u_D, V) + u_ref.rename("reference", " ") + error, error_pointwise = compute_errors(u_n, u_ref, V, total_error_tol=error_tol) + print("n = %d, t = %.2f: L2 error on domain = %.3g" % (n, t, error)) + + +# output solution and reference solution at t_n+1 and substeps (read from buffer) +print("output u^%d and u_ref^%d" % (n, n)) +for sample in u_write: + temperature_out << sample + +for sample in ref_write: + ref_out << sample + +for sample in error_write: + error_out << error_pointwise + +# Hold plot +precice.finalize() diff --git a/partitioned-heat-conduction/solver-fenics/heat_pySDC_problem_class.py b/partitioned-heat-conduction/solver-fenics/heat_pySDC_problem_class.py new file mode 100644 index 000000000..ab952c20c --- /dev/null +++ b/partitioned-heat-conduction/solver-fenics/heat_pySDC_problem_class.py @@ -0,0 +1,148 @@ +""" +This file contains the implementation of the pySDC problem class for the 2D heat equation. +This class is used to define the problem pySDC uses in "heat_pySDC.py" for time-stepping. + +This class is based on the pySDC tutorial example for its usage with FEniCS. +More about that tutorial can be found at "https://parallel-in-time.org/pySDC/tutorial/step_7.html#part-a-pysdc-and-fenics". +""" + +from fenics import TrialFunction, TestFunction, dx, assemble, inner, nabla_grad, DirichletBC, Constant, solve, interpolate +from my_enums import ProblemType + + +from pySDC.core.Problem import ptype +from pySDC.implementations.datatype_classes.fenics_mesh import fenics_mesh, rhs_fenics_mesh + + +class fenics_heat_2d(ptype): + dtype_u = fenics_mesh + dtype_f = rhs_fenics_mesh + + def __init__(self, function_space, forcing_term_expr, solution_expr, coupling_boundary, + remaining_boundary, coupling_expr, precice_ref): + # Add docstring + """ + Constructor of the 2D heat equation problem class. + + Args: + function_space: FEniCS function space object + forcing_term_expr: FEniCS expression for the forcing term + solution_expr: FEniCS expression for the manufactured solution + coupling_boundary: FEniCS SubDomain object for the coupling boundary + remaining_boundary: FEniCS SubDomain object for the remaining boundary + coupling_expr: FEniCS expression for the coupling boundary condition + precice_ref: preCICE-FEniCS adapter object reference + """ + + # Set precice reference and coupling expression reference to update coupling boundary + # at every step within pySDC + self.precice = precice_ref + self.coupling_expression = coupling_expr + self.t_start = 0.0 + + # save function space for future reference + self.V = function_space + + # Forcing term + self.forcing_term_expr = forcing_term_expr + + # Solution expression for error comparison and as boundary condition + # on the non-coupling boundary + self.solution_expr = solution_expr + + # invoke super init + super(fenics_heat_2d, self).__init__(self.V) + + # Define Trial and Test function + u = TrialFunction(self.V) + v = TestFunction(self.V) + + # Mass term + a_M = u * v * dx + self.M = assemble(a_M) + + # Stiffness term (Laplace) + a_K = -1.0 * inner(nabla_grad(u), nabla_grad(v)) * dx + self.K = assemble(a_K) + + # Currently only Dirichlet participant is supported + if self.precice.get_participant_name() == ProblemType.DIRICHLET.value: + self.couplingBC = DirichletBC(self.V, coupling_expr, coupling_boundary) + + self.remainingBC = DirichletBC(self.V, solution_expr, remaining_boundary) + + # Allow for fixing the boundary conditions for the residual computation + # Necessary if imex-1st-order-mass sweeper is used + self.fix_bc_for_residual = True + + # define the homogeneous Dirichlet boundary for residual correction + def FullBoundary(x, on_boundary): + return on_boundary + self.homogenousBC = DirichletBC(self.V, Constant(0), FullBoundary) + + def solve_system(self, rhs, factor, u0, t): + """ + Solves (M - factor * A) u = rhs. + """ + u = self.dtype_u(u0) + T = self.M - factor * self.K + b = self.dtype_u(rhs) + + self.solution_expr.t = t + self.remainingBC.apply(T, b.values.vector()) + + # Update the coupling boundary condition for the Dirichlet participant + if self.precice.get_participant_name() == ProblemType.DIRICHLET.value: + dt = t - self.t_start # This dt is used to read data from the current time window + read_data = self.precice.read_data(dt) # Read the data to update the coupling expression + self.precice.update_coupling_expression( + self.coupling_expression, + read_data) # Update the coupling expression + + self.couplingBC.apply(T, b.values.vector()) # Apply the coupling boundary condition + + solve(T, u.values.vector(), b.values.vector()) + + return u + + def eval_f(self, u, t): + """ + Derivative computation. + Returns a dtype_f object (rhs_fenics_mesh in our case), + with an explicit and implicit part. + """ + f = self.dtype_f(self.V) + + # Implicit part: K*u + self.K.mult(u.values.vector(), f.impl.values.vector()) + + # Explicit part: M*g (g = forcing term) + self.forcing_term_expr.t = t + f.expl = self.dtype_u(interpolate(self.forcing_term_expr, self.V)) + f.expl = self.apply_mass_matrix(f.expl) + + return f + + def fix_residual(self, res): + """ + Applies homogeneous Dirichlet boundary conditions to the residual + """ + self.homogenousBC.apply(res.values.vector()) + + def apply_mass_matrix(self, u): + """ + Returns M*u. + """ + + me = self.dtype_u(self.V) + self.M.mult(u.values.vector(), me.values.vector()) + + return me + + def u_exact(self, t): + """ + Returns the exact solution at time t. + """ + self.solution_expr.t = t + + return self.dtype_u(interpolate(self.solution_expr, self.V), val=self.V) diff --git a/partitioned-heat-conduction/solver-fenics/requirements.txt b/partitioned-heat-conduction/solver-fenics/requirements.txt new file mode 100644 index 000000000..fe3302591 --- /dev/null +++ b/partitioned-heat-conduction/solver-fenics/requirements.txt @@ -0,0 +1,11 @@ +numpy >1, <2 +fenicsprecice~=2.0 +scipy + +# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/ +# Use --system-site-packages in venv +fenics-dijitso==2019.2.0.dev0 +fenics-dolfin==2019.2.0.13.dev0 +fenics-ffc==2019.2.0.dev0 +fenics-fiat==2019.2.0.dev0 +fenics-ufl-legacy==2022.3.0 \ No newline at end of file From 0225e428cc559444a29541b9c46318d8c60cd8fd Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 2 Sep 2024 17:39:00 +0200 Subject: [PATCH 3/3] Update `partitioned-heat-conduction` to pySDC 5.5.0 (#566) --- partitioned-heat-conduction/dirichlet-fenics/run.sh | 4 ++-- .../solver-fenics/heat_pySDC_problem_class.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/partitioned-heat-conduction/dirichlet-fenics/run.sh b/partitioned-heat-conduction/dirichlet-fenics/run.sh index b75e8c84b..1f7bcb9c0 100755 --- a/partitioned-heat-conduction/dirichlet-fenics/run.sh +++ b/partitioned-heat-conduction/dirichlet-fenics/run.sh @@ -28,8 +28,8 @@ else ;; 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 + pip install git+https://github.com/Parallel-in-Time/pySDC@5.5.0 + pip install pySDC~=5.5 echo "Running simulation with pySDC+FEniCS implementation" python3 ../solver-fenics/heat_pySDC.py Dirichlet ;; diff --git a/partitioned-heat-conduction/solver-fenics/heat_pySDC_problem_class.py b/partitioned-heat-conduction/solver-fenics/heat_pySDC_problem_class.py index ab952c20c..7adb896ed 100644 --- a/partitioned-heat-conduction/solver-fenics/heat_pySDC_problem_class.py +++ b/partitioned-heat-conduction/solver-fenics/heat_pySDC_problem_class.py @@ -10,11 +10,11 @@ from my_enums import ProblemType -from pySDC.core.Problem import ptype +from pySDC.core.problem import Problem from pySDC.implementations.datatype_classes.fenics_mesh import fenics_mesh, rhs_fenics_mesh -class fenics_heat_2d(ptype): +class fenics_heat_2d(Problem): dtype_u = fenics_mesh dtype_f = rhs_fenics_mesh