[cig-commits] r21065 - in seismo/3D/FAULT_SOURCE/branches/new_fault_db: . EXAMPLES/tpv5 decompose_mesh_SCOTCH src

ampuero at geodynamics.org ampuero at geodynamics.org
Thu Nov 22 10:21:50 PST 2012


Author: ampuero
Date: 2012-11-22 10:21:50 -0800 (Thu, 22 Nov 2012)
New Revision: 21065

Modified:
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/EXAMPLES/tpv5/tpv5.py
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/README_SPECFEM3D_FAULT
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/fault_scotch.f90
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_generate_databases.f90
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_common.f90
Log:
edited doc of cubit-python functions; enabled PARALLEL_FAULT by default in solver; added a note in the three places where PARALLE_FAULT needs to be set

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/EXAMPLES/tpv5/tpv5.py
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/EXAMPLES/tpv5/tpv5.py	2012-11-21 22:32:54 UTC (rev 21064)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/EXAMPLES/tpv5/tpv5.py	2012-11-22 18:21:50 UTC (rev 21065)
@@ -6,6 +6,8 @@
 import math
 import os
 import sys
+from save_fault_nodes_elements import *
+
 cubit.cmd('reset')
 
 km = 1000

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/README_SPECFEM3D_FAULT
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/README_SPECFEM3D_FAULT	2012-11-21 22:32:54 UTC (rev 21064)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/README_SPECFEM3D_FAULT	2012-11-22 18:21:50 UTC (rev 21065)
@@ -127,36 +127,65 @@
 Here is an example Cubit script to generate a mesh with split nodes
 for a buried vertical strike-slip fault:
 
-reset
-brick x 10 y 10 z 10
-webcut volume all with plane xplane
-webcut volume all with plane yplane
-webcut volume all with plane xplane offset 3
-webcut volume all with plane zplane offset 3
-webcut volume all with plane zplane offset -3
-imprint all
-merge all
-unmerge surf 160
-mesh vol all
-set node constraint off
-node in surf 168 move X 0 Y 0.01 Z 0
-node in surf 160 move X 0 Y -0.01 Z 0
+  reset
+  brick x 10 y 10 z 10
+  webcut volume all with plane xplane
+  webcut volume all with plane yplane
+  webcut volume all with plane xplane offset 3
+  webcut volume all with plane zplane offset 3
+  webcut volume all with plane zplane offset -3
+  imprint all
+  merge all
+  unmerge surf 160
+  mesh vol all
+  set node constraint off
+  node in surf 168 move X 0 Y 0.01 Z 0
+  node in surf 160 move X 0 Y -0.01 Z 0
 
-For more complicated meshes, please refer to the Cubit scripts (*.jou and *.py) in EXAMPLES.
+The Cubit scripts (*.jou and *.py) in the directory EXAMPLES generate more complicated meshes.
+The *.py files are Python scripts that execute Cubit commands and use the Cubit-python interface 
+for SPECFEM3D (see next section). The Python language allows to define and manipulate variables 
+to parameterize the mesh. Alternatively, the Python script can call a Cubit journal file (*.jou), 
+which looks like the example above. Variables can be defined and manipulated there using the 
+APREPRO language built in Cubit.
 
-CUBIT-PYTHON SCRIPTS FOR FAULT
-------------------------------
 
-For each fault, one needs to make a list of all surfaces that form each edge of the fault and call the function fault_input with a number corresponding to the fault along with the list of edges of both faults. The number given to fault_input should start from unity going up by one for each additional fault.
 
-For the example is above section, this is how one would call the function fault_input
-Au = [168]   # A_up
-Ad = [160]  # A_down
-faultA = fault_input(1,Au,Ad)
+CUBIT-PYTHON SCRIPTS FOR FAULTS
+-------------------------------
 
-The above lines generate a one file per fault "fault_file_1.dat", in additional to the regular files written from Cubit for bulk mesh.  The file numbers should increase sequentially for meshes with multiple faults. 
+The mesh generated in Cubit needs to be processed and exported in a format compatible with SPECFEM3D.
+This is achieved in the Python scripts by calling the Python-Cubit interface functions
+defined in the CUBIT directory: 
+1. Function "define_bc" (or similar ones) must be called to set up the absorbing boundaries database
+2. Function "fault_input" must be called once for each fault to set up the fault database 
+3. Function "cubit2specfem3d.export2SESAME" must be called at the very end of the script to export the
+   mesh in a SPECFEM3D format.
+The functions in #1 and #3 are part of the main SPECFEM3D-SESAME distribution and are not documented here. 
+We focus here on #2:
 
+  Function:	fault_input
+  Purpose:	export a fault mesh database from Cubit to a SPECFEM3D-compliant file
+  Syntax:	fault_input(id_fault, ids_surf_1, ids_surf_2)
 
+  Inputs: 	id_fault	integer index assigned to the fault. 
+				The user must number all the faults, starting at 1, with unit increments.
+		ids_surf_1	list of Cubit ids of all surfaces that form side 1 of the fault 
+ 		ids_surf_2	list of Cubit ids of all surfaces that form side 2 of the fault 
+				The user must decide which side of the fault is side 1. 
+				This choice affects the sign conventions of fault quantities 
+				as explained in a later section.
+
+  Outputs:	file "fault_file_X.dat", where X is the fault id (id_fault).
+
+  Example:	For the example in the previous section:
+
+  		A1 = [168]
+ 	  	A2 = [160] 
+ 		faultA = fault_input(1,A1,A2)
+
+
+
 RUNNING A SIMULATION
 ---------------------
 
@@ -269,7 +298,6 @@
 
 
 
-
 SIGN CONVENTION FOR FAULT QUANTITIES
 -------------------------------------
 

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/fault_scotch.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/fault_scotch.f90	2012-11-21 22:32:54 UTC (rev 21064)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/fault_scotch.f90	2012-11-22 18:21:50 UTC (rev 21065)
@@ -14,7 +14,10 @@
   type(fault_type), allocatable, save :: faults(:) 
   double precision, dimension(:,:), allocatable, save :: nodes_coords_open
   logical, save :: ANY_FAULT = .false.
+
   logical, parameter :: PARALLEL_FAULT = .false.
+ ! NOTE: PARALLEL_FAULT has to be the same 
+ !       in fault_solver_common.f90, fault_generate_databases.f90 and fault_scotch.f90
  
   integer, parameter :: long = SELECTED_INT_KIND(18)
 
@@ -46,6 +49,8 @@
   if (.not. ANY_FAULT)  return  
 
   allocate(faults(nbfaults))
+ ! NOTE: asumes that the fault ids follow a contiguous numbering, starting at 1, with unit increment
+ !       The user must assign that numbering during mesh generation
   do iflt = 1 , nbfaults 
    call read_single_fault_file(faults(iflt),iflt,localpath_name)
   enddo

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_generate_databases.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_generate_databases.f90	2012-11-21 22:32:54 UTC (rev 21064)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_generate_databases.f90	2012-11-22 18:21:50 UTC (rev 21065)
@@ -1,32 +1,12 @@
-!=====================================================================
+! Generates database for faults (dynamic or kinematic)
 !
-!               s p e c f e m 3 d  v e r s i o n  1 . 4
-!               ---------------------------------------
+! Splitting fault nodes (with opening) is done in CUBIT. 
+! See sections "Mesh generation with split nodes"
+! and "Cubit-python scripts for faults" in the README_SPECFEM3D_FAULT file.
 !
-!                 dimitri komatitsch and jeroen tromp
-!    seismological laboratory - california institute of technology
-!         (c) california institute of technology september 2006
-!
-! this program is free software; you can redistribute it and/or modify
-! it under the terms of the gnu general public license as published by
-! the free software foundation; either version 2 of the license, or
-! (at your option) any later version.
-!
-! this program is distributed in the hope that it will be useful,
-! but without any warranty; without even the implied warranty of
-! merchantability or fitness for a particular purpose.  see the
-! gnu general public license for more details.
-!
-! you should have received a copy of the gnu general public license along
-! with this program; if not, write to the free software foundation, inc.,
-! 51 franklin street, fifth floor, boston, ma 02110-1301 usa.
-!
-!===============================================================================================================
-! This module was written by:
+! Authors:
 ! Percy Galvez, Jean-Paul Ampuero and Tarje Nissen-Meyer
 
-! Splitting fault nodes is done in CUBIT.
-
 module fault_generate_databases
   
   use create_regions_mesh_ext_par, only: NGLLX,NGLLY,NGLLZ,NGLLSQUARE,NGNOD2D,NDIM,CUSTOM_REAL
@@ -53,6 +33,9 @@
   integer, save :: nnodes_coords_open
   logical, save :: ANY_FAULT_IN_THIS_PROC = .false.
   logical, save :: ANY_FAULT = .false.
+
+ ! NOTE: PARALLEL_FAULT has to be the same 
+ !       in fault_solver_common.f90, fault_generate_databases.f90 and fault_scotch.f90
   logical, parameter :: PARALLEL_FAULT = .true.
   
   ! corners indices of reference cube faces
@@ -147,7 +130,7 @@
 
   enddo
 
- ! read nodes_coords with fault crack open.
+ ! read nodes coordinates of the original version of the mesh, in which faults are open
   read(IIN,*) nnodes_coords_open
   allocate(nodes_coords_open(NDIM,nnodes_coords_open))
   do i = 1, nnodes_coords_open

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_common.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_common.f90	2012-11-21 22:32:54 UTC (rev 21064)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/src/fault_solver_common.f90	2012-11-22 18:21:50 UTC (rev 21065)
@@ -30,7 +30,9 @@
     character(len=100) :: shortFieldNames
   end type dataT_type
 
-  logical, save :: PARALLEL_FAULT = .false.
+  logical, parameter :: PARALLEL_FAULT = .true.
+ ! NOTE: PARALLEL_FAULT has to be the same 
+ !       in fault_solver_common.f90, fault_generate_databases.f90 and fault_scotch.f90
 
   public :: fault_type, PARALLEL_FAULT, &
             initialize_fault, get_jump, get_weighted_jump, rotate, add_BT, &



More information about the CIG-COMMITS mailing list