// P.-Y. LAGREE & O. DEVAUCHELLE // FEBRUARY 2007 // FULLY IMPLICIT VERSION - RESCALED int AspectRatioH=6,n=0; real W=1,L=W*AspectRatioH; real S=.05,R=60; real beta=5,gamma=1; real epsilon=.05,kx=2*pi/L,ky=pi/W; real dt=.01,t=0; real precision=10e-6; real theta=0.5; real seed=0.123; func real charru(real entry) // erosion law divided by tau { return pow(entry,beta-1); } func real charrubytau(real entry) // erosion law divided by tau^2 { return pow(entry,beta-2); } func real dcharru(real entry) // derivative of the above law divided by tau { return (beta-1)*pow(entry,beta-3); } int npty=10,nptx=npty*AspectRatioH/2; mesh Th=square(nptx,npty,[-L/2+L*x,-W/2+W*y]); fespace Vh(Th,P2,periodic=[[2,y],[4,y]]); Vh h,eta; Vh dth,dteta; Vh etatest,dthtest,dtetatest; real dhm; real cpu=clock(); h=-1-epsilon*sin(kx*x)*sin(ky*y); epsilon=.1; h=-1; { for(int i=1;i<10;i++) {int is; seed = (seed+pi)^3; is=seed; seed = (seed - is)*((-1)^is); cout << i<< " " << seed << " " << is << " " << clock() -cpu <