forked from UNC-CECL/CDM_v3.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitsurfbeach.cc
34 lines (28 loc) · 994 Bytes
/
initsurfbeach.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "initsurfbeach.h"
#include "globals.h"
////////////////////////////////////////
// class CInitSurfBeach
//
CInitSurfBeach::CInitSurfBeach(const dunepar& par, string prefix)
{
m_h= par.getdefault<double>( prefix+"beach.h", duneglobals::dx());
double m_slope= duneglobals::slope();//par.getdefault<double>( prefix+"beach.angle", 45);
if (m_slope > 0) {
m_l = m_h/(duneglobals::dx()*m_slope);
}
}
void CInitSurfBeach::init_2d_scal(TFktScal& array)
{
int x, y;
for( x= 0; x< duneglobals::nx(); ++x )
for( y= 0; y< duneglobals::ny(); ++y ){
if (x < m_l) {
// double a = 0*(x-0.5*m_l)*duneglobals::dx()/3.;
array(x, y) = /*m_h * (1 - (1-x*1.0/m_l)*(1-x*1.0/m_l));*/ m_h / m_l * x; // + 0.2*exp(-a*a);
} else {
array(x, y) = m_h;
}
// double a = (x-0.5*m_l)*duneglobals::dx()/3.;
// array(x, y) = m_h * (1 - exp(- x /m_l)) + 0.2*exp(-a*a);
}
}