getting finer meshes for separate geometries using step files
Hello everyone,
I am meshing a very complex geometry which has different subcomponents. For some of these components, I need finer mesh size compared to others. I am importing step files into gmsh and I can specify the maximum mesh size. I as far as I search through the demos, I couldn't find a way to specify different mesh size for different step files.
I am attaching very simple 2 geometries
and my python3 script:
import sys
import numpy as np
gmsh.initialize()
gmsh.option.setNumber("General.Terminal", 0)
gmsh.model.add("cubes")
gmsh.option.setString('Geometry.OCCTargetUnit', 'M')
gmsh.model.occ.importShapes('cube1.step')
gmsh.model.occ.synchronize()
gmsh.model.occ.importShapes('cube2.step')
gmsh.model.occ.synchronize()
gmsh.model.occ.removeAllDuplicates()
gmsh.model.occ.synchronize()
gmsh.model.addPhysicalGroup(3, [1], tag=1)
gmsh.model.addPhysicalGroup(3, [2], tag=2)
surfaces = gmsh.model.occ.getEntities(dim=2)
for surface in surfaces:
gmsh.model.addPhysicalGroup(surface[0], [surface[1]])
gmsh.model.occ.synchronize()
#gmsh.option.setNumber("Mesh.MeshSizeMin", 0.005)
gmsh.option.setNumber("Mesh.MeshSizeMax", 0.01)
gmsh.option.setNumber("Mesh.Algorithm", 6)
gmsh.option.setNumber("Mesh.Algorithm3D", 10)#10
gmsh.option.setNumber("Mesh.RandomFactor", 1e-11)
gmsh.option.setNumber("Mesh.RandomFactor3D", 1e-13)
gmsh.option.setNumber("Mesh.Optimize", 1)
gmsh.option.setNumber("Mesh.OptimizeNetgen", 0)
gmsh.model.mesh.generate(3)
gmsh.write("{}.msh".format("cubes"))
if '-nopopup' not in sys.argv:
gmsh.fltk.run()
gmsh.finalize()
What I want is in the below figure is
I want to have finer mesh for the right cube.
Thanks for your interest in advance.