[cig-commits] r22369 - short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction

willic3 at geodynamics.org willic3 at geodynamics.org
Tue Jun 18 22:28:39 PDT 2013


Author: willic3
Date: 2013-06-18 22:28:39 -0700 (Tue, 18 Jun 2013)
New Revision: 22369

Added:
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/bc.jou
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/geometry.jou
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh_tet4.jou
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_netsurf.py
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_points.txt
Removed:
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points2.txt
Modified:
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_netsurf.jou
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_points.txt
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points.txt
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_skinsurf.py
Log:
Added topography and started on geometry and mesh generation.
Right now, things are taking too long on my laptop.



Added: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/bc.jou
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/bc.jou	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/bc.jou	2013-06-19 05:28:39 UTC (rev 22369)
@@ -0,0 +1,118 @@
+# -*- Python -*- (syntax highlighting)
+# ----------------------------------------------------------------------
+#
+# Charles A. Williams, GNS Science
+#
+# ----------------------------------------------------------------------
+#
+# CUBIT journal file with boundary condition info for M7.1 Darfield earthquake modeling.
+#
+# ----------------------------------------------------------------------
+# Create blocks for materials
+# ----------------------------------------------------------------------
+block 1 volume 8 9 10 20 22
+block 1 name "outer_domain"
+block 2 volume 19 21
+block 2 name "christchurch"
+
+# ----------------------------------------------------------------------
+# Create nodeset for +x face
+# ----------------------------------------------------------------------
+group "face_xpos" add node in surface 17
+group "face_xpos" add node in surface 20
+nodeset 10 group face_xpos
+nodeset 10 name "face xpos"
+
+# ----------------------------------------------------------------------
+# Create nodeset for -x face
+# ----------------------------------------------------------------------
+group "face_xneg" add node in surface 22
+group "face_xneg" add node in surface 33
+group "face_xneg" add node in surface 28
+nodeset 11 group face_xneg
+nodeset 11 name "face xneg"
+
+# ----------------------------------------------------------------------
+# Create nodeset for +y face
+# ----------------------------------------------------------------------
+group "face_ypos" add node in surface 37
+group "face_ypos" add node in surface 55
+group "face_ypos" add node in surface 47
+group "face_ypos" add node in surface 14
+nodeset 12 group face_ypos
+nodeset 12 name "face ypos"
+
+# ----------------------------------------------------------------------
+# Create nodeset for -y face
+# ----------------------------------------------------------------------
+group "face_yneg" add node in surface 26
+group "face_yneg" add node in surface 35
+nodeset 13 group face_yneg
+nodeset 13 name "face yneg"
+
+# ----------------------------------------------------------------------
+# Create nodeset for -z face
+# ----------------------------------------------------------------------
+group "face_zneg" add node in surface 29
+group "face_zneg" add node in surface 32
+group "face_zneg" add node in surface 42
+group "face_zneg" add node in surface 40
+nodeset 14 group face_zneg
+nodeset 14 name "face zneg"
+
+# ----------------------------------------------------------------------
+# Create nodeset for +z face
+# ----------------------------------------------------------------------
+group "face_zpos" add node in surface 34
+group "face_zpos" add node in surface 50
+group "face_zpos" add node in surface 52
+group "face_zpos" add node in surface 133
+group "face_zpos" add node in surface 127
+group "face_zpos" add node in surface 135
+group "face_zpos" add node in surface 141
+nodeset 15 group face_zpos
+nodeset 15 name "face zpos"
+
+# ----------------------------------------------------------------------
+# Create nodeset for fault_greendale
+# ----------------------------------------------------------------------
+group "fault_greendale" add node in surface greendale
+group "fault_greendale" add node in surface greendale at A 
+group "fault_greendale" add node in surface greendale at B
+group "fault_greendale" add node in surface greendale at C
+nodeset 100 group fault_greendale
+nodeset 100 name "fault_greendale"
+
+# ----------------------------------------------------------------------
+# Create nodeset for fault_hororata
+# ----------------------------------------------------------------------
+group "fault_hororata" add node in surface hororata
+group "fault_hororata" remove node in fault_greendale
+nodeset 101 group fault_hororata
+nodeset 101 name "fault_hororata"
+
+# ----------------------------------------------------------------------
+# Create nodeset for fault_charing
+# ----------------------------------------------------------------------
+group "fault_charing" add node in surface charing
+group "fault_charing" add node in surface charing at A
+group "fault_charing" remove node in fault_greendale
+nodeset 102 group fault_charing
+nodeset 102 name "fault_charing"
+
+# ----------------------------------------------------------------------
+# Create nodeset for fault_nnwepi
+# ----------------------------------------------------------------------
+group "fault_nnwepi" add node in surface nnwepi
+group "fault_nnwepi" remove node in fault_charing
+group "fault_nnwepi" remove node in fault_greendale
+nodeset 103 group fault_nnwepi
+nodeset 103 name "fault_nnwepi"
+
+
+# End of file
+
+
+
+
+

Added: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/geometry.jou
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/geometry.jou	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/geometry.jou	2013-06-19 05:28:39 UTC (rev 22369)
@@ -0,0 +1,92 @@
+# -*- Python -*- (syntax highlighting)
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010-2013 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+# CUBIT journal file with geometry for example showing how to import
+# several surfaces (topography, subduction interface, splay fault), and
+# mesh the resulting volumes.
+#
+# We also use the CUBIT support for APREPRO (the expressions in
+# braces), which includes units and mathematical functions. See the
+# APREPRO section in the appendix of the CUBIT documentation for more
+# information.
+#
+# ----------------------------------------------------------------------
+# Set units to SI.
+# ----------------------------------------------------------------------
+# {Units('si')}
+#
+# ----------------------------------------------------------------------
+# Reset geometry.
+# ----------------------------------------------------------------------
+reset
+
+# Make sure undo is off to prevent errors in stitching volumes.
+undo off
+
+# ----------------------------------------------------------------------
+# Create block
+# ----------------------------------------------------------------------
+# Block is 250 km x 500 km x 62 km
+#{blockLength=250.0*km}
+#{blockWidth=500.0*km}
+#{blockHeight=66.0*km}
+
+brick x {blockLength} y {blockWidth} z {blockHeight}
+#{idVol=Id("volume")}
+
+# Translate block so top can be chopped with topography and so faults
+# intersect upper surface rather than side.
+#{moveX=50.0*km}
+#{moveY=0.0*km}
+#{moveZ=-30.0*km}
+
+volume {idVol} move x {moveX} y {moveY} z {moveZ}
+
+# ----------------------------------------------------------------------
+# Import topography, subduction interface, and splay fault.
+# ----------------------------------------------------------------------
+import Acis "topobath_surf.sat"
+import Acis "interface_surf.sat"
+import Acis "splay_surf.sat"
+
+# ----------------------------------------------------------------------
+# Webcut block with topography and delete volume lying above topography.
+# ----------------------------------------------------------------------
+webcut volume {idVol} with sheet surface 7
+delete volume 5
+
+# ----------------------------------------------------------------------
+# Webcut remaining portion of block with subduction interface.
+# ----------------------------------------------------------------------
+webcut volume 1 with sheet surface 8
+
+# ----------------------------------------------------------------------
+# Webcut volume above subduction interface with splay fault.
+# ----------------------------------------------------------------------
+webcut volume 1 with sheet surface 9
+
+# ----------------------------------------------------------------------
+# Delete sheet bodies, which are no longer needed.
+# ----------------------------------------------------------------------
+delete body 2 3 4
+
+# ----------------------------------------------------------------------
+# Imprint all volumes, then merge.
+# ----------------------------------------------------------------------
+imprint all with volume all
+merge all
+
+# End of file

Modified: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_netsurf.jou
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_netsurf.jou	2013-06-19 03:23:03 UTC (rev 22368)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_netsurf.jou	2013-06-19 05:28:39 UTC (rev 22369)
@@ -7,12 +7,12 @@
 create curve spline location -1.25972413610e+05 -3.20000000000e+05 -6.00000000000e+04 location -8.40872403370e+04 -1.48397022260e+05 -6.00000000000e+04 location -7.30543432450e+04 2.32368020000e+02 -6.00000000000e+04 location -9.80273109400e+04 1.50969512870e+05 -6.00000000000e+04 location -1.18727496310e+05 3.20000000000e+05 -6.00000000000e+04
 create curve spline location -8.85491752020e+04 -3.20000000000e+05 -4.00000000000e+04 location -4.64147352660e+04 -1.52122299930e+05 -4.00000000000e+04 location -3.48539917300e+04 -1.33192061300e+03 -4.00000000000e+04 location -5.98340254670e+04 1.50060862060e+05 -4.00000000000e+04 location -8.10060713990e+04 3.20000000000e+05 -4.00000000000e+04
 create curve spline location -3.62044908700e+04 -3.20000000000e+05 -2.00000000000e+04 location 8.19924670580e+03 -1.51709971110e+05 -2.00000000000e+04 location 1.81460826540e+04 -1.57171791700e+03 -2.00000000000e+04 location -6.57880928000e+03 1.50748498940e+05 -2.00000000000e+04 location -2.81882089580e+04 3.20000000000e+05 -2.00000000000e+04
-create curve spline location 3.40305924030e+04 -3.20000000000e+05 0.00000000000e+00 location 8.59842663430e+04 -1.50749829420e+05 0.00000000000e+00 location 1.54341363940e+05 7.40471194000e+02 0.00000000000e+00 location 1.49520669110e+05 1.50000686630e+05 0.00000000000e+00 location 7.60625677580e+04 3.20000000000e+05 0.00000000000e+00
-create curve spline location -1.58363499950e+05 -3.20000000000e+05 -8.00000000000e+04 location -1.25972413610e+05 -3.20000000000e+05 -6.00000000000e+04 location -8.85491752020e+04 -3.20000000000e+05 -4.00000000000e+04 location -3.62044908700e+04 -3.20000000000e+05 -2.00000000000e+04 location 3.40305924030e+04 -3.20000000000e+05 0.00000000000e+00
-create curve spline location -1.17908469300e+05 -1.50319132170e+05 -8.00000000000e+04 location -8.40872403370e+04 -1.48397022260e+05 -6.00000000000e+04 location -4.64147352660e+04 -1.52122299930e+05 -4.00000000000e+04 location 8.19924670580e+03 -1.51709971110e+05 -2.00000000000e+04 location 8.59842663430e+04 -1.50749829420e+05 0.00000000000e+00
-create curve spline location -1.05810542540e+05 2.30462400000e+01 -8.00000000000e+04 location -7.30543432450e+04 2.32368020000e+02 -6.00000000000e+04 location -3.48539917300e+04 -1.33192061300e+03 -4.00000000000e+04 location 1.81460826540e+04 -1.57171791700e+03 -2.00000000000e+04 location 1.54341363940e+05 7.40471194000e+02 0.00000000000e+00
-create curve spline location -1.30815688970e+05 1.49415446810e+05 -8.00000000000e+04 location -9.80273109400e+04 1.50969512870e+05 -6.00000000000e+04 location -5.98340254670e+04 1.50060862060e+05 -4.00000000000e+04 location -6.57880928000e+03 1.50748498940e+05 -2.00000000000e+04 location 1.49520669110e+05 1.50000686630e+05 0.00000000000e+00
-create curve spline location -1.51349458880e+05 3.20000000000e+05 -8.00000000000e+04 location -1.18727496310e+05 3.20000000000e+05 -6.00000000000e+04 location -8.10060713990e+04 3.20000000000e+05 -4.00000000000e+04 location -2.81882089580e+04 3.20000000000e+05 -2.00000000000e+04 location 7.60625677580e+04 3.20000000000e+05 0.00000000000e+00
+create curve spline location 3.40305924030e+04 -3.20000000000e+05 5.00000000000e+03 location 8.59842663430e+04 -1.50749829420e+05 5.00000000000e+03 location 1.54341363940e+05 7.40471194000e+02 5.00000000000e+03 location 1.49520669110e+05 1.50000686630e+05 5.00000000000e+03 location 7.60625677580e+04 3.20000000000e+05 5.00000000000e+03
+create curve spline location -1.58363499950e+05 -3.20000000000e+05 -8.00000000000e+04 location -1.25972413610e+05 -3.20000000000e+05 -6.00000000000e+04 location -8.85491752020e+04 -3.20000000000e+05 -4.00000000000e+04 location -3.62044908700e+04 -3.20000000000e+05 -2.00000000000e+04 location 3.40305924030e+04 -3.20000000000e+05 5.00000000000e+03
+create curve spline location -1.17908469300e+05 -1.50319132170e+05 -8.00000000000e+04 location -8.40872403370e+04 -1.48397022260e+05 -6.00000000000e+04 location -4.64147352660e+04 -1.52122299930e+05 -4.00000000000e+04 location 8.19924670580e+03 -1.51709971110e+05 -2.00000000000e+04 location 8.59842663430e+04 -1.50749829420e+05 5.00000000000e+03
+create curve spline location -1.05810542540e+05 2.30462400000e+01 -8.00000000000e+04 location -7.30543432450e+04 2.32368020000e+02 -6.00000000000e+04 location -3.48539917300e+04 -1.33192061300e+03 -4.00000000000e+04 location 1.81460826540e+04 -1.57171791700e+03 -2.00000000000e+04 location 1.54341363940e+05 7.40471194000e+02 5.00000000000e+03
+create curve spline location -1.30815688970e+05 1.49415446810e+05 -8.00000000000e+04 location -9.80273109400e+04 1.50969512870e+05 -6.00000000000e+04 location -5.98340254670e+04 1.50060862060e+05 -4.00000000000e+04 location -6.57880928000e+03 1.50748498940e+05 -2.00000000000e+04 location 1.49520669110e+05 1.50000686630e+05 5.00000000000e+03
+create curve spline location -1.51349458880e+05 3.20000000000e+05 -8.00000000000e+04 location -1.18727496310e+05 3.20000000000e+05 -6.00000000000e+04 location -8.10060713990e+04 3.20000000000e+05 -4.00000000000e+04 location -2.81882089580e+04 3.20000000000e+05 -2.00000000000e+04 location 7.60625677580e+04 3.20000000000e+05 5.00000000000e+03
 create surface net u curve 1 to 5 v curve 6 to 10
 delete curve all
 export Acis 'interface_surf.sat'

Modified: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_points.txt
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_points.txt	2013-06-19 03:23:03 UTC (rev 22368)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_points.txt	2013-06-19 05:28:39 UTC (rev 22369)
@@ -18,8 +18,8 @@
 18146.082654	-1571.7179170	-20000.000000
 -6578.8092800	150748.49894	-20000.000000
 -28188.208958	320000.00000	-20000.000000
-34030.592403	-320000.00000	0.0000000000
-85984.266343	-150749.82942	0.0000000000
-154341.36394	740.47119400	0.0000000000
-149520.66911	150000.68663	0.0000000000
-76062.567758	320000.00000	0.0000000000
+34030.592403	-320000.00000	5000.0000000000
+85984.266343	-150749.82942	5000.0000000000
+154341.36394	740.47119400	5000.0000000000
+149520.66911	150000.68663	5000.0000000000
+76062.567758	320000.00000	5000.0000000000

Added: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh_tet4.jou
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh_tet4.jou	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh_tet4.jou	2013-06-19 05:28:39 UTC (rev 22369)
@@ -0,0 +1,63 @@
+# -*- Python -*- (syntax highlighting)
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010-2013 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+# CUBIT journal file to create an ExodusII file with a mesh at uniform
+# resolution.
+#
+# ----------------------------------------------------------------------
+# Generate geometry.
+# ----------------------------------------------------------------------
+playback 'geometry.jou'
+
+# ----------------------------------------------------------------------
+# Create tet4 mesh at 6.0 km resolution.
+# ----------------------------------------------------------------------
+
+#{dx=6.0*km}
+volume all size {dx}
+volume all scheme tetmesh
+
+# ----------------------------------------------------------------------
+# Generate the mesh.
+# ----------------------------------------------------------------------
+mesh surface all
+mesh volume all
+
+# ----------------------------------------------------------------------
+# Smooth mesh to imporve quality.
+# ----------------------------------------------------------------------
+#{condnum=2.0}
+#{loop(4)}
+cleanup volume all
+volume all smooth scheme condition number beta {condnum} cpu 2
+smooth volume all
+#{condnum=condnum-0.1}
+#{endloop}
+#
+# ----------------------------------------------------------------------
+# Boundary conditions.
+# ----------------------------------------------------------------------
+playback 'bc.jou'
+
+# ----------------------------------------------------------------------
+# Export exodus file.
+# ----------------------------------------------------------------------
+set large exodus off
+export mesh "subduct_mesh_tet4.exo" dimension 3 overwrite
+
+
+# End of file
+

Modified: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points.txt
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points.txt	2013-06-19 03:23:03 UTC (rev 22368)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points.txt	2013-06-19 05:28:39 UTC (rev 22369)
@@ -1,20 +1,20 @@
 -50000.000000	-320000.00000	-30000.000000
 -25000.000000	-320000.00000	-20000.000000
-0.0000000000	-320000.00000	-5000.0000000
-25000.000000	-320000.00000	15000.000000
+0.0000000000	-320000.00000	0.0000000
+25000.000000	-320000.00000	25000.000000
 0.0000000000	-150000.00000	-30000.000000
 25000.000000	-150000.00000	-20000.000000
-50000.000000	-150000.00000	-5000.0000000
-75000.000000	-150000.00000	15000.000000
+50000.000000	-150000.00000	0.0000000
+75000.000000	-150000.00000	25000.000000
 25000.000000	0.0000000000	-30000.000000
 50000.000000	0.0000000000	-20000.000000
-75000.000000	0.0000000000	-5000.0000000
-100000.00000	0.0000000000	15000.000000
+75000.000000	0.0000000000	0.0000000
+100000.00000	0.0000000000	25000.000000
 0.0000000000	150000.00000	-30000.000000
 25000.000000	150000.00000	-20000.000000
-50000.000000	150000.00000	-5000.0000000
-75000.000000	150000.00000	15000.000000
+50000.000000	150000.00000	0.0000000
+75000.000000	150000.00000	25000.000000
 -25000.000000	320000.00000	-30000.000000
 0.0000000000	320000.00000	-20000.000000
-25000.000000	320000.00000	-5000.0000000
-50000.000000	320000.00000	15000.000000
+25000.000000	320000.00000	0.0000000
+50000.000000	320000.00000	25000.000000

Deleted: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points2.txt
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points2.txt	2013-06-19 03:23:03 UTC (rev 22368)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points2.txt	2013-06-19 05:28:39 UTC (rev 22369)
@@ -1,20 +0,0 @@
--50000.000000	-320000.00000	-30000.000000
--25000.000000	-320000.00000	-20000.000000
-0.0000000000	-320000.00000	0.0000000
-25000.000000	-320000.00000	25000.000000
-0.0000000000	-150000.00000	-30000.000000
-25000.000000	-150000.00000	-20000.000000
-50000.000000	-150000.00000	0.0000000
-75000.000000	-150000.00000	25000.000000
-25000.000000	0.0000000000	-30000.000000
-50000.000000	0.0000000000	-20000.000000
-75000.000000	0.0000000000	0.0000000
-100000.00000	0.0000000000	25000.000000
-0.0000000000	150000.00000	-30000.000000
-25000.000000	150000.00000	-20000.000000
-50000.000000	150000.00000	0.0000000
-75000.000000	150000.00000	25000.000000
--25000.000000	320000.00000	-30000.000000
-0.0000000000	320000.00000	-20000.000000
-25000.000000	320000.00000	0.0000000
-50000.000000	320000.00000	25000.000000

Modified: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_skinsurf.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_skinsurf.py	2013-06-19 03:23:03 UTC (rev 22368)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_skinsurf.py	2013-06-19 05:28:39 UTC (rev 22369)
@@ -22,7 +22,7 @@
 # pdb.set_trace()
 
 # Define parameters.
-splayFile = "splay_points2.txt"
+splayFile = "splay_points.txt"
 numProfs = 5
 pointsPerProf = 4
 journalFile = "splay_skinsurf.jou"

Added: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_netsurf.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_netsurf.py	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_netsurf.py	2013-06-19 05:28:39 UTC (rev 22369)
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010-2013 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+# PREREQUISITES: numpy
+
+# ======================================================================
+import numpy
+# import pdb
+# pdb.set_trace()
+
+# Define parameters.
+demFile = "topobath_points.txt"
+numProfs = 4
+pointsPerProf = 9
+journalFile = "topobath_netsurf.jou"
+acisFile = "topobath_surf.sat"
+
+# Journal file formatting, etc.
+separator = "# ----------------------------------------------------------\n"
+journalBeg = \
+           "reset\n" + \
+           "# This is a simple Cubit journal file to create an ACIS\n" + \
+           "# NURBS surface from a set of intersecting lines.\n" + \
+           "#\n" + separator
+lineBeg = "create curve spline"
+splineFmt = " location %15.11e %15.11e %15.11e"
+netFmt = "create surface net u curve %d to %d v curve %d to %d\n"
+delCmd = "delete curve all\n"
+expCmd = "export Acis '" + acisFile + "'\n"
+
+
+# Read coordinates and reshape them.
+demCoords = numpy.loadtxt(demFile, dtype=numpy.float64).reshape(
+    numProfs, pointsPerProf, 3)
+
+j = open(journalFile, 'w')
+j.write(journalBeg)
+
+# Loop over profiles (u-lines).
+for profile in range(numProfs):
+    points = demCoords[profile,:,:]
+    j.write(lineBeg)
+    for pointNum in range(pointsPerProf):
+        point = points[pointNum,:]
+        j.write(splineFmt % (point[0], point[1], point[2]))
+
+    j.write("\n")
+
+# Loop over contours (v-lines).
+for contour in range(pointsPerProf):
+    points = demCoords[:,contour,:]
+    j.write(lineBeg)
+    for pointNum in range(numProfs):
+        point = points[pointNum,:]
+        j.write(splineFmt % (point[0], point[1], point[2]))
+
+    j.write("\n")
+
+# Create net surface.
+uline1 = 1
+uline2 = numProfs
+vline1 = numProfs + 1
+vline2 = vline1 + pointsPerProf - 1
+j.write(netFmt % (uline1, uline2, vline1, vline2))
+
+# Delete spline curves and export Acis file.
+j.write(delCmd)
+j.write(expCmd)
+j.close()
+
+# End of file


Property changes on: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_netsurf.py
___________________________________________________________________
Added: svn:executable
   + *

Added: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_points.txt
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_points.txt	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_points.txt	2013-06-19 05:28:39 UTC (rev 22369)
@@ -0,0 +1,36 @@
+-200000.00000	-320000.00000	1000.0000000
+-150000.00000	-320000.00000	2000.0000000
+-100000.00000	-320000.00000	1000.0000000
+-50000.000000	-320000.00000	0.0000000000
+0.0000000000	-320000.00000	-1000.0000000
+50000.000000	-320000.00000	-3000.0000000
+100000.00000	-320000.00000	-4000.0000000
+150000.00000	-320000.00000	-5000.0000000
+200000.00000	-320000.00000	-6000.0000000
+-200000.00000	-110000.00000	2000.0000000
+-150000.00000	-110000.00000	5000.0000000
+-100000.00000	-110000.00000	2000.0000000
+-50000.000000	-110000.00000	0.0000000000
+0.0000000000	-110000.00000	-1000.0000000
+50000.000000	-110000.00000	-3000.0000000
+100000.00000	-110000.00000	-4000.0000000
+150000.00000	-110000.00000	-5000.0000000
+200000.00000	-110000.00000	-6000.0000000
+-200000.00000	110000.00000	1000.0000000
+-150000.00000	110000.00000	2000.0000000
+-100000.00000	110000.00000	1000.0000000
+-50000.000000	110000.00000	0.0000000000
+0.0000000000	110000.00000	-1000.0000000
+50000.000000	110000.00000	-3000.0000000
+100000.00000	110000.00000	-4000.0000000
+150000.00000	110000.00000	-5000.0000000
+200000.00000	110000.00000	-6000.0000000
+-200000.00000	320000.00000	1000.0000000
+-150000.00000	320000.00000	2000.0000000
+-100000.00000	320000.00000	1000.0000000
+-50000.000000	320000.00000	0.0000000000
+0.0000000000	320000.00000	-1000.0000000
+50000.000000	320000.00000	-3000.0000000
+100000.00000	320000.00000	-4000.0000000
+150000.00000	320000.00000	-5000.0000000
+200000.00000	320000.00000	-6000.0000000



More information about the CIG-COMMITS mailing list