I installed fenics using spack, by executing spack install fenics
but it does not contain mshr, and the scripts fail on from mshr import *
.
What is the best way to install fenics? Also there are two fenics organizations, one on github and one on bitbucket. Which one should I follow?
Roadmap Roadmap 2019-2020 – FEniCS Project answers my second question.
dokken
March 16, 2021, 7:51am
3
Mshr is not maintained any longer, and it is recommended to use external software (such as Gmsh) to generate other meshes than the built in one.
As for installation,there are many ways of installing FEniCS, as outlined in Download – FEniCS Project
These installation instructions cover how to install the stable version of FEniCS (the one found on bitbucket).
To install the development version (dolfinx, found on github), you can install it from source, use docker, use spack or use PPA on ubuntu.
1 Like
Alright, I will move over to gmsh, where can I find a fenics example using gmsh?
I also tried conda installation, it seems to work well.
dokken
March 16, 2021, 9:18am
5
There are plenty of examples across this forum. Consider for instance:
The code I’ve posted there is for a 3D mesh, however, it generalizes to a 2D mesh.
Given this simple geo file
// the square
Point(1) = {0, 0, 0,0.1};
Point(2) = {0, 1, 0,0.1};
Point(3) = {1, 1, 0,0.1};
Point(4) = {1, 0, 0,0.1};
Line(1) = {1, 4};
Line(2) = {4, 3};
Line(3) = {3, 2};
Line(4) = {2, 1};
// creating the surfaces
Line Loop(6) = {2, 3, 4, 1};
Plane Surface(8) = {6};
Physical Surface(2) = {8};
I call gmsh -2 mesh.geo to create the msh file
Then using meshio I load the meshio
import…
or
I disagree with your claim. All the code I have posted above is using msh 4.1.
The following illustrates a use case with the latest version of GMSH. Starting from a clean ubuntu 20.04 environment using docker:
docker run -ti -v $PWD:/home/shared -w /home/shared --rm ubuntu:20.04
Installation instructions in docker
apt-get update -qq
apt-get install -y -qq software-properties-common python3-pip libglu1 libxrender1 libcursor1 libxft2 libxinerama1
add-apt-repository -y ppa:fenics-packages/fen…
Gmsh also has a large range of tutorials:
or my tutorial using pygmsh
https://jsdokken.com/converted_files/tutorial_pygmsh.html#second
Alright, thanks a lot for helping me out.