#!python #!python import sys import os sys.path.append(r"C:\Program Files\Cubit 15.6\bin") import cubit cubit.init([]) cubit.reset() cubit.cmd("${Units('si')}") cubit.cmd("set stop error on") cubit.cmd("undo off") cubit.cmd("set warning on") cubit.cmd("set echo on") cubit.cmd("set info on") cubit.cmd("set acisoption integer 'check_level' 70") cubit.cmd("Graphics Composite off") cubit.cmd("set keep invalid mesh on") cubit.cmd("set maximum memory off") #delete mesh cubit.cmd("volume all interval soft") cubit.cmd("surface all interval soft") cubit.cmd("curve all interval soft") #os.chdir("") ##### faultWidth=2000 faultHeigth=2000 volumeLength=10000 cubit.cmd(f"create surface rectangle width {faultWidth} height {faultHeigth} zplane") cubit.cmd("rotate Surface 1 angle -60 about Y include_merged") cubit.cmd(f"brick x {volumeLength} y {volumeLength} z {volumeLength}") bodyIdDomain=2 bodyIdFault=1 cubit.cmd(f'subtract body {bodyIdFault} from body {bodyIdDomain}') #cubit.cmd("imprint all") cubit.cmd("merge all") cubit.cmd(f"move Volume 3 z {-volumeLength/2} include_merged") cubit.cmd(f"move Volume 3 x {volumeLength/2} include_merged") cubit.cmd(f"move Volume 3 y {volumeLength/2} include_merged") cubit.cmd(f"reset volume all") faultSurfaceId=8 faultSurfaceSize=20 volumeSize=150 ## This works fine #cubit.cmd("surface all scheme trimesh") #cubit.cmd(f"surface {faultSurfaceId} size {faultSurfaceSize}") #cubit.cmd(f"mesh surface {faultSurfaceId}") #cubit.cmd("volume all tetmesh growth 2") #cubit.cmd("volume all scheme tetmesh") #cubit.cmd(f"volume all size {volumeSize}") ## This does not owrks cubit.cmd("volume all scheme submap") cubit.cmd("Set Submap CornerPicking off") cubit.cmd(f"volume all size {volumeSize}") cubit.cmd("mesh volume 3") cubit.cmd(f"quality volume all condition no ") cubit.cmd(f"quality volume all aspect ratio ")