[cig-commits] r8985 - in
short/3D/PyLith/benchmarks/trunk/quasistatic: . reversenog
reversenog/figs reversenog/meshes
brad at geodynamics.org
brad at geodynamics.org
Thu Jan 3 19:03:16 PST 2008
Author: brad
Date: 2008-01-03 19:03:16 -0800 (Thu, 03 Jan 2008)
New Revision: 8985
Added:
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/plot_geometry.py
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/vtk_geometry.py
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/createbc.jou
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/geometry.jou
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_0250m.jou
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_0500m.jou
short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_1000m.jou
Log:
Added reversenog (figs and hex8 cubit scripts).
Added: short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/plot_geometry.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/plot_geometry.py 2008-01-03 23:00:07 UTC (rev 8984)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/plot_geometry.py 2008-01-04 03:03:16 UTC (rev 8985)
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+from enthought.mayavi.app import Mayavi
+import vtk_geometry
+from enthought.mayavi.sources.vtk_data_source import VTKDataSource
+
+class PlotScene(Mayavi):
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def run(self):
+ self._setupScene(showFaultTaper=True)
+ return
+
+
+ # PRIVATE METHODS ////////////////////////////////////////////////////
+
+ def _setupScene(self,
+ showFault=True,
+ showMaterials=True,
+ showFaultTaper=False):
+ """
+ Plot axes, fault surface, and materials.
+ """
+
+ from enthought.mayavi.modules.outline import Outline
+ from enthought.mayavi.modules.axes import Axes
+ from enthought.mayavi.modules.surface import Surface
+
+ # Create rendering scene
+ script = self.script
+ script.new_scene()
+ script.engine.current_scene.scene.background = (1,1,1)
+ script.engine.current_scene.scene.foreground = (0,0,0)
+ vtk_geometry.setCamera(script.engine.current_scene.scene.camera)
+
+ # Domain (axes and outline)
+ script.add_source(VTKDataSource(data=vtk_geometry.domain()))
+ script.engine.current_object.name = "Domain"
+ outline = Outline()
+ script.add_module(outline)
+ outline.actor.property.opacity = 0.2
+ axes = Axes()
+ axes.axes.x_label = "X (km)"
+ axes.axes.y_label = "Y (km)"
+ axes.axes.z_label = "Z (km)"
+ axes.axes.label_format = "%-0.1f"
+ script.add_module(axes)
+
+ # Fault surface
+ if showFault:
+ srcs = vtk_geometry.fault(showTaper=showFaultTaper)
+ for src in srcs:
+ script.add_source(VTKDataSource(data=src['object']))
+ script.engine.current_object.name = "Fault %s" % src['name']
+ surf = Surface()
+ script.add_module(surf)
+ surf.actor.property.color = (1,0,0)
+ if src['name'] == "taper":
+ surf.actor.property.opacity = 0.1
+ else:
+ surf.actor.property.opacity = 0.3
+
+ # Materials
+ if showMaterials:
+ srcs = vtk_geometry.materials()
+ for src in srcs:
+ script.add_source(VTKDataSource(data=src['object']))
+ script.engine.current_object.name = "Material %s" % src['name']
+ surf = Surface()
+ script.add_module(surf)
+ surf.actor.property.opacity = 0.1
+ if src['name'] == "elastic":
+ surf.actor.property.color = (1,1,0)
+ elif src['name'] == "viscoelastic":
+ surf.actor.property.color = (0,1,1)
+
+ return
+
+
+
+# ----------------------------------------------------------------------
+if __name__ == "__main__":
+ app = PlotScene()
+ app.main()
+
+
+# End of file
+
Property changes on: short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/plot_geometry.py
___________________________________________________________________
Name: svn:executable
+ *
Added: short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/vtk_geometry.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/vtk_geometry.py 2008-01-03 23:00:07 UTC (rev 8984)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/figs/vtk_geometry.py 2008-01-04 03:03:16 UTC (rev 8985)
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+from enthought.tvtk.api import tvtk
+import numpy
+
+# ----------------------------------------------------------------------
+def domain():
+ l = 24.0
+ domain = tvtk.CubeSource()
+ domain.set_bounds(0, l, 0, l, -l, 0.0)
+ return domain.get_output()
+
+# ----------------------------------------------------------------------
+def fault(showTaper=False):
+ vertices = numpy.array(
+ [ [4.0, 0.0, 0.0], # 0
+ [4.0, 12.0, 0.0], # 1
+ [4.0, 16.0, 0.0], # 2
+ [16.0, 0.0, -12.0], # 3
+ [16.0, 12.0, -12.0], # 4
+ [20.0, 0.0, -16.0], # 5
+ [20.0, 12.0, -16.0], # 6
+ [20.0, 16.0, -16.0] ], # 7
+ dtype=numpy.float32)
+
+ # Setup VTK vertices
+ if not showTaper:
+ polys = numpy.array(
+ [ [0, 3, 1],
+ [1, 3, 4],
+ [3, 5, 4],
+ [4, 5, 6],
+ [1, 6, 2],
+ [2, 6, 7] ],
+ dtype=numpy.int32)
+
+ # Setup VTK simplices
+ data = [{'name': "fault",
+ 'object': tvtk.PolyData(points=vertices, polys=polys)}]
+ else:
+ polys = numpy.array(
+ [ [0, 3, 1],
+ [1, 3, 4] ],
+ dtype=numpy.int32)
+ polysTaper = numpy.array(
+ [ [3, 5, 4],
+ [4, 5, 6],
+ [1, 6, 2],
+ [2, 6, 7] ],
+ dtype=numpy.int32)
+
+ data= [{'name': "fault",
+ 'object': tvtk.PolyData(points=vertices, polys=polys)},
+ {'name': "taper",
+ 'object': tvtk.PolyData(points=vertices, polys=polysTaper)}]
+ return data
+
+
+# ----------------------------------------------------------------------
+def materials():
+ l = 24.0
+ elastic = tvtk.CubeSource()
+ elastic.set_bounds(0, l, 0, l, -l/2.0, 0.0)
+ viscoelastic = tvtk.CubeSource()
+ viscoelastic.set_bounds(0, l, 0, l, -l, -l/2.0)
+ return [{'name': "elastic",
+ 'object': elastic.get_output()},
+ {'name': "viscoelastic",
+ 'object': viscoelastic.get_output()}]
+
+# ----------------------------------------------------------------------
+def setCamera(camera):
+ dist = 67.0
+ angle = 40.0
+ elev = 30.0
+ azimuth = 35.0
+ clipRange = numpy.array( [5, 100] )
+ ptTo = numpy.array( [6.0, 12.0, -19] )
+ ptFrom = ptTo + numpy.array( [0.0, -dist, 0.0])
+
+ camera.view_angle = angle
+ camera.view_up = (0,0,1)
+ camera.focal_point = ptTo
+ camera.position = ptFrom
+ camera.elevation(elev)
+ camera.azimuth(azimuth)
+ camera.clipping_range = clipRange
+ return
+
+
+# ----------------------------------------------------------------------
+def setWindow(maya):
+ return
Added: short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/createbc.jou
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/createbc.jou 2008-01-03 23:00:07 UTC (rev 8984)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/createbc.jou 2008-01-04 03:03:16 UTC (rev 8985)
@@ -0,0 +1,65 @@
+# ----------------------------------------------------------------------
+# Create blocks for materials
+# ----------------------------------------------------------------------
+block 1 volume elastic_hangingwall
+block 1 name "elastic hangingwall"
+block 2 volume elastic_footwall
+block 2 name "elastic footwall"
+block 3 volume visco_hangingwall
+block 3 name "viscoelastic hangingwall"
+block 4 volume visco_footwall
+block 4 name "viscoelastic footwall"
+
+# ----------------------------------------------------------------------
+# Create nodeset for fault
+# ----------------------------------------------------------------------
+group "fault" add node in fault_surface
+group "fault" add node in fault_surface at A
+group "fault" remove node with z_coord < -16.001e+3 or with y_coord > 16.001e+3
+nodeset 10 group fault
+nodeset 10 name "fault"
+
+# ----------------------------------------------------------------------
+# Create nodeset for fixed BC
+# ----------------------------------------------------------------------
+group "analytic_disp_xpos" add node in surface 13
+group "analytic_disp_xpos" add node in surface 32
+group "analytic_disp_xpos" add node in surface 36
+nodeset 11 group analytic_disp_xpos
+nodeset 11 name "analytic_disp_xpos"
+
+group "analytic_disp_xneg" add node in surface 11
+group "analytic_disp_xneg" add node in surface 17
+nodeset 12 group analytic_disp_xneg
+nodeset 12 name "analytic_disp_xneg"
+
+group "analytic_disp_ypos" add node in surface 23
+group "analytic_disp_ypos" add node in surface 25
+group "analytic_disp_ypos" add node in surface 33
+group "analytic_disp_ypos" add node in surface 35
+group "analytic_disp_ypos" remove node in analytic_disp_xneg
+group "analytic_disp_ypos" remove node in analytic_disp_xpos
+nodeset 13 group analytic_disp_ypos
+nodeset 13 name "analytic_disp_ypos"
+
+group "analytic_disp_zneg" add node in surface 2
+group "analytic_disp_zneg" remove node in analytic_disp_xneg
+group "analytic_disp_zneg" remove node in analytic_disp_xpos
+group "analytic_disp_zneg" remove node in analytic_disp_ypos
+nodeset 14 group analytic_disp_zneg
+nodeset 14 name "analytic_disp_zneg"
+
+# ----------------------------------------------------------------------
+# Create nodeset for symmetry BC
+# ----------------------------------------------------------------------
+group "symmetry_disp" add node in surface 21
+group "symmetry_disp" add node in surface 28
+group "symmetry_disp" add node in surface 31
+group "symmetry_disp" add node in surface 38
+group "symmetry_disp" remove node in analytic_disp_xpos
+group "symmetry_disp" remove node in analytic_disp_xneg
+group "symmetry_disp" remove node in analytic_disp_ypos
+group "symmetry_disp" remove node in analytic_disp_zneg
+group "symmetry_disp" remove node in fault
+nodeset 15 group symmetry_disp
+nodeset 15 name "symmetry_disp"
Added: short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/geometry.jou
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/geometry.jou 2008-01-03 23:00:07 UTC (rev 8984)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/geometry.jou 2008-01-04 03:03:16 UTC (rev 8985)
@@ -0,0 +1,39 @@
+# ----------------------------------------------------------------------
+# Create block
+# ----------------------------------------------------------------------
+reset
+brick x 24000 y 24000 z 24000
+volume 1 move x 12000 y 12000 z -12000
+
+# ----------------------------------------------------------------------
+# Create interface surfaces
+# ----------------------------------------------------------------------
+# Fault surface
+create vertex 4000.0 0.0 0.0
+create vertex 4000.0 16000.0 0.0
+create vertex 20000.0 0.0 -16000.0
+create planar surface with plane vertex 10 vertex 9 vertex 11
+surface 7 name "fault_surface"
+
+create planar surface with plane zplane offset -12000.0
+surface 8 name "material_interface"
+
+#create planar surface with plane xplane offset 20000.0
+#surface 9 name "fault_auxiliary"
+
+# ----------------------------------------------------------------------
+# Divide volumes using interfaces surfaces
+# ----------------------------------------------------------------------
+webcut volume 1 with plane surface material_interface
+webcut volume 1 with plane surface fault_surface
+webcut volume 4 with plane surface fault_surface
+volume 1 name "elastic_hangingwall"
+volume 5 name "elastic_footwall"
+volume 4 name "visco_hangingwall"
+volume 6 name "visco_footwall"
+
+# ----------------------------------------------------------------------
+# Imprint curves on volumes
+# ----------------------------------------------------------------------
+imprint all with volume all
+merge all
Added: short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_0250m.jou
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_0250m.jou 2008-01-03 23:00:07 UTC (rev 8984)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_0250m.jou 2008-01-04 03:03:16 UTC (rev 8985)
@@ -0,0 +1,26 @@
+# ----------------------------------------------------------------------
+# Generate geometry
+# ----------------------------------------------------------------------
+playback 'geometry.jou'
+
+# ----------------------------------------------------------------------
+# Set discretization size
+# ----------------------------------------------------------------------
+surface 21 31 23 33 28 38 25 35 scheme pave
+surface all size 250.0
+volume all size 250.0
+
+# ----------------------------------------------------------------------
+# Generate the mesh
+# ----------------------------------------------------------------------
+mesh volume all
+
+# ----------------------------------------------------------------------
+# Generate blocks and nodesets
+# ----------------------------------------------------------------------
+playback 'createbc.jou'
+
+# ----------------------------------------------------------------------
+# Export exodus file
+# ----------------------------------------------------------------------
+export mesh "reverseslip_hex8_0250m.exo" dimension 3 overwrite
Added: short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_0500m.jou
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_0500m.jou 2008-01-03 23:00:07 UTC (rev 8984)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_0500m.jou 2008-01-04 03:03:16 UTC (rev 8985)
@@ -0,0 +1,26 @@
+# ----------------------------------------------------------------------
+# Generate geometry
+# ----------------------------------------------------------------------
+playback 'geometry.jou'
+
+# ----------------------------------------------------------------------
+# Set discretization size
+# ----------------------------------------------------------------------
+surface 21 31 23 33 28 38 25 35 scheme pave
+surface all size 500.0
+volume all size 500.0
+
+# ----------------------------------------------------------------------
+# Generate the mesh
+# ----------------------------------------------------------------------
+mesh volume all
+
+# ----------------------------------------------------------------------
+# Generate blocks and nodesets
+# ----------------------------------------------------------------------
+playback 'createbc.jou'
+
+# ----------------------------------------------------------------------
+# Export exodus file
+# ----------------------------------------------------------------------
+export mesh "reverseslip_hex8_0500m.exo" dimension 3 overwrite
Added: short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_1000m.jou
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_1000m.jou 2008-01-03 23:00:07 UTC (rev 8984)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/reversenog/meshes/mesh_hex8_1000m.jou 2008-01-04 03:03:16 UTC (rev 8985)
@@ -0,0 +1,26 @@
+# ----------------------------------------------------------------------
+# Generate geometry
+# ----------------------------------------------------------------------
+playback 'geometry.jou'
+
+# ----------------------------------------------------------------------
+# Set discretization size
+# ----------------------------------------------------------------------
+surface 21 31 23 33 28 38 25 35 scheme pave
+surface all size 1000
+volume all size 1000
+
+# ----------------------------------------------------------------------
+# Generate the mesh
+# ----------------------------------------------------------------------
+mesh volume all
+
+# ----------------------------------------------------------------------
+# Generate blocks and nodesets
+# ----------------------------------------------------------------------
+playback 'createbc.jou'
+
+# ----------------------------------------------------------------------
+# Export exodus file
+# ----------------------------------------------------------------------
+export mesh "reverseslip_hex8_1000m.exo" dimension 3 overwrite
More information about the cig-commits
mailing list