[cig-commits] r22972 - seismo/3D/SPECFEM3D/trunk/CUBIT_GEOCUBIT/geocubitlib
emanuele at geodynamics.org
emanuele at geodynamics.org
Thu Oct 31 06:08:24 PDT 2013
Author: emanuele
Date: 2013-10-31 06:08:23 -0700 (Thu, 31 Oct 2013)
New Revision: 22972
Modified:
seismo/3D/SPECFEM3D/trunk/CUBIT_GEOCUBIT/geocubitlib/cubit2specfem3d.py
Log:
update geocubit before moving to github
Modified: seismo/3D/SPECFEM3D/trunk/CUBIT_GEOCUBIT/geocubitlib/cubit2specfem3d.py
===================================================================
--- seismo/3D/SPECFEM3D/trunk/CUBIT_GEOCUBIT/geocubitlib/cubit2specfem3d.py 2013-10-23 14:27:26 UTC (rev 22971)
+++ seismo/3D/SPECFEM3D/trunk/CUBIT_GEOCUBIT/geocubitlib/cubit2specfem3d.py 2013-10-31 13:08:23 UTC (rev 22972)
@@ -358,7 +358,12 @@
else:
self.face='QUAD4'
self.hex='HEX'
- self.hex27=hex27
+ if version_cubit <= 13:
+ if hex27:
+ print "ATTENTION **********************\n\nCubit <= 12.2 doesn't support HEX27\nassuming HEX8 .....\n\n"
+ self.hex27=False
+ else:
+ self.hex27=hex27
self.edge='BAR2'
self.topo='face_topo'
self.topography=None
@@ -539,6 +544,7 @@
cubit.silent_cmd('group "nh" add Node in hex '+str(ind))
group1 = cubit.get_id_from_name("nh")
result=cubit.get_group_nodes(group1)
+ if len(result) != 27: print 'error hex27'
cubit.cmd('del group '+str(group1))
else:
result=cubit.get_connectivity('hex',ind)
@@ -603,12 +609,51 @@
#
#print txt
return txt
- def nummaterial_write(self,nummaterial_name):
+ def nummaterial_write(self,nummaterial_name,placeholder=True):
print 'Writing '+nummaterial_name+'.....'
nummaterial=open(nummaterial_name,'w')
for block in self.block_mat:
#name=cubit.get_exodus_entity_name('block',block)
nummaterial.write(str(self.mat_parameter(self.material[block])))
+ if placeholder:
+ txt='''
+
+
+
+! note: format of nummaterial_velocity_file must be
+
+
+! #(1)material_domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_kappa #(7)Q_mu #(8)anisotropy_flag
+!
+! where
+! material_domain_id : 1=acoustic / 2=elastic
+! material_id : POSITIVE integer identifier corresponding to the identifier of material block
+! rho : density
+! vp : P-velocity
+! vs : S-velocity
+! Q_kappa : 9999 = no Q_kappa attenuation
+! Q_mu : 9999 = no Q_mu attenuation
+! anisotropy_flag : 0=no anisotropy/ 1,2,.. check with implementation in aniso_model.f90
+!
+!example:
+!2 1 2300 2800 1500 9999.0 9999.0 0
+
+!or
+
+! #(1)material_domain_id #(2)material_id tomography elastic #(3)tomography_filename #(4)positive_unique_number
+!
+! where
+! material_domain_id : 1=acoustic / 2=elastic
+! material_id : NEGATIVE integer identifier corresponding to the identifier of material block
+! tomography_filename: filename of the tomography file
+! positive_unique_number: a positive unique identifier
+!
+!example:
+!2 -1 tomography elastic tomo.xyz 1
+
+
+'''
+ nummaterial.write(txt)
nummaterial.close()
def create_hexnode_string(self,hexa):
More information about the CIG-COMMITS
mailing list