Nevermind, I found example code in the "tutorial_emlf_unstructured_neuron_electroceuticals.py" example file, see below:
def CreateMesh():
""" Creates a Multidomain Mesh with predefined priorities between domains
and specified global and local options """
sel=.05 # Suface Edge Length
mel=.002 # Min Edge Length
#create multi-domain mesh
global_opt = xcm.GlobalUnstructuredMeshingOptions()
global_opt.SurfaceEdgeLength = sel
global_opt.MinEdgeLength = mel
# Gets all the entities in the folder 'Nerve_Model'
entities=s4l.model.AllEntities()['Nerve_Model'].Entities
local_opt_dict={}
for ent in entities:
local_opt = xcm.LocalUnstructuredMeshingOptions()
print((ent, ent.Name))
if 'Saline' in ent.Name :
local_opt.Priority=0
elif 'Silicone' in ent.Name :
local_opt.Priority=1
elif 'Electrode' in ent.Name :
local_opt.Priority=2
elif 'Nerve' in ent.Name :
local_opt.Priority=3
elif 'Interstitial' in ent.Name :
local_opt.Priority=4
elif 'Connective' == ent.Name :
local_opt.Priority=5
elif 'Connective_' in ent.Name :
local_opt.Priority=5
elif 'Blood' in ent.Name :
local_opt.Priority=6
elif 'Fascicle' in ent.Name :
local_opt.Priority=7
local_opt_dict[ent]=local_opt
print((local_opt.Priority))
# Creates an unstructured mesh on the domains using the defined options
mesh = xcm.GenerateUnstructuredMesh(entities, global_opt, local_opt_dict)
return
I did have a followup, how do we optimize the surface edge length and minimum edge lengths?