Mesh size control and merge meshes.
Hello, based on examples and comments here, I tried to generate ellipsoids like below
import gmsh
import math
import os
import sys
import numpy as np
gmsh.initialize()
gmsh.model.add("test")
a_upper = (0.5, 1, 2)
epsilon = 1e-5
def make_ellipsoid(cx, cy, cz, ax, ay, az):
ellipsoid = gmsh.model.occ.add_sphere(cx, cy, cz, 1)
gmsh.model.occ.dilate([(3, ellipsoid)], cx, cy, cz, ax, ay, az)
return ellipsoid
c_upper = [0] * 2
for i in range(0,2):
c_upper[i] = make_ellipsoid(0, 0+i, a_upper[2] + 0.1, *a_upper)
gmsh.model.mesh.set_size([(3,c_upper[i])],10)
gmsh.model.occ.synchronize()
gmsh.model.mesh.generate(3)
# Launch the GUI to see the results:
if '-nopopup' not in sys.argv:
gmsh.fltk.run()
gmsh.finalize()
I thought "gmsh.model.mesh.set_size([(3,c_upper[i])],10)" command and value "10" control the size of mesh. But it didn't work.
What did I miss? I'd like to have more smoother ellipsoids.
Also, if I generate the volumetric mesh on those ellipsoids, are those merged automatically? or do I have to set some conditions?
I appreciate your help.
Sincerely, Hokon Kim