예제 #1
0
cubit.cmd('block 19 name "elastic 19" ')        # material region  
cubit.cmd('block 19 attribute count 5') 
cubit.cmd('block 19 attribute index 1 1')      # flag for fault side 1 
cubit.cmd('block 19 attribute index 2 5800')   # vp 
cubit.cmd('block 19 attribute index 3 3420')    # vs 
cubit.cmd('block 19 attribute index 4 2700')   # rho 
cubit.cmd('block 19 attribute index 5 13')     # Q flag (see constants.h: IATTENUATION_ ... )

cubit.cmd('block 20 name "elastic 20" ')        # material region  
cubit.cmd('block 20 attribute count 5') 
cubit.cmd('block 20 attribute index 1 1')      # flag for fault side 1 
cubit.cmd('block 20 attribute index 2 5800')   # vp 
cubit.cmd('block 20 attribute index 3 3420')    # vs 
cubit.cmd('block 20 attribute index 4 2700')   # rho 
cubit.cmd('block 20 attribute index 5 13')     # Q flag (see constants.h: IATTENUATION_ ... )

#### Export to SESAME format using cubit2specfem3d.py of GEOCUBIT 
 
cubit2specfem3d.export2SESAME('MESH') 


m2km('MESH/nodes_coords_file','')


### this mesh is in km . It is more convinient to work in meters 
### changing nodes_coords_file to meters . 

 
# all files needed by SCOTCH are now in directory MESH 

cubit.cmd('block 2 attribute count 6')
cubit.cmd('block 2 attribute index 1 2  ')      # volume 2
cubit.cmd('block 2 attribute index 2 7500 ')
cubit.cmd('block 2 attribute index 3 4300 ')
cubit.cmd('block 2 attribute index 4 3200 ')
cubit.cmd('block 2 attribute index 5 9000.0 ')
cubit.cmd('block 2 attribute index 6 0 ')     # anisotropy_flag

cubit.cmd('block 3 name "elastic 3" ')        # elastic material region
cubit.cmd('block 3 attribute count 6')
cubit.cmd('block 3 attribute index 1 3  ')      # same properties as for volume 2
cubit.cmd('block 3 attribute index 2 7500 ')
cubit.cmd('block 3 attribute index 3 4300 ')
cubit.cmd('block 3 attribute index 4 3200 ')
cubit.cmd('block 3 attribute index 5 9000.0 ')
cubit.cmd('block 3 attribute index 6 0 ')     # anisotropy_flag

cubit.cmd('export mesh "top.e" dimension 3 overwrite')
cubit.cmd('save as "meshing.cub" overwrite')

#### Export to SESAME format using cubit2specfem3d.py of GEOCUBIT

os.system('mkdir -p MESH')
cubit2specfem3d.export2SESAME('MESH')

# all files needed by SCOTCH are now in directory MESH




boundary_definition.define_bc(boundary_definition.entities, parallel=True)

#### Define material properties for the 3 volumes ################
cubit.cmd("#### DEFINE MATERIAL PROPERTIES #######################")
cubit.cmd('block 1 name "acoustic 1" ')  # material region
cubit.cmd("block 1 attribute count 4")
cubit.cmd("block 1 attribute index 1 1")  # flag for material: 1 for 1. material
cubit.cmd("block 1 attribute index 2 3000")  # vp
cubit.cmd("block 1 attribute index 3 0")  # vs
cubit.cmd("block 1 attribute index 4 2300")  # rho

cubit.cmd('block 2 name "elastic 1" ')  # material region
cubit.cmd("block 2 attribute count 6")
cubit.cmd("block 2 attribute index 1 2")  # flag for material: 2 for 2. material
cubit.cmd("block 2 attribute index 2 3000")  # vp
cubit.cmd("block 2 attribute index 3 0.1")  # vs
cubit.cmd("block 2 attribute index 4 2300")  # rho
cubit.cmd("block 2 attribute index 5 9000.0")  # Q_mu
cubit.cmd("block 2 attribute index 6 0 ")  # anisotropy_flag


cubit.cmd('export mesh "top.e" dimension 3 overwrite')
cubit.cmd('save as "meshing.cub" overwrite')

#### Export to SESAME format using cubit2specfem3d.py of GEOCUBIT

os.system("mkdir -p MESH")
cubit2specfem3d.export2SESAME("MESH")

# all files needed by SCOTCH are now in directory MESH