Warning, /verification/short_surf_wave/input/gendata.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
67d795f393 Jean*0001 % This is a matlab script that generates the input data
0002 prec='real*8';
0003 ieee='b';
0004
0005 % Dimensions of grid
0006 nx=52;
0007 ny=1;
0008 nz=50;
0009 % Nominal depth of model (meters)
0010 H=10.;
0011 % Size of interior domain
0012 Lx=10.;
0013
0014 % Horizontal resolution (m)
0015 dx=Lx/(nx-2);
0016 dy=dx;
0017 x=[1:nx]*dx; x=x-mean(x)+Lx/2;
0018 fprintf('dx = %d ; x 1,2 .. nx-1,nx = %7.4g %7.4g %7.4g %7.4g\n', ...
0019 dx,x(1),x(2),x(nx-1),x(nx));
0020
0021 %gravity=9.81;
0022 gravity=10.;
0023
0024 dz=H/nz;
0025 fprintf('delZ = %d * %7.6g\n',nz,dz)
0026
0027 %- initial free-surface:
0028 Ampli=0.15;
0029 et=x*pi/Lx; et=Ampli*cos(et);
0030 et(1)=0; et(nx)=0;
0031
0032 %- closed bassin:
0033 h0=ones(nx,1); h0(1)=0; h0(nx)=0;
0034 h0=-H*h0;
0035
0036 fid=fopen('topo_flat.bin','w',ieee); fwrite(fid,h0,prec); fclose(fid);
0037 fid=fopen('Eta_ini.bin','w',ieee); fwrite(fid,et,prec); fclose(fid);
0038
0039 figure(1);clf;
0040 plot(x,et,'k-');
0041 axis([-0.2 10.2 [-1 1]*0.16]); grid