# -*- 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-2017 University of California, Davis
#
# See COPYING for license information.
#
# ----------------------------------------------------------------------
# Generate geometry
# ----------------------------------------------------------------------
playback 'geometry.jou'

# ----------------------------------------------------------------------
# Set discretization size
# ----------------------------------------------------------------------
surface all size {2.0*km}

# ----------------------------------------------------------------------
# Generate the mesh
# ----------------------------------------------------------------------
surface all scheme pave
mesh surface all

# ----------------------------------------------------------------------
# Smooth mesh to improve quality
# ----------------------------------------------------------------------
surface all smooth scheme condition number beta 1.3 cpu 10
smooth surface all

# ----------------------------------------------------------------------
# Create blocks for materials
# ----------------------------------------------------------------------
block 1 surface s_crust_xneg s_crust_xpos
block 1 name "crust"

block 2 surface s_mantle_xneg s_mantle_xpos
block 2 name "mantle"

# ----------------------------------------------------------------------
# Create nodeset for fault
# ----------------------------------------------------------------------
group "fault" add node in curve c_fault_crust
group "fault" add node in curve c_fault_mantle
nodeset 10 group fault
nodeset 10 name "fault"

# buried edge
group "faultedge_top" add node in c_fault_mantle
group "faultedge_bot" add node in c_fault_ext
group "faultedge" intersect faultedge_top with faultedge_bot
delete group faultedge_bot
delete group faultedge_top
nodeset 11 group faultedge
nodeset 11 name "faultedge"

# ----------------------------------------------------------------------
# Create nodeset for +x edge
# ----------------------------------------------------------------------
group "boundary_xpos" add node in curve c_crust_xpos
group "boundary_xpos" add node in curve c_mantle_xpos
nodeset 20 group boundary_xpos
nodeset 20 name "boundary xpos"

# ----------------------------------------------------------------------
# Create nodeset for -x edge
# ----------------------------------------------------------------------
group "boundary_xneg" add node in curve c_crust_xneg
group "boundary_xneg" add node in curve c_mantle_xneg
nodeset 21 group boundary_xneg
nodeset 21 name "boundary xneg"

# ----------------------------------------------------------------------
# Create nodeset for +y edge
# ----------------------------------------------------------------------
group "boundary_ypos" add node in curve  c_topo_xneg
group "boundary_ypos" add node in curve  c_topo_xpos
nodeset 22 group boundary_ypos
nodeset 22 name "boundary ypos"

# ----------------------------------------------------------------------
# Create nodeset for -y edge
# ----------------------------------------------------------------------
group "boundary_yneg" add node in curve  c_bottom_xneg
group "boundary_yneg" add node in curve  c_bottom_xpos
nodeset 23 group boundary_yneg
nodeset 23 name "boundary yneg"

# ----------------------------------------------------------------------
# Export exodus file
# ----------------------------------------------------------------------
export mesh "mesh.exo" dimension 2 overwrite



22afb2bb93f2c08b28e00f70fc1f778ebe21460a
# -*- 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-2017 University of California, Davis
#
# See COPYING for license information.
#
# ----------------------------------------------------------------------
# Generate geometry
# ----------------------------------------------------------------------
playback 'geometry.jou'

# ----------------------------------------------------------------------
# Set discretization size
# ----------------------------------------------------------------------
surface all size {2.0*km}

# ----------------------------------------------------------------------
# Generate the mesh
# ----------------------------------------------------------------------
surface all scheme pave
mesh surface all

# ----------------------------------------------------------------------
# Smooth mesh to improve quality
# ----------------------------------------------------------------------
surface all smooth scheme condition number beta 1.3 cpu 10
smooth surface all

# ----------------------------------------------------------------------
# Create blocks for materials
# ----------------------------------------------------------------------
block 1 surface s_crust_xneg s_crust_xpos
block 1 name "crust"

block 2 surface s_mantle_xneg s_mantle_xpos
block 2 name "mantle"

# ----------------------------------------------------------------------
# Create nodeset for fault
# ----------------------------------------------------------------------
group "fault" add node in curve c_fault_crust
group "fault" add node in curve c_fault_mantle
nodeset 10 group fault
nodeset 10 name "fault"

# buried edge
group "faultedge_top" add node in c_fault_mantle
group "faultedge_bot" add node in c_fault_ext
group "faultedge" intersect faultedge_top with faultedge_bot
delete group faultedge_bot
delete group faultedge_top
nodeset 11 group faultedge
nodeset 11 name "faultedge"

# ----------------------------------------------------------------------
# Create nodeset for +x edge
# ----------------------------------------------------------------------
group "boundary_xpos" add node in curve c_crust_xpos
group "boundary_xpos" add node in curve c_mantle_xpos
nodeset 20 group boundary_xpos
nodeset 20 name "boundary xpos"

# ----------------------------------------------------------------------
# Create nodeset for -x edge
# ----------------------------------------------------------------------
group "boundary_xneg" add node in curve c_crust_xneg
group "boundary_xneg" add node in curve c_mantle_xneg
nodeset 21 group boundary_xneg
nodeset 21 name "boundary xneg"

# ----------------------------------------------------------------------
# Create nodeset for +y edge
# ----------------------------------------------------------------------
group "boundary_ypos" add node in curve  c_topo_xneg
group "boundary_ypos" add node in curve  c_topo_xpos
nodeset 22 group boundary_ypos
nodeset 22 name "boundary ypos"

# ----------------------------------------------------------------------
# Create nodeset for -y edge
# ----------------------------------------------------------------------
group "boundary_yneg" add node in curve  c_bottom_xneg
group "boundary_yneg" add node in curve  c_bottom_xpos
nodeset 23 group boundary_yneg
nodeset 23 name "boundary yneg"

# ----------------------------------------------------------------------
# Export exodus file
# ----------------------------------------------------------------------
export mesh "mesh.exo" dimension 2 overwrite


