[cig-commits] r22090 - seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides

carltape at geodynamics.org carltape at geodynamics.org
Fri May 17 03:29:20 PDT 2013


Author: carltape
Date: 2013-05-17 03:29:20 -0700 (Fri, 17 May 2013)
New Revision: 22090

Modified:
   seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/block_mesh.py
   seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/cubit2specfem3d.py
Log:
updated homogeneous_halfspace python scripts for cubit, based on the extra Qkappa column that is needed in nummaterial_velocity_file


Modified: seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/block_mesh.py
===================================================================
--- seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/block_mesh.py	2013-05-16 22:43:48 UTC (rev 22089)
+++ seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/block_mesh.py	2013-05-17 10:29:20 UTC (rev 22090)
@@ -31,13 +31,14 @@
 
 
 cubit.cmd('block 1 name "elastic 1" ')        # elastic material region
-cubit.cmd('block 1 attribute count 6')
+cubit.cmd('block 1 attribute count 7')
 cubit.cmd('block 1 attribute index 1 1')      # flag for material: 1 for 1. material
 cubit.cmd('block 1 attribute index 2 2800')   # vp
 cubit.cmd('block 1 attribute index 3 1500')   # vs
 cubit.cmd('block 1 attribute index 4 2300')   # rho
-cubit.cmd('block 1 attribute index 5 9000.0')  # Qmu
-cubit.cmd('block 1 attribute index 6 0 ')      # anisotropy_flag
+cubit.cmd('block 1 attribute index 5 9999.0')  # Qkappa
+cubit.cmd('block 1 attribute index 6 9999.0')  # Qmu
+cubit.cmd('block 1 attribute index 7 0 ')      # anisotropy_flag
 
 
 #cubit.cmd('block 1 name "acoustic 1" ')       # acoustic material region

Modified: seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/cubit2specfem3d.py
===================================================================
--- seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/cubit2specfem3d.py	2013-05-16 22:43:48 UTC (rev 22089)
+++ seismo/3D/SPECFEM3D/trunk/examples/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/cubit2specfem3d.py	2013-05-17 10:29:20 UTC (rev 22090)
@@ -416,9 +416,16 @@
                             if q < 0 :
                               print 'error, q value invalid:', q
                               break
-                            if nattrib == 6:
-                              #anisotropy_flag
-                              ani=cubit.get_block_attribute_value(block,5)
+			    if nattrib >= 6:
+                               #Q_kappa
+                               q2=cubit.get_block_attribute_value(block,5)
+                               # for q to be valid: it must be positive
+                               if q2 < 0 :
+                                  print 'error, q value invalid:', q2
+                                  break
+                               if nattrib == 7:
+                                  #anisotropy_flag
+                                  ani=cubit.get_block_attribute_value(block,6)
                     elif flag < 0:
                         # velocity model
                         vel=name
@@ -431,11 +438,11 @@
                             kind='tomography'
                 else:
                     flag=block
-                    vel,vs,rho,q,ani=(name,0,0,0,0)
+                    vel,vs,rho,q,q2,ani=(name,0,0,0,0,0)
                 block_flag.append(int(flag))
                 block_mat.append(block)
                 if flag > 0:
-                    par=tuple([imaterial,flag,vel,vs,rho,q,ani])
+                    par=tuple([imaterial,flag,vel,vs,rho,q,q2,ani])
                 elif flag < 0:
                     if kind=='interface':
                         par=tuple([imaterial,flag,kind,name,flag_down,flag_up])
@@ -514,8 +521,8 @@
             elif type(vel) != str:
                 # velocity model given as vp,vs,rho,..
                 #format nummaterials file: #material_domain_id #material_id #rho #vp #vs #Q_mu #anisotropy_flag
-                txt='%1i %3i %20f %20f %20f %20f %2i\n' % (properties[0],properties[1],properties[4], \
-                         properties[2],properties[3],properties[5],properties[6])
+                txt='%1i %3i %20f %20f %20f %20f %20f %2i\n' % (properties[0],properties[1],properties[4], \
+                         properties[2],properties[3],properties[5],properties[6],properties[7])
             else:
                 txt='%1i %3i %s \n' % (properties[0],properties[1],properties[2])
         elif flag < 0:



More information about the CIG-COMMITS mailing list