[cig-commits] r21089 - in seismo/3D/FAULT_SOURCE/branches/new_fault_db: CUBIT src
ampuero at geodynamics.org
ampuero at geodynamics.org
Thu Nov 29 10:36:29 PST 2012
Author: ampuero
Date: 2012-11-29 10:36:29 -0800 (Thu, 29 Nov 2012)
New Revision: 21089
Modified:
seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/functions.py
seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_dynamic.f90
seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_kinematic.f90
Log:
fixed m2km
Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/functions.py
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/functions.py 2012-11-29 18:04:27 UTC (rev 21088)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/CUBIT/functions.py 2012-11-29 18:36:29 UTC (rev 21089)
@@ -56,6 +56,14 @@
file.close()
return nodes_u,nodes_d
+# INPUTS :
+#file_nodes_coord = 'MESH/nodes_coords_file'
+#fault_file = 'MESH/fault_file_1.dat'
+# OUTPUTS :
+#name_out = 'MESH/nodes_coords_file_open_fault'
+#fsideu = 'MESH/fault_sideu.dat'
+#fsided = 'MESH/fault_sided.dat'
+#nodes_coords_fault_open(file_nodes_coord,fault_file,name_out,fsideu,fsided,delta)
def nodes_coords_fault_open(file_nodes_coord,fault_file,name_out,fsideUP,fsideDW,delta):
x=[]
y=[]
@@ -99,51 +107,25 @@
# and larger than SMALLVAL_TOL defined in constants.h (usually SMALLVAL_TOL=1.d-10*dabs(UTM_X_MAX - UTM_X_MIN))
def m2km():
- name_in = 'MESH/nodes_coords_file'
- name_out = 'MESH/nodes_coords_file'
- txt =''
- km = 1000
- input_file = open(name_in,'r')
- output_file = open(name_out,'w')
- nnodes = input_file.readline()
- nodes_num = int(nnodes)
- output_file.write('%10i\n' % nodes_num)
- nodes_list = input_file.readlines()
- nodes = []
- for node in nodes_list:
- nodes = node.split()
- node_id = int(nodes[0])
- x= float(nodes[1])*km
- y= float(nodes[2])*km
- z= float(nodes[3])*km
- txt=('%10i %20f %20f %20f\n') % (node_id,x,y,z)
- output_file.write(txt)
- output_file.close()
- return
-
-# Runing functions ####
-#m2km()
-
-# INPUTS :
-#file_nodes_coord = 'MESH/nodes_coords_file'
-#fault_file = 'MESH/fault_file_1.dat'
-# OUTPUTS :
-#name_out = 'MESH/nodes_coords_file_open_fault'
-#fsideu = 'MESH/fault_sideu.dat'
-#fsided = 'MESH/fault_sided.dat'
-#nodes_coords_fault_open(file_nodes_coord,fault_file,name_out,fsideu,fsided,delta)
-
-#import numpy as np
-#def find_nearest(array,value):
-# idx=(np.abs(array-value)).argmin()
-# return array[idx]
-
-#array=np.random.random(10)
-#print(array)
-# [ 0.21069679 0.61290182 0.63425412 0.84635244 0.91599191 0.00213826
-# 0.17104965 0.56874386 0.57319379 0.28719469]
-
-#value=0.5
-
-#print(find_nearest(array,value))
-
+ name_in = 'MESH/nodes_coords_file'
+ name_out = 'MESH/nodes_coords_file'
+ txt =''
+ km = 1000
+ input_file = open(name_in,'r')
+ nnodes = input_file.readline()
+ nodes_list = input_file.readlines()
+ input_file.close()
+ output_file = open(name_out,'w')
+ nodes_num = int(nnodes)
+ output_file.write('%10i\n' % nodes_num)
+ nodes = []
+ for node in nodes_list:
+ nodes = node.split()
+ node_id = int(nodes[0])
+ x= float(nodes[1])*km
+ y= float(nodes[2])*km
+ z= float(nodes[3])*km
+ txt=('%10i %20f %20f %20f\n') % (node_id,x,y,z)
+ output_file.write(txt)
+ output_file.close()
+ return
Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_dynamic.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_dynamic.f90 2012-11-29 18:04:27 UTC (rev 21088)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_dynamic.f90 2012-11-29 18:36:29 UTC (rev 21089)
@@ -11,11 +11,10 @@
module fault_solver_dynamic
use fault_solver_common
+ use constants
implicit none
- include 'constants.h'
-
private
! outputs(dyn) /inputs (kind) at selected times for all fault nodes:
Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_kinematic.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_kinematic.f90 2012-11-29 18:04:27 UTC (rev 21088)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_kinematic.f90 2012-11-29 18:36:29 UTC (rev 21089)
@@ -6,11 +6,10 @@
module fault_solver_kinematic
use fault_solver_common
+ use constants
implicit none
- include 'constants.h'
-
private
! outputs(dyn) /inputs (kind) at selected times for all fault nodes:
More information about the CIG-COMMITS
mailing list