Combining two different interval meshes

Hello Everyone! I am fairly new to fenics usage so I find myself stuck at trying to merge or combine two different interval meshes.

mesh1= IntervalMesh(1000, 0,0.001)
mesh2= IntervalMesh(4500,0.001,1)

as you can see the last vertex of mesh1 is the starting for mesh2, and now i wish to combine these two to give one interval mesh with my assigned resolution on different parts.
I thought of creating one uniform mesh and then refining it at desired parts but from what it seems the refine function divides interval in two and I would not be able to get my specific resolution.
Is there some easy inbuilt function for this? can multimesh function be used for this purpose?

I would suggest making a python script using the mesh editor class. See for instance: L-shape mesh generation with right element - #9 by dokken

2 Likes