##################### Velocity ########################

# To model the divergent velocitiy field of a mid-ocean ridge, we prescribe
# the plate velocity (pointing away from the ridge) at the top boundary.
# We use a closed boundary with free slip conditions as the left boundary, which
# marks the ridge axis and also acts as a center line for our model, so that
# material can not cross this boundary.
# We prescribe the velocity at the top boundary using a function:
# At the ridge axis, the velocity is zero, at a distance of 10 km from the ridge
# axis or more, the rigid plate uniformly moves away from the ridge with a constant
# speed, and close to the ridge we interpolate between these two conditions.
subsection Boundary velocity model
  set Prescribed velocity boundary indicators = top:function
  set Tangential velocity boundary indicators = left

  subsection Function
    # We choose a half-spreading rate of u0=3cm/yr.
    set Function constants  = u0=0.03, x0=10000
    set Variable names      = x,z
    set Function expression = if(x<x0,(1-(x/x0-1)*(x/x0-1))*u0,u0); 0
  end
end

# We prescribe the lithostatic pressure as a boundary traction on
# the bottom and right side of the model, so that material can flow in and out
# according to the flow induced by the moving plate.
subsection Boundary traction model
  set Prescribed traction boundary indicators = right:initial lithostatic pressure, bottom:initial lithostatic pressure

  subsection Initial lithostatic pressure
    # We calculate the pressure profile at the right model boundary.
    set Representative point         = 105000, 70000
  end
end
