#### Define material properties for the 4 volumes ################ cubit.cmd('#### DEFINE MATERIAL PROPERTIES #######################') for i in range(Vol_num): cubit.cmd('block {0} name "elastic {0}" '.format(i + 1)) # material region cubit.cmd('block {0} attribute count {1}'.format(i + 1, 6)) cubit.cmd('block {0} attribute index 1 1'.format(i + 1)) cubit.cmd('block {0} attribute index 2 {1}'.format(i + 1, vp)) # vp cubit.cmd('block {0} attribute index 3 {1}'.format(i + 1, vs)) # vs cubit.cmd('block {0} attribute index 4 {1}'.format(i + 1, rho)) # rho cubit.cmd('block {0} attribute index 5 {1}'.format( i + 1, Q)) # Q flag (see constants.h: #IATTENUATION_ ... ) cubit.cmd('block {0} attribute index 6 0'.format( i + 1)) # q flag (see constants.h: iattenuation_ ... ) #### Export to SPECFEM3D format using cubit2specfem3d.py of GEOCUBIT if (element_type == "HEX27"): cubit2specfem3d.export2SPECFEM3D('MESH', hex27=True) else: cubit2specfem3d.export2SPECFEM3D('MESH') # You need to create fault mesh file in the last, if using hex27. faultA = save_fault_nodes_elements.fault_input(1, Au, Ad) print "Save created mesh..." # Save create directory as given name os.system('rm -rf output/' + output_mesh) os.system('mv MESH output/' + output_mesh) # End of script
cubit.cmd("volume 1 size "+str(elementsize)) cubit.cmd("surface 1 scheme pave") cubit.cmd("mesh surface 1") cubit.cmd("mesh volume 1") cubit.cmd("unmerge surface 2 3") ########### Fault elements and nodes ############### os.system('mkdir -p MESH') # fault surfaces (up/down) Au = [2] Ad = [3] faultA = save_fault_nodes_elements.fault_input(1,Au,Ad) # FOR THE BULK (Seismic wave propagation part for SPECFEM3D) ###### This is boundary_definition.py of GEOCUBIT #..... which extracts the bounding faces and defines them into blocks #entities=['face'] # this is a deprecated boundary definition function #boundary_definition.define_bc(entities,parallel=True) entities=['face'] absorbing_boundary.define_parallel_bc(entities) # in absorbing_boundary.py #### Define material properties for the 2 volumes ################ cubit.cmd('#### DEFINE MATERIAL PROPERTIES #######################') # Material properties in concordance with tpv5 benchmark.