[cig-commits] r18387 - in seismo/3D/FAULT_SOURCE/branches/new_fault_db: . CUBIT
percygalvez at geodynamics.org
percygalvez at geodynamics.org
Tue May 17 00:21:42 PDT 2011
Author: percygalvez
Date: 2011-05-17 00:21:41 -0700 (Tue, 17 May 2011)
New Revision: 18387
Added:
seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/open_crack.py
seismo/3D/FAULT_SOURCE/branches/new_fault_db/lap_to_bigstar01
Log:
meshing splay faults
Added: seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/open_crack.py
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/open_crack.py (rev 0)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/open_crack.py 2011-05-17 07:21:41 UTC (rev 18387)
@@ -0,0 +1,57 @@
+# Opening fault cracks
+# Input : surface up and down.
+def open_crack(id,surface_up,surface_down)
+
+ import cubit
+ import os
+ import sys
+
+ fault_id = id
+ fault_u = surface_up # fault surface up
+ fault_d = surface_down # fault surface down
+ txt =''
+ fault_name = 'MESH/fault_file_'+str(fault_id)+'.dat'
+ fault_file=open(fault_name,'w')
+
+
+ list_hex=cubit.parse_cubit_list('hex','all')
+
+ quads_fault_u = cubit.get_surface_quads(fault_u)
+ quads_fault_d = cubit.get_surface_quads(fault_d)
+
+ # TO DO : stop python properly in case fault nodes at both sides
+ # do not match.
+ if len(quads_fault_u) != len(quads_fault_d):
+ stop
+ # Writting number of elements at both sides to make
+ # double sure everything is going fine .
+ txt='%10i %10i\n' % (len(quads_fault_u),len(quads_fault_d))
+ fault_file.write(txt)
+
+ dic_quads_fault_u = dict(zip(quads_fault_u,quads_fault_u))
+ dic_quads_fault_d = dict(zip(quads_fault_d,quads_fault_d))
+
+ # FAULT SIDE UP
+ for h in list_hex:
+ faces = cubit.get_sub_elements('hex',h,2)
+ for f in faces:
+ if dic_quads_fault_u.has_key(f):
+ nodes=cubit.get_connectivity('Face',f)
+ # print 'h,fault nodes side up :',h,nodes[0],nodes[1],nodes[2],nodes[3]
+ txt='%10i %10i %10i %10i %10i\n' % (h,nodes[0],\
+ nodes[1],nodes[2],nodes[3])
+ fault_file.write(txt)
+
+ # FAULT SIDE DOWN
+ for h in list_hex:
+ faces = cubit.get_sub_elements('hex',h,2)
+ for f in faces:
+ if dic_quads_fault_d.has_key(f):
+ nodes=cubit.get_connectivity('Face',f)
+ # print 'h,fault nodes side down :',h,nodes[0],nodes[1],nodes[2],nodes[3]
+ txt='%10i %10i %10i %10i %10i\n' % (h,nodes[0],\
+ nodes[1],nodes[2],nodes[3])
+ fault_file.write(txt)
+
+ # CLOSING FAULT FILE
+ fault_file.close()
Added: seismo/3D/FAULT_SOURCE/branches/new_fault_db/lap_to_bigstar01
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/lap_to_bigstar01 (rev 0)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/lap_to_bigstar01 2011-05-17 07:21:41 UTC (rev 18387)
@@ -0,0 +1,6 @@
+rsync -avuze ssh --delete . galvez at bigstar01.ethz.ch:~/FAULT_SOURCE/
+
+## v : verbose , u : preserve newer existing files from overwritting.
+## b : backup existing files before overwritting.
+## e : allows to do remote login ssh.
+## delete : delete different files
Property changes on: seismo/3D/FAULT_SOURCE/branches/new_fault_db/lap_to_bigstar01
___________________________________________________________________
Name: svn:executable
+ *
More information about the CIG-COMMITS
mailing list