[cig-commits] r19139 - seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT
percygalvez at geodynamics.org
percygalvez at geodynamics.org
Tue Nov 1 06:26:14 PDT 2011
Author: percygalvez
Date: 2011-11-01 06:26:14 -0700 (Tue, 01 Nov 2011)
New Revision: 19139
Modified:
seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/functions.py
Log:
shifting fault nodes delta = 0.5
Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/functions.py
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/functions.py 2011-11-01 11:57:38 UTC (rev 19138)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/functions.py 2011-11-01 13:26:14 UTC (rev 19139)
@@ -25,7 +25,6 @@
nnodes_d = int(nside_ud[1])
nodes_u=[]
nodes_d=[]
-
for i in range(nnodes_u):
hnodes = file.readline()
hnodesplit = hnodes.split()
@@ -42,16 +41,15 @@
nodes_d.append(int(hnodesplit[3]))
nodes_d.append(int(hnodesplit[4]))
- nodes_d = set(nodes_d) # save unique fault nodes side u
- nodes_u = set(nodes_u) # save unique fault nodes side d
+ nodes_d = set(nodes_d) # save unique fault nodes side u
+ nodes_u = set(nodes_u) # save unique fault nodes side d
ncommond = nodes_u&nodes_d # glue nodes .
nodes_d = nodes_d^ncommond # saving only split nodes side d
nodes_u = nodes_u^ncommond # saving only split nodes side u
-
file.close()
return nodes_u,nodes_d
-def nodes_coords_fault_open(file_nodes_coord,fault_file,name_out,fside1,fside2):
+def nodes_coords_fault_open(file_nodes_coord,fault_file,name_out,fside1,fside2,delta):
x=[]
y=[]
z=[]
@@ -66,14 +64,17 @@
node,x,y,z = read_nodes_coord_file(file_nodes_coord)
output_file.write('%10i\n' % len(node))
node_u,node_d = read_fault_nodes(fault_file)
+
for i in range(len(node)):
if node[i] in node_u:
- z[i] = z[i] + 500.0
+ z[i] = z[i] + delta/2.0
+ # x[i] = x[i] + delta/2.0
print "node_u",node[i]
txt_fault=('%10i %20f %20f %20f\n') % (node[i],x[i],y[i],z[i])
fsideu.write(txt_fault)
if node[i] in node_d:
- z[i] = z[i] - 500.0
+ z[i] = z[i] - delta/2.0
+ # x[i] = x[i] - delta/2.0
print "node_d",node[i]
txt_fault=('%10i %20f %20f %20f\n') % (node[i],x[i],y[i],z[i])
fsided.write(txt_fault)
@@ -85,14 +86,21 @@
fsided.close()
return
+# INPUTS :
file_nodes_coord = 'MESH/nodes_coords_file'
+fault_file ='MESH/fault_file_1.dat'
+# OUTPUTS :
name_out = 'nodes_coords_file_open_fault'
-fault_file ='MESH/fault_file_1.dat'
fsideu = 'fault_sideu.dat'
fsided = 'fault_sided.dat'
-nodes_coords_fault_open(file_nodes_coord,fault_file,name_out,fsideu,fsided)
+delta = 0.5 # Make sure that this delta is in coorcondance with
+ # FAULT_GAP_TOLERANCE which is normally set up to 1.0d0 but can be changed
+ # in decompose_mesh_SCOTH/fault_scotch.f90, and higher
+ # than constants.h/SMALLVAL_TOL = 1.d-10 used by the routine get_global.f90
+nodes_coords_fault_open(file_nodes_coord,fault_file,name_out,fsideu,fsided,delta)
+
def m2km(name_in,name_out):
txt =''
km = 1000
@@ -115,6 +123,7 @@
output_file.close()
return
+
#name_in = 'MESH/nodes_coords_file_km'
#name_out= 'nodes_coords_file'
#m2km(name_in,name_out)
More information about the CIG-COMMITS
mailing list