2D heat equation with varying kappa V2

Hello everyone, I try to run a python code example in Fenics Examples (see link below): for the heat equation in steady state with varying diffusivity k. scrip name is: “steady_state_04.py”

But the script does not run with varying diffusivity k
(the following expression of diffusivity k in line 63 of the script is not accepted by Python:
k = Expression ( ‘x[0] < 2.0 ? 5.0 : 1.0’, degree = 0 )

With k = 1, the script executes correctly.

May anyone help to run this script (that should work as it is as it is an example) ?

Here is the link to find the Python script: steady_state_04.py
https://people.math.sc.edu/Burkardt/fenics_src/heat_steady/heat_steady.html

The script you are referring to executes on my computer with no error using docker:

 docker run -ti -v $(pwd):/root/shared -w /root/shared --rm quay.io/fenicsproject/dev

please supply your error message and your installation method

Thanks another question:
How do you install Fenics through Docker ?
Is there a clear tutorial on how to install Fenics with Docker on Windows 10 ? (did not find any clear tutorial to do that).

Right now, I am running Fenics online, e.g. through a server, fenics is not on my local computer because I did not succeed to apply your procedure to use Fenics through a Docker. Indeed when I attempt to run the Docker_Desktop application (for windows 10), I have this error message that pops up:

“Hardware assisted virtualization and data execution protection must be enabled in the BIOS. See Logs and troubleshooting | Docker Documentation

Fenics execution is really a nightmare: even launching Fenics through a server (at distance) that I succeeded earlier today, does not work anymore now (probably because too many people connected to server). And Docker way does not work. I AM LOST !

My resistance to pain has some limits

Need help, thanks

Using fenics through docker is no different to running any other docker image.
Thus if you are able to follow the Hello world tutorial of docker, you should be able to run the dolfin docker images as well.

The particular error you are obtaining seems to be a well known Windows issue, and has many solutions: Docker for Windows error: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS" - Stack Overflow
You should also have a look at the link the error message directs you to, as it has several sections about hyperV (which is mentioned in the stackoverflow post as well)

Thanks for your post, after searching hours, I succeeded to run the docker on my windows 10 computer.
But once Docker is started correctly, from the command prompt of this Docker, when I type the specified command " curl -s https://get.fenicsproject.org | bash" to download fenics,

Error is : the term ‘bash’ is not recognized as the name of the cmdlet …"

This post
Installation issue about bash
reports this issue because “The fenicsproject script does not work in Windows PowerShell or in the Command Prompt ( cmd )”.
They recommand to use “straight docker commands instead”

Question: How do I use straight docker commands ?
(when I started my Docker-Desktop for windows, I have only a command Prompt (cmd) to type commands in the Docker),

Thanks

I already explained this above:

Sorry if I have stupid questions, but below is the screen shot on my windows 10 computer: apparently I can run a docker without error: this is what I obtain when I run Docker deskstop.exe,

But how do I do to type a straight docker command from where there ? what are next steps ?.

(want to be able to type commands in a docker prompt as the ones you recommend).

(did not find any tutorial on this)

Thanks a lot.

Nicolas

You should be able to type in power shell, see: Getting Started with Docker Desktop for Windows | Docker

I am working on a procedure (robust procedure) to get Fenics installed correctly on a windows 10 computer. I believe Dockers for Fenics are really not the right solution (even if it may work), because apparently Fenics is not “windows friendly”

If I arrive to a decent IT solution, I will put a post on the forum, because I think it is a solution that can interest many people.