You can deal with this by 2 approaches.
- Use the below piece of code to generate the mesh using
mshr
(not maintained any longer, therefore can useUnitSquareMesh(n, n)
ifmshr
doesn’t work).
from dolfin import *
from mshr import *
domain=Rectangle(Point(-0.5,-0.5),Point(0.5,0.5))-Rectangle(Point(-0.5,-0.0001),Point(0,0.0001))
mesh=generate_mesh(domain,10)
and refine mesh at the crack tip using the code given here.
Reference : Phase Field Fracture
- You can use Gmsh and take advantage of increasing mesh field at a point. After doing meshing, you can export file in
.msh
format and then refer to Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio on how to import this mesh.
Which version are you talking about ? If I remember the paper has only one code version that you are using.
I’ll look into it when am able to, but one thing I can tell that this form doesn’t match with what you wrote in mathematics above.