Anaconda Installation of Fenics and Mshr

Then that just begs the question of why mshr would be included in the apt-get but not in the

conda install -c conda-forge fenics

:woman_shrugging:t2:

But I still need to know if

conda install -n fenicsproject -c conda-forge mshr=2019.1.0

would default to the last build or if I need to somehow find out what the build differences are and specify a particular one, e.g.

conda install -n fenicsproject -c conda-forge mshr=2019.1.0=py38h255090a_2

As the fenics project is an open source project, it is dependent on people maintaining instructions. As no of the main developers has limited experience with conda, it has not been prioritized.

Any contributions to the conda packages are welcome.

@dparsons has been kind and maintained the fenics apt-packages.

I would like to note that mshr is no longer maintained, it is now recommended to use external meshing software, see: How i can make geometry and mesh in my program? - #2 by dokken for a list of suggested mesh generators.

Thanks Jorgen @dokken,

It appears on cursory views that these external meshing software do not have the pre-defined shapes that mshr had. Plus, one of my co-workers recommended meshio, which is not directly mentioned in the comparison.

How non-functional is mshr? Essentially, is it still sufficient for most FE problems (or at least the tutorial codes) to install the last build of mshr for my machine (? I’m fairly certain it is py39h9761ab4_4 but I still don’t know where to look for the info on what is different between builds)?

I am just starting to use FEniCS, so I am totally willing to help update the conda documentation for getting a functional install.

Meshio is not a meshing tool, but a mesh converter (between a large variety of formats).

Mshr works with its current functionality, but there is no one maintaining it. This means that if you find bugs the likelyhood of anyone fixing them is quite slim. I do not know much about the different mshr versions on conda, as I stopped using it many years ago.

So, even if I do get a working version of mshr, I will need to install meshio (conda install -c conda-forge meshio) and probably an overall external meshing program (like pygmsh) for future work. Okay.

At any rate, Where do I go to find out the differences between the builds for the various modules?

As mshr creates dolfin meshes, you do not need meshio. But it is needed for any other external meshing software.

If you are talking about the conda module builds, I honestly do not know, maybe @sebastkm knows, as he used conda.

Dear Kristin,

just a quick remark from my side: I only had to specify the build in conda, because the default build did not work. Just importing anything from mshr caused the ImportErrors listed above.

I think the build problem was fixed recently. When I tried to create a fresh conda environment with fenics and mshr (for python 3.7) today, it just worked without specifying any version or build id.

Best regards
Martin (L)

1 Like

My mshr does work, I installed with just using mshr and not specifying anything with an =… so I agree, the build problem must have been fixed, a big “thanks” to whomever did that!!!

Dear MartinLenz,
Your proposed method is impeccable. Thank you so much.

I had to reinstall FEniCS2019 and I tried to install every newer versions of mshr with fenics but they did not work properly. So with ubuntu 22.04, if you want to install mshr and fenics with conda, the command is still
conda install -c conda-forge fenics mshr=2019.1.0=py38h255090a_2