Path: blob/devel/elmerice/Tests/FSSA_perlin2d/perlin.lua
3206 views
-- constants1-- #########2betamin=0.013betamax=14dbeta=10.05delta=2.06sigma=delta/4.595119850134589926857alpha = 1.08beta = 3.09LX=8000.010LY=2500.01112-- the vertical offset to the base topography13-- ##########################################14function parbl(Y)15aux= LY - math.sqrt(LY*LY - 0.25*Y*Y)16return aux17end1819-- this is our accumulation rate20-- #############################21function accum(X)22aux=alpha-beta*X/LX23if (aux > 0.0) then24return aux25else26return 0.027end28end2930-- this is our accumulation rate in 3D31-- ###################################32function accum3D(X,Y)33fade=1.0 - ((Y-2500.0)/LY)^2.034return accum(X)*fade35end3637-- linear sliding coefficient38-- ##########################39function lslidingcoeff(X,H,D)40height = H-D41fact = 1.0/(1.0 + math.exp((height - hmin)/(0.5*sigma)))42return (betamax - betamin)/(1.0 + math.exp((X - 0.5*LX)/sigma)) + betamin + fact*betamax43end444546-- sliding with fixed target velocity ub agnostic of driving stress47-- ################################################################48function slidingcoeffv(X,H,D)49return lslidingcoeff(X,H,D)/(ub^(mw - 1.0))50end5152-- sliding that tries to match the linear sliding speed for given driving stress (2nd argument)53-- ############################################################################################54function slidingcoeff(X,Tau,H,D)55ub=Tau/lslidingcoeff(X,H,D)56return lslidingcoeff(X,H,D)/(ub^(mw - 1.0))57end5859606162