1 import ./make-test-python.nix ({ pkgs, ... }:
4 fenicsScript = pkgs.writeScript "poisson.py" ''
8 mesh = UnitSquareMesh(4, 4)
9 V = FunctionSpace(mesh, "Lagrange", 1)
12 return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS
15 bc = DirichletBC(V, u0, boundary)
19 f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)", degree=2)
20 g = Expression("sin(5*x[0])", degree=2)
21 a = inner(grad(u), grad(v))*dx
32 maintainers = with pkgs.lib.maintainers; [ knedlsepp ];
36 fenicsnode = { pkgs, ... }: {
37 environment.systemPackages = with pkgs; [
39 (python3.withPackages (ps: with ps; [ fenics ]))
47 fenicsnode.succeed("${fenicsScript}")