inspired by the im2mesh matlab code.
Fenics is primary developed for linux and macos, for win, insall use docer
- install docker
- install fenics iamges 'docker pull quay.io/fenicsproject/stable:current'
- Mounting Local Directories 'path' and Jupyter notebook:
docker run -ti --rm -p 8888:8888 -v llocal_directories_to_mount:/home/fenics/shared quay.io/fenicsproject/stable:current 'jupyter-notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root' 4. lauch jupyter notebook: http://127.0.0.1:8888/?token=your_token
V = VectorFunctionSpace(mesh, "Lagrange", 1)
u = TrialFunction(V)
v = TestFunction(V)
lsh = dot(inner(sigma(u), eps(v))*dx)
rsh = dot(f,u)*dx
\begin{equation} \boldsymbol{\sigma} = \mathbb{C}:(\boldsymbol{\varepsilon}-\alpha(T-T_0)\boldsymbol{1}) = \lambda\text{tr}(\boldsymbol{\varepsilon})\boldsymbol{1}+2\mu\boldsymbol{\varepsilon} -\alpha(3\lambda+2\mu)(T-T_0)\boldsymbol{1} \end{equation}
V = VectorFunctionSpace(mesh, 'CG', 2)
u = TrialFunction(V)
v = TestFunction(V)
Wint = inner(sigma(u, Delta_T), eps(v))*dx
aM = lhs(Wint)
LM = rhs(Wint) + inner(f, v)*dx
bcu = DirichletBC(V, Constant((0., 0.)), lateral_sides)
u = Function(V, name="Displacement")
solve(aM == LM, u, bcu)