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

brad at geodynamics.org brad at geodynamics.org
Wed Jun 19 10:17:39 PDT 2013


Author: brad
Date: 2013-06-19 10:17:39 -0700 (Wed, 19 Jun 2013)
New Revision: 22375

Added:
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/Makefile.am
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh.jou
Removed:
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh_tet4.jou
Modified:
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/Makefile.am
   short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/README
   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/interface_netsurf.py
   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
   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
Log:
Cleanup of subduction meshing example.

Modified: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/Makefile.am
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/Makefile.am	2013-06-19 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/Makefile.am	2013-06-19 17:17:39 UTC (rev 22375)
@@ -20,7 +20,8 @@
 	contours \
 	dem \
 	triangles \
-	merge_surfs
+	merge_surfs \
+	subduction
 
 
 dist_noinst_DATA = \

Added: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/Makefile.am
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/Makefile.am	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/Makefile.am	2013-06-19 17:17:39 UTC (rev 22375)
@@ -0,0 +1,32 @@
+# -*- Makefile -*-
+#
+# ----------------------------------------------------------------------
+#
+# 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.
+#
+# ----------------------------------------------------------------------
+#
+
+dist_noinst_DATA = \
+	README \
+	geometry.jou \
+	mesh.jou \
+	bc.jou \
+	topobath_netsurf.py \
+	topobath_points.txt \
+	interface_netsurf.py \
+	interface_points.txt \
+	splay_skinsurf.py \
+	splay_points.txt
+
+
+# End of file 

Modified: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/README
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/README	2013-06-19 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/README	2013-06-19 17:17:39 UTC (rev 22375)
@@ -1,44 +1,49 @@
-This example demonstrates a simple meshing example involving a subduction
-interface, a steeply-dipping splay fault, and topography/bathymetry.
+CUBIT example illustrating methods for creating nonplanar surfaces in
+meshing a subduction interface with a steeply-dipping splay fault and
+topography/bathymetry.
 
-To generate the mesh for this example, we need to perform the following
-steps:
+To generate the mesh for this example, we perform the following steps:
 
-1.  Create the Cubit journal files that will allow creation of the
-    surfaces:
+1.  Generate CUBIT journal files for creation of the surfaces:
 
-    a.  Create the subduction interface journal file by first running the
-    interface_netsurf.py script. This will read points from the file
-    interface_points.txt that define the interface geometry, and then
-    creates a Cubit journal file to create the surface using a net
+    a.  Generate the subduction interface journal file by first
+    running the Python script interface_netsurf.py. This reads points
+    from interface_points.txt, which defines the interface geometry,
+    and creates a CUBIT journal file to create the surface using a net
     surface.
 
-    b.  Create the splay fault journal file by first running the
-    splay_skinsurf.py script. This will read points from the file
-    splay_points.txt that define the splay fault geometry, and then
-    creates a Cubit journal file to create the surface using a skin
+      python interface_netsurf.py    
+
+    b.  Generate the splay fault journal file by running the Python
+    script splay_skinsurf.py. This reads points from the file
+    splay_points.txt, which defines the splay fault geometry, and
+    creates a CUBIT journal file to create the surface using a skin
     surface.
 
-    c.  Create the topography/bathymetry journal file by first running the
-    topobath_netsurf.py script. This will read points from the file
-    topobath_points.txt that define the topography/bathymetry, and then
-    creates a Cubit journal file to create the surface using a net
+      python splay_skinsurf.py    
+
+    c.  Generate the topography/bathymetry journal file by running the
+    Python script topobath_netsurf.py script. This reads points from
+    topobath_points.txt, which defines the topography/bathymetry, and
+    creates a CUBIT journal file to create the surface using a net
     surface.
 
-2.  Create the necessary surfaces by running Cubit with the journal files
-    produced by the Python scripts:
+      python splay_skinsurf.py    
 
-    a.  Run the interface_netsurf.jou file to create the interface surface.
+2.  Create the surfaces by running each of the three journal files
+produced by the Python scripts within CUBIT.
 
-    b.  Run the splay_skinsurf.jou file to create the splay fault surface.
+    a.  interface_netsurf.jou creates the interface surface.
 
-    c.  Run the topobath_netsurf.jou file to create the DEM surface.
+    b.  splay_skinsurf.jou creates the splay fault surface.
 
+    c.  topobath_netsurf.jou creates the DEM surface.
 
-3.  Create the mesh using these surfaces by running the meth_tet4.jou file
-    within Cubit. Note that this file makes use of the following journal
-    files:
 
+3.  Generate the mesh using these surfaces by running the
+    mesh.jou journal file within CUBIT. Note that this file also
+    makes use of the following journal files:
+
     geometry.jou:  Imports the surfaces created in step 2 and creates the
                    volumes needed for meshing.
 

Modified: 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	2013-06-19 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/bc.jou	2013-06-19 17:17:39 UTC (rev 22375)
@@ -105,3 +105,4 @@
 
 
 
+

Modified: 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	2013-06-19 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/geometry.jou	2013-06-19 17:17:39 UTC (rev 22375)
@@ -33,16 +33,13 @@
 # ----------------------------------------------------------------------
 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}
+#{blockHeight=80.0*km}
 
 brick x {blockLength} y {blockWidth} z {blockHeight}
 #{idVol=Id("volume")}
@@ -51,9 +48,8 @@
 # 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}
+volume {idVol} move x {moveX} y {moveY} z {-0.5*blockHeight+10.0*km}
 
 # ----------------------------------------------------------------------
 # Import topography, subduction interface, and splay fault.
@@ -67,26 +63,27 @@
 # ----------------------------------------------------------------------
 webcut volume {idVol} with sheet surface 7
 delete volume 5
+delete body 2
 
 # ----------------------------------------------------------------------
 # Webcut remaining portion of block with subduction interface.
 # ----------------------------------------------------------------------
 webcut volume 1 with sheet surface 8
+delete body 3
 
 # ----------------------------------------------------------------------
 # Webcut volume above subduction interface with splay fault.
 # ----------------------------------------------------------------------
 webcut volume 1 with sheet surface 9
+delete body 4
 
 # ----------------------------------------------------------------------
-# 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.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_netsurf.py	2013-06-19 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_netsurf.py	2013-06-19 17:17:39 UTC (rev 22375)
@@ -18,52 +18,50 @@
 
 # ======================================================================
 import numpy
-# import pdb
-# pdb.set_trace()
 
 # Define parameters.
-intFile = "interface_points.txt"
-numConts = 5
-pointsPerCont = 5
+interfaceFile = "interface_points.txt"
+numContours = 4
+pointsPerContour = 3
 journalFile = "interface_netsurf.jou"
 acisFile = "interface_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
+           "# CUBIT journal file generated by interface_netsurf.py.\n" + \
+           "#\n" + \
+           "# Create an ACIS NURBS surface from intersecting lines.\n" + \
+           "#\n" + separator + \
+           "reset\n"
 lineBeg = "create curve spline"
-splineFmt = " location %15.11e %15.11e %15.11e"
+splineFmt = " location %10.2e %10.2e %10.2e"
 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.
-intCoords = numpy.loadtxt(intFile, dtype=numpy.float64).reshape(
-    numConts, pointsPerCont, 3)
+intCoords = numpy.loadtxt(interfaceFile, dtype=numpy.float64).reshape(numContours, pointsPerContour, 3)
 
 j = open(journalFile, 'w')
 j.write(journalBeg)
 
 # Loop over contours (u-lines).
-for contour in range(numConts):
+for contour in range(numContours):
     points = intCoords[contour,:,:]
     j.write(lineBeg)
-    for pointNum in range(pointsPerCont):
+    for pointNum in range(pointsPerContour):
         point = points[pointNum,:]
         j.write(splineFmt % (point[0], point[1], point[2]))
 
     j.write("\n")
 
 # Loop over profiles (v-lines).
-for profile in range(pointsPerCont):
+for profile in range(pointsPerContour):
     points = intCoords[:,profile,:]
     j.write(lineBeg)
-    for pointNum in range(numConts):
+    for pointNum in range(numContours):
         point = points[pointNum,:]
         j.write(splineFmt % (point[0], point[1], point[2]))
 
@@ -71,9 +69,9 @@
 
 # Create net surface.
 uline1 = 1
-uline2 = numConts
-vline1 = numConts + 1
-vline2 = vline1 + pointsPerCont - 1
+uline2 = numContours
+vline1 = numContours + 1
+vline2 = vline1 + pointsPerContour - 1
 j.write(netFmt % (uline1, uline2, vline1, vline2))
 
 # Delete spline curves and export Acis file.

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 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/interface_points.txt	2013-06-19 17:17:39 UTC (rev 22375)
@@ -1,25 +1,17 @@
--158363.49995	-320000.00000	-80000.000000
--117908.46930	-150319.13217	-80000.000000
--105810.54254	23.046240000	-80000.000000
--130815.68897	149415.44681	-80000.000000
--151349.45888	320000.00000	-80000.000000
--125972.41361	-320000.00000	-60000.000000
--84087.240337	-148397.02226	-60000.000000
--73054.343245	232.36802000	-60000.000000
--98027.310940	150969.51287	-60000.000000
--118727.49631	320000.00000	-60000.000000
--88549.175202	-320000.00000	-40000.000000
--46414.735266	-152122.29993	-40000.000000
--34853.991730	-1331.9206130	-40000.000000
--59834.025467	150060.86206	-40000.000000
--81006.071399	320000.00000	-40000.000000
--36204.490870	-320000.00000	-20000.000000
-8199.2467058	-151709.97111	-20000.000000
-18146.082654	-1571.7179170	-20000.000000
--6578.8092800	150748.49894	-20000.000000
--28188.208958	320000.00000	-20000.000000
-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
+# Curvilinear grid of points organized as horizontal contours.
+#
+-158363.49995	-320000.00000	-80000.0
+-105810.54254	23.046240000	-80000.0
+-151349.45888	320000.00000	-80000.0
+#
+-125972.41361	-320000.00000	-60000.0
+-73054.343245	232.36802000	-60000.0
+-118727.49631	320000.00000	-60000.0
+#
+-36204.490870	-320000.00000	-20000.0
+18146.082654	-1571.7179170	-20000.0
+-28188.208958	320000.00000	-20000.0
+#
+34030.592403	-320000.00000	5000.0
+154341.36394	740.47119400	5000.0
+76062.567758	320000.00000	5000.0

Copied: short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh.jou (from rev 22374, 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.jou	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh.jou	2013-06-19 17:17:39 UTC (rev 22375)
@@ -0,0 +1,61 @@
+# -*- 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.
+# ----------------------------------------------------------------------
+cleanup volume all
+volume all smooth scheme condition number beta 2.0 cpu 4
+smooth volume all
+#
+# ----------------------------------------------------------------------
+# Boundary conditions.
+# ----------------------------------------------------------------------
+playback 'bc.jou'
+
+# ----------------------------------------------------------------------
+# Export exodus file.
+# ----------------------------------------------------------------------
+set large exodus off
+export mesh "mesh.exo" dimension 3 overwrite
+
+
+# End of file
+
+
+

Deleted: 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	2013-06-19 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/mesh_tet4.jou	2013-06-19 17:17:39 UTC (rev 22375)
@@ -1,64 +0,0 @@
-# -*- 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=6.4}
-#{loop(22)}
-cleanup volume all
-volume all smooth scheme condition number beta {condnum} cpu 2
-smooth volume all
-#{condnum=condnum-0.2}
-#{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 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_points.txt	2013-06-19 17:17:39 UTC (rev 22375)
@@ -1,20 +1,26 @@
--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
+# Vertical profiles for splay fault geometry.
+#
+-60000.0  -320000.0  -30000.0
+-45000.0  -320000.0  -20000.0
+-20000.0  -320000.0       0.0
+  5000.0  -320000.0   25000.0
+#
+-10000.0  -150000.0  -30000.0
+  5000.0  -150000.0  -20000.0
+ 30000.0  -150000.0       0.0
+ 55000.0  -150000.0   25000.0
+#
+ 15000.0        0.0  -30000.0
+ 30000.0        0.0  -20000.0
+ 55000.0        0.0       0.0
+ 80000.0        0.0   25000.0
+#
+-10000.0   150000.0  -30000.0
+  5000.0   150000.0  -20000.0
+ 30000.0   150000.0       0.0
+ 55000.0   150000.0   25000.0
+#
+-35000.0   320000.0  -30000.0
+-20000.0   320000.0  -20000.0
+  5000.0   320000.0       0.0
+ 30000.0   320000.0   25000.0

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 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/splay_skinsurf.py	2013-06-19 17:17:39 UTC (rev 22375)
@@ -18,42 +18,40 @@
 
 # ======================================================================
 import numpy
-# import pdb
-# pdb.set_trace()
 
 # Define parameters.
 splayFile = "splay_points.txt"
-numProfs = 5
-pointsPerProf = 4
+numProfiles = 5
+pointsPerProfile = 4
 journalFile = "splay_skinsurf.jou"
 acisFile = "splay_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 profiles.\n" + \
-           "#\n" + separator
+           "# CUBIT journal file generated by splay_skinsurf.py.\n" + \
+           "#\n" + \
+           "# Create an ACIS NURBS surface from a set of profiles.\n" + \
+           "#\n" + separator + \
+           "reset\n"
 lineBeg = "create curve spline"
-splineFmt = " location %15.11e %15.11e %15.11e"
+splineFmt = " location %10.2e %10.2e %10.2e"
 skinCmd = "create surface skin curve all\n"
 delCmd = "delete curve all\n"
 expCmd = "export Acis '" + acisFile + "'\n"
 
 
 # Read coordinates and reshape them.
-splayCoords = numpy.loadtxt(splayFile, dtype=numpy.float64).reshape(
-    numProfs, pointsPerProf, 3)
+splayCoords = numpy.loadtxt(splayFile, dtype=numpy.float64).reshape(numProfiles, pointsPerProfile, 3)
 
 j = open(journalFile, 'w')
 j.write(journalBeg)
 
 # Loop over profiles.
-for profile in range(numProfs):
+for profile in range(numProfiles):
     points = splayCoords[profile,:,:]
     j.write(lineBeg)
-    for pointNum in range(pointsPerProf):
+    for pointNum in range(pointsPerProfile):
         point = points[pointNum,:]
         j.write(splineFmt % (point[0], point[1], point[2]))
 

Modified: 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	2013-06-19 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_netsurf.py	2013-06-19 17:17:39 UTC (rev 22375)
@@ -18,52 +18,50 @@
 
 # ======================================================================
 import numpy
-# import pdb
-# pdb.set_trace()
 
 # Define parameters.
 demFile = "topobath_points.txt"
-numProfs = 4
-pointsPerProf = 9
+numProfiles = 4
+pointsPerProfile = 3
 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
+           "# CUBIT journal file generated by topobath_netsurf.py.\n" + \
+           "#\n" + \
+           "# Create an ACIS NURBS surface from intersecting lines.\n" + \
+           "#\n" + separator + \
+           "reset\n"
 lineBeg = "create curve spline"
-splineFmt = " location %15.11e %15.11e %15.11e"
+splineFmt = " location %10.2e %10.2e %10.2e"
 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)
+demCoords = numpy.loadtxt(demFile, dtype=numpy.float64).reshape(numProfiles, pointsPerProfile, 3)
 
 j = open(journalFile, 'w')
 j.write(journalBeg)
 
 # Loop over profiles (u-lines).
-for profile in range(numProfs):
+for profile in range(numProfiles):
     points = demCoords[profile,:,:]
     j.write(lineBeg)
-    for pointNum in range(pointsPerProf):
+    for pointNum in range(pointsPerProfile):
         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):
+for contour in range(pointsPerProfile):
     points = demCoords[:,contour,:]
     j.write(lineBeg)
-    for pointNum in range(numProfs):
+    for pointNum in range(numProfiles):
         point = points[pointNum,:]
         j.write(splineFmt % (point[0], point[1], point[2]))
 
@@ -71,9 +69,9 @@
 
 # Create net surface.
 uline1 = 1
-uline2 = numProfs
-vline1 = numProfs + 1
-vline2 = vline1 + pointsPerProf - 1
+uline2 = numProfiles
+vline1 = numProfiles + 1
+vline2 = vline1 + pointsPerProfile - 1
 j.write(netFmt % (uline1, uline2, vline1, vline2))
 
 # Delete spline curves and export Acis file.

Modified: 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	2013-06-19 06:46:57 UTC (rev 22374)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/meshing/surface_nurbs/subduction/topobath_points.txt	2013-06-19 17:17:39 UTC (rev 22375)
@@ -1,36 +1,17 @@
--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
+# Grid of points to define DEM of topography/bathymetry.
+#
+-200000.0  -320000.0   3000.0
+      0.0  -320000.0   2000.0
+ 200000.0  -320000.0  -8000.0
+#
+-200000.0  -110000.0   2000.0
+      0.0  -110000.0   1000.0
+ 200000.0  -110000.0  -6000.0
+#
+-200000.0   110000.0   3000.0
+      0.0   110000.0  -2000.0
+ 200000.0   110000.0  -9000.0
+#
+-200000.0   320000.0   1000.0
+      0.0   320000.0  -3000.0
+ 200000.0   320000.0  -8000.0



More information about the CIG-COMMITS mailing list