Running Firedrake #2712
-
Hello, I would like to know how codes were run in this tutorial. https://www.archer2.ac.uk/training/courses/210823-firedrake/ I run Firedrake using Docker container on Windows, but I can not show some results easily. Best Regards |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Can you please provide more information about your issue? What do you mean by "can not show some results easily"? I just tried to view Jupyter notebooks run from inside Docker and found that I needed to run the command $ jupyter notebook --port=8888 --ip=0.0.0.0 --no-browser . after setting up port forwarding when starting the container: $ docker run -it -p 8888:8888 firedrakeproject/firedrake:latest Note that you also need to activate the virtual environment and |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response For example, I am trying to plot the sparsity of the matrix, but it does not appear in the way that I run the code. from firedrake import * V = FunctionSpace(mesh, "CG", 1) u = TrialFunction(V) f = Function(V) a = (inner(grad(u), grad(v)) + inner(u, v)) * dx u = Function(V) solve(a == L, u, solver_parameters={'ksp_type': 'cg', 'pc_type': 'none'}) from firedrake.petsc import PETSc indptr, indices, data = petsc_mat.getValuesCSR() |
Beta Was this translation helpful? Give feedback.
-
Yes, this is the problem. |
Beta Was this translation helpful? Give feedback.
-
Thank you |
Beta Was this translation helpful? Give feedback.
Can you please provide more information about your issue? What do you mean by "can not show some results easily"?
I just tried to view Jupyter notebooks run from inside Docker and found that I needed to run the command
$ jupyter notebook --port=8888 --ip=0.0.0.0 --no-browser .
after setting up port forwarding when starting the container:
Note that you also need to activate the virtual environment and
pip install jupyter
.