# -*- Python -*- (syntax highlighting)
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
#
# ----------------------------------------------------------------------
# Create tet4 mesh at 200m resolution.
# ----------------------------------------------------------------------

# ----------------------------------------------------------------------
# Generate geometry
# ----------------------------------------------------------------------
playback 'geometry.jou'

# ----------------------------------------------------------------------
# Set discretization size and scheme
# ----------------------------------------------------------------------
#{dx=200*m}
surface all scheme trimesh
volume all scheme tetmesh
playback 'gradient.jou'

# ----------------------------------------------------------------------
# Generate the mesh
# ----------------------------------------------------------------------
mesh surface all
surface all smooth scheme condition number beta 1.3 cpu 10
smooth surface all

mesh volume all

# ----------------------------------------------------------------------
# Smooth mesh to improve quality
# ----------------------------------------------------------------------
#{condnum=2.0}
#{loop(4)}
cleanup volume all
volume all smooth scheme condition number beta {condnum} cpu 10
smooth volume all
#{condnum=condnum-0.1}
#{endloop}

# ----------------------------------------------------------------------
# Setup boundary conditions.
# ----------------------------------------------------------------------
playback 'createbc.jou'

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


# End of file

