CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
cliff.cpp
Go to the documentation of this file.
1
12
13/* ===============================================================================================================================
14
15 This file is part of CoastalME, the Coastal Modelling Environment.
16
17 CoastalME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23===============================================================================================================================*/
24#include <assert.h>
25
26#include <iostream>
27// using std::cout;
28// using std::cerr;
29// using std::endl;
30using std::ios;
31
32#include "cme.h"
33#include "cliff.h"
34#include "coast.h"
35
37CRWCliff::CRWCliff(CRWCoast* pCoastIn, int const nCoast, int const nPointOnCoast, double const dCellSide, double const dNotchDepthIn, double const dNotchElevIn, double const dAccumWaveEnergyIn)
38{
40
41 pCoast = pCoastIn;
42
43 m_nCoast = nCoast;
44 m_nPointOnCoast = nPointOnCoast;
46
47 m_dMaxDepth = dCellSide;
48 m_dNotchDepth = dNotchDepthIn;
49 m_dNotchBaseElev = dNotchElevIn;
50 m_dTotAccumWaveEnergy = dAccumWaveEnergyIn;
51 // assert(m_dRemaining >=0);
52}
53
56{
57}
58
61{
63}
64
70
73{
74 return m_dNotchBaseElev;
75}
76
78void CRWCliff::SetNotchBaseElev(double const dNewElev)
79{
80 m_dNotchBaseElev = dNewElev;
81}
82
84double CRWCliff::dGetRemaining(void) const
85{
86 return (m_dMaxDepth - m_dNotchDepth);
87}
88
89// //! Sets the horizontal depth of the cliff's erosional notch
90// void CRWCliff::SetNotchDepth(double const dLenIn)
91// {
92// m_dNotchDepth = dLenIn;
93// }
94
96double CRWCliff::dGetNotchDepth(void) const
97{
98 return m_dNotchDepth;
99}
100
102bool CRWCliff::bReadyToCollapse(double const dThresholdNotchDepth) const
103{
104 if (m_dNotchDepth >= dThresholdNotchDepth)
105 return true;
106
107 else
108 return false;
109}
110
112void CRWCliff::DeepenErosionalNotch(double const dLenIn)
113{
114 m_dNotchDepth += dLenIn;
115
116 // Constrain the notch depth, it cannot be greater than the max notch depth
118
119 // assert((m_dMaxDepth - m_dNotchDepth) >=0);
120}
121
124{
125}
int m_nPointOnCoast
The point on the coast on which this coast landform sits.
CRWCoast * pCoast
Pointer to this landform's coast.
int m_nCategory
Landform category code.
int m_nCoast
The coast number on which this coast landform sits.
double m_dTotAccumWaveEnergy
Total accumulated wave energy since beginning of simulation.
bool bHasCollapsed(void) const
Returns the value of the cliff collapse switch.
Definition cliff.cpp:60
bool bReadyToCollapse(double const) const
Returns true if the horizontal depth of the erosional notch exceeds the critical notch overhang.
Definition cliff.cpp:102
double m_dNotchDepth
The horizontal depth (in external CRS units) of the erosional notch, measured inland from the side of...
Definition cliff.h:42
~CRWCliff(void) override
Destructor.
Definition cliff.cpp:55
void Display(void) override
Instantiates the pure virtual function in the abstract parent class, so that CRWCliff is not an abstr...
Definition cliff.cpp:123
void DeepenErosionalNotch(double const)
Increases the XY-plane length (in external CRS units) of the erosional notch, measured inland from th...
Definition cliff.cpp:112
CRWCliff(CRWCoast *, int const, int const, double const, double const, double const, double const)
Constructor with seven parameters and an intialization list.
Definition cliff.cpp:37
double dGetNotchBaseElev(void) const
Returns the elevation of the base of the erosional notch.
Definition cliff.cpp:72
double m_dMaxDepth
The maximum depth (in external CRS units) of an erosional notch, this is equal to the grid's m_dCellS...
Definition cliff.h:39
double m_dNotchBaseElev
Z-plane elevation (in external CRS units) of the base of the erosional notch. The notch is assumed to...
Definition cliff.h:45
void SetNotchBaseElev(double const)
Sets the elevation of the base of the erosional notch.
Definition cliff.cpp:78
bool m_bCliffHasCollapsed
Switch to say whether the cliff has just collapsed, earlier in this timestep.
Definition cliff.h:36
double dGetNotchDepth(void) const
Returns the horizontal depth of the cliff's erosional notch (the 'overhang')
Definition cliff.cpp:96
void SetCliffCollapsed(void)
Flags the cliff as having collapsed.
Definition cliff.cpp:66
double dGetRemaining(void) const
Returns the length (in external CRS units) of the cliff's remaining sediment 'behind' the erosional n...
Definition cliff.cpp:84
Real-world class used to represent coastline objects.
Definition coast.h:43
Contains CRWCliff definitions.
This file contains global definitions for CoastalME.
T tMin(T a, T b)
Definition cme.h:1259
int const LF_CAT_CLIFF
Definition cme.h:543
Contains CRWCoast definitions.