bcs = DisplacementBoundaryConditions(;
no_slip = (left=false, right=false, top=false, bot=false),
free_slip = (left=true, right=true, top=true, bot=true),
free_surface = false
)
stokes.U.Ux .= PTArray(backend)([ x*εbg*lx*dt for x in xvi[1], _ in 1:ny+2])
stokes.U.Uy .= PTArray(backend)([-y*εbg*ly*dt for _ in 1:nx+2, y in xvi[2]])
flow_bcs!(stokes, flow_bcs) # apply boundary conditions
displacement2velocity!(stokes, dt)
update_halo!(@velocity(stokes)...)
Within the stokes solver, the BC's are converted from displacement to velocity by displacement2velocity!(stokes,dt) and after solving the PT iterations back to displacement by velocity2displacement!(stokes, dt). This minimizes the amount of different solvers.
Here the ShearBand2D benchmark for both velocity and displacement BC's with a resolution of 512x512 and the same input parameters.
Velocity BC's (note that the bottom left is Vx):
and displacement
This PR renames the boundary conditions to:
VelocityBoundaryConditions
DisplacementBoundaryConditions
.This allows to set displacement BCs by e.g.:
Within the stokes solver, the BC's are converted from displacement to velocity by
displacement2velocity!(stokes,dt)
and after solving the PT iterations back to displacement byvelocity2displacement!(stokes, dt)
. This minimizes the amount of different solvers. Here the ShearBand2D benchmark for both velocity and displacement BC's with a resolution of 512x512 and the same input parameters. Velocity BC's (note that the bottom left is Vx): and displacement