# Refine the upper 150 km of the mesh so lithosphere structure is resolved.
# Function expression asks if the depth is less than the lithosphere depth and
# then refinement level = 7, else refinement level = 0.
# Note, the minimum refinement level for the lower 850 km of the mesh would be
# coarser than the initial one level of global refinement. This would then lead
# to coarsening in the future.
# To avoid this, you may want to set this 'else' value to the same as the number
# of initial global refinement steps.

subsection Mesh refinement
  set Initial global refinement          = 3
  set Minimum refinement level           = 3
  set Initial adaptive refinement        = 4
  set Time steps between mesh refinement = 1
  set Strategy                           = minimum refinement function

  subsection Minimum refinement function
    set Coordinate system   = cartesian
    set Variable names      = x,y
    set Function constants  = ymax=1.e6, lith=1.5e5
    set Function expression = ((ymax-y<=lith) ? 7 : 0)
  end
end
