CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
cell.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
18the terms of the GNU General Public License as published by the Free Software
19Foundation; either version 3 of the License, or (at your option) any later
20version.
21
22 This program is distributed in the hope that it will be useful, but WITHOUT
23ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
24FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License along with
27this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
28Cambridge, MA 02139, USA.
29
30===============================================================================================================================*/
31#include <vector>
32using std::vector;
33
34#include <assert.h>
35
36#include "cell.h"
37#include "cme.h"
38#include "simulation.h"
39#include "cell.h"
40#include "cell_layer.h"
41#include "cell_sediment.h"
42
46 m_bIsInActiveZone(false), m_bCoastline(false), m_bCliff(false),
47 m_bFloodLine(false), m_bWaveFlood(false),
48 // m_bCheckCell(false),
70{
71 m_Landform.SetLFCategory(LF_NONE);
72}
73
76
78void CGeomCell::SetBoundingBoxEdge(int const nDirection)
79{
80 m_nBoundingBoxEdge = nDirection;
81}
82
85
88{
90}
91
94
97
100
103
106
109{
111}
112
118
124
127{
129}
130
132void CGeomCell::SetInActiveZone(bool const bFlag) { m_bIsInActiveZone = bFlag; }
133
136
139
142
149
156
163
170
176
177// bool CGeomCell::bActualPlatformErosion(void) const
178// {
179// return (m_dActualPlatformErosionThisIter > 0);
180// }
181
183void CGeomCell::SetAsCoastline(bool const bNewFlag) { m_bCoastline = bNewFlag; }
184
186bool CGeomCell::bIsCoastline(void) const { return m_bCoastline; }
187
189void CGeomCell::SetAsCliff(bool const bNewFlag) { m_bCliff = bNewFlag; }
190
192bool CGeomCell::bIsCliff(void) const { return m_bCliff; }
193
195void CGeomCell::SetAsFloodLine(bool const bNewFlag) { m_bFloodLine = bNewFlag; }
196
198bool CGeomCell::bIsFloodLine(void) const { return m_bFloodLine; }
199
201void CGeomCell::SetProfileID(int const nNormal)
202{
203 m_nCoastlineNormal = nNormal;
204}
205
209
211bool CGeomCell::bIsProfile(void) const
212{
214 return false;
215
216 return true;
217}
218
220void CGeomCell::SetPolygonID(int const nPolyID) { m_nPolygonID = nPolyID; }
221
224int CGeomCell::nGetPolygonID(void) const { return m_nPolygonID; }
225
227void CGeomCell::SetPolygonCoastID(int const nPolyCoastID)
228{
229 m_nPolygonCoastID = nPolyCoastID;
230}
231
235
238void CGeomCell::SetCoastAndPolygonID(int const nPolyCoastID,
239 int const nPolyID)
240{
241 m_nPolygonCoastID = nPolyCoastID;
242 m_nPolygonID = nPolyID;
243}
244
247{
248 m_nShadowZoneNumber = nCode;
249}
250
253
256bool CGeomCell::bIsinThisShadowZone(int const nZone) const
257{
258 if (m_nShadowZoneNumber == nZone)
259 return true;
260
261 return false;
262}
263
266{
267 if (m_nShadowZoneNumber != 0)
268 return true;
269
270 return false;
271}
272
275
276// void CGeomCell::SetWaveSetup(int const dWaveSetup)
277// {
278// m_dWaveSetup = dWaveSetup;
279// }
280
281// void CGeomCell::SetStormSurge(int const dStormSurge)
282// {
283// m_dStormSurge = dStormSurge;
284// }
285
286// void CGeomCell::SetRunUp(int const dRunUp)
287// {
288// m_dRunUp = dRunUp;
289// }
290
291// void CGeomCell::SetTotLevel(void) const
292// {
293// m_dTotLevel = m_dWaveSetup + m_dStormSurge + m_dRunUp +
294// m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL();
295// }
296
297// int CGeomCell::nGetTotLevel(void) const
298// {
299// return m_dTotLevel;
300// }
301
305{
307 (m_pGrid->pGetSim()->dGetThisIterTotWaterLevel() +
308 m_pGrid->pGetSim()->dGetThisIterSWL()));
309}
310
311// //! Set this cell as checked TODO What is this used for?
312// void CGeomCell::SetCheckCell(void)
313// {
314// m_bCheckCell = true;
315// }
316
317// //! Returns true if this cell is checked, false otherwise TODO 007 What is
318// this used for? bool CGeomCell::bIsCellCheck(void) const
319// {
320// return m_bCheckCell;
321// }
322
325
328
331
334{
336}
337
340{
342}
343
346
348void CGeomCell::SetLocalConsSlope(double const dNewSlope)
349{
350 m_dLocalConsSlope = dNewSlope;
351}
352
355
357void CGeomCell::SetBasementElev(double const dNewElev)
358{
359 m_dBasementElevation = dNewElev;
360}
361
364{
365 return (m_dBasementElevation);
366}
367
369void CGeomCell::SetSlope(double const dNewSlope) { m_dSlope = dNewSlope; }
370
372double CGeomCell::dGetSlope(void) const { return (m_dSlope); }
373
377{
379 m_pGrid->pGetSim()->CSimulation::dGetMissingValue(),
380 TOLERANCE))
381 return true;
382
383 return false;
384}
385
387double CGeomCell::dGetSeaDepth(void) const { return (m_dSeaDepth); }
388
390double CGeomCell::dGetTotSeaDepth(void) const { return (m_dTotSeaDepth); }
391
394void CGeomCell::SetSuspendedSediment(double const dNewSedDepth)
395{
396 // Note no checks here to see if new equiv depth is sensible (e.g.
397 // non-negative)
398 m_dSuspendedSediment = dNewSedDepth;
399 m_dTotSuspendedSediment += dNewSedDepth;
400}
401
404void CGeomCell::AddSuspendedSediment(double const dIncSedDepth)
405{
406 // Note no checks here to see if increment equiv depth is sensible (e.g.
407 // non-negative)
408 m_dSuspendedSediment += dIncSedDepth;
409 m_dTotSuspendedSediment += dIncSedDepth;
410}
411
414{
415 return (m_dSuspendedSediment);
416}
417
420{
422}
423
428{
429 if (m_VLayerAboveBasement.empty())
430 return INT_NODATA;
431
432 int nTop = static_cast<int>(m_VLayerAboveBasement.size()) - 1;
433
434 while (m_VLayerAboveBasement[nTop].dGetTotalThickness() <= 0)
435 {
436 if (--nTop < 0)
438 }
439
440 return nTop;
441}
442
446{
447 if (m_VLayerAboveBasement.empty())
448 return INT_NODATA;
449
450 return static_cast<int>(m_VLayerAboveBasement.size()) - 1;
451}
452
456{
457 // Note no check to see if nLayer < m_VLayerAboveBasement.size()
458 double dTopElev = m_dBasementElevation;
459
460 for (int n = 0; n < nLayer; n++)
461 {
462 dTopElev += m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
463 dTopElev += m_VLayerAboveBasement[n].dGetConsolidatedThickness();
464 }
465
466 dTopElev += m_VLayerAboveBasement[nLayer].dGetConsolidatedThickness();
467
468 return dTopElev;
469}
470
474{
475 // TODO 055 No check that nLayer < size()
476 return &m_VLayerAboveBasement[nLayer];
477}
478
479// //! Returns the volume-equivalent elevation of the sediment's top surface for
480// this cell (i.e. if there is a cliff notch, then lower the elevation by the
481// notch's volume) double CGeomCell::dGetVolEquivSedTopElev(void) const
482// {
483// double dTopElev = m_dBasementElevation;
484// for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
485// {
486// dTopElev += (m_VLayerAboveBasement[n].dGetUnconsolidatedThickness() -
487// m_VLayerAboveBasement[n].dGetNotchUnconsolidatedLost()); dTopElev +=
488// (m_VLayerAboveBasement[n].dGetConsolidatedThickness() -
489// m_VLayerAboveBasement[n].dGetNotchConsolidatedLost());
490// }
491//
492// return dTopElev;
493// }
494
498{
499 return m_VdAllHorizonTopElev.back();
500}
501
509
516
521{
523 m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL());
524}
525
528{
529 return m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL();
530}
531
534{
535 return m_pGrid->pGetSim()->CSimulation::dGetThisIterTotWaterLevel();
536}
537
538// //! Returns true if the elevation of the sediment top surface for this cell
539// is greater than or equal to the grid's this-timestep still water elevation.
540// Also returns true if the cell has unconsolidated sediment on it and the
541// elevation of the sediment top surface, minus a tolerance value, is less than
542// the grid's this-timestep still water elevation bool
543// CGeomCell::bIsSeaIncBeach(void) const
544// {
545// if (m_bInContiguousSea)
546// // Sea
547// return true;
548//
549// double
550// dWaterLevel = m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL(),
551// dSedTop = m_VdAllHorizonTopElev.back();
552//
553// // Beach
554// if ((m_VLayerAboveBasement.back().dGetUnconsolidatedThickness() > 0) &&
555// ((dSedTop - m_pGrid->pGetSim()->CSimulation::dGetMaxBeachElevAboveSWL()) <
556// dWaterLevel)) return true;
557//
558// return false;
559// }
560
564{
565 double dTotThick = 0;
566
567 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
568 {
570 double const dLayerThick = m_Layer.dGetFineConsolidatedThickness();
571 double const dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchFineLost();
572
573 dTotThick += (dLayerThick - dNotchEquiv);
574 }
575
576 return dTotThick;
577}
578
581{
582 double dTotThick = 0;
583
584 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
585 dTotThick += m_VLayerAboveBasement[n].dGetFineUnconsolidatedThickness();
586
587 return dTotThick;
588}
589
593{
594 double dTotThick = 0;
595
596 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
597 {
599 double const dLayerThick = m_Layer.dGetSandConsolidatedThickness();
600 double const dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchSandLost();
601
602 dTotThick += (dLayerThick - dNotchEquiv);
603 }
604
605 return dTotThick;
606}
607
611{
612 double dTotThick = 0;
613
614 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
615 dTotThick += m_VLayerAboveBasement[n].dGetSandUnconsolidatedThickness();
616
617 return dTotThick;
618}
619
623{
624 double dTotThick = 0;
625
626 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
627 {
629 double const dLayerThick = m_Layer.dGetCoarseConsolidatedThickness();
630 double const dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchCoarseLost();
631
632 dTotThick += (dLayerThick - dNotchEquiv);
633 }
634
635 return dTotThick;
636}
637
640{
641 double dTotThick = 0;
642
643 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
644 dTotThick += m_VLayerAboveBasement[n].dGetCoarseUnconsolidatedThickness();
645
646 return dTotThick;
647}
648
652{
653 double dTotThick = 0;
654
655 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
656 dTotThick += m_VLayerAboveBasement[n].dGetConsolidatedThickness();
657
658 return dTotThick;
659}
660
664{
665 double dTotThick = 0;
666
667 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
668 dTotThick += m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
669
670 return dTotThick;
671}
672
675{
676 return (this->dGetTotUnconsThickness() + this->dGetTotConsThickness());
677}
678
680void CGeomCell::AppendLayers(int const nLayer)
681{
682 for (int i = 0; i < nLayer; i++)
684}
685
689{
690 m_VdAllHorizonTopElev.clear();
691 m_VdAllHorizonTopElev.push_back(
692 m_dBasementElevation); // Elevation of top of the basement
693
694 // Calculate the elevation of the top of all other layers
695 int m = 0;
696
697 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
698 m_VdAllHorizonTopElev.push_back(
699 m_VLayerAboveBasement[n].dGetTotalThickness() +
700 m_VdAllHorizonTopElev[m++]); // Elevation of top of layer n
701
702 // Now calculate the d50 of the topmost unconsolidated sediment layer with
703 // non-zero thickness. If there is no unconsolidated sediment, m_dUnconsD50 is
704 // set to DBL_NODATA
706
707 for (int n = static_cast<int>(m_VLayerAboveBasement.size()) - 1; n >= 0;
708 n--)
709 {
710 double const dUnconsThick = m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
711
712 if (dUnconsThick > 0)
713 {
714 // This is a layer with non-zero thickness of unconsolidated sediment
715 CRWCellSediment const *pUnconsSedLayer = m_VLayerAboveBasement[n].pGetUnconsolidatedSediment();
716 double const dFineProp = pUnconsSedLayer->dGetFineDepth() / dUnconsThick;
717 double const dSandProp = pUnconsSedLayer->dGetSandDepth() / dUnconsThick;
718 double const dCoarseProp = pUnconsSedLayer->dGetCoarseDepth() / dUnconsThick;
719
720 // Calculate d50 for the unconsolidated sediment
721 m_dUnconsD50 = (dFineProp * m_pGrid->pGetSim()->dGetD50Fine()) +
722 (dSandProp * m_pGrid->pGetSim()->dGetD50Sand()) +
723 (dCoarseProp * m_pGrid->pGetSim()->dGetD50Coarse());
724
725 break;
726 }
727 }
728}
729
735int CGeomCell::nGetLayerAtElev(double const dElev) const
736{
739 if (dElev < m_VdAllHorizonTopElev[0])
740 return ELEV_IN_BASEMENT;
741
742 for (unsigned int nLayer = 1; nLayer < m_VdAllHorizonTopElev.size();
743 nLayer++)
744 {
745 if ((m_VLayerAboveBasement[nLayer - 1].dGetTotalThickness() > 0) &&
746 (dElev >= m_VdAllHorizonTopElev[nLayer - 1]) &&
747 (dElev <= m_VdAllHorizonTopElev[nLayer]))
748 return (nLayer - 1);
749 }
750
752}
753
755double CGeomCell::dCalcLayerElev(const int nLayer)
756{
757 // Note no check to see if nLayer < m_VLayerAboveBasement.size()
758 double dTopElev = m_dBasementElevation;
759
760 for (int n = 0; n <= nLayer; n++)
761 dTopElev += m_VLayerAboveBasement[n].dGetTotalThickness();
762
763 return dTopElev;
764}
765
768void CGeomCell::SetPotentialPlatformErosion(double const dPotentialIn)
769{
771 m_dTotPotentialPlatformErosion += dPotentialIn;
772}
773
779
785
788void CGeomCell::SetActualPlatformErosion(double const dThisActualErosion)
789{
790 m_dActualPlatformErosionThisIter = dThisActualErosion;
791 m_dTotActualPlatformErosion += dThisActualErosion;
792}
793
799
805
809{
810 m_dSeaDepth = tMax(m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL() -
812 0.0);
813}
814
817{
820 // m_bEstimated =
823 // m_bCheckCell =
824 m_bCheckFloodCell = false;
825
827
829
839
841
842 // Initialize this-iteration sediment input event values
843 int const nThisLayer = this->nGetTopNonZeroLayerAboveBasement();
844
845 // Safety check
846 if ((nThisLayer == NO_NONZERO_THICKNESS_LAYERS) ||
847 (nThisLayer == INT_NODATA))
848 {
849 // Uh-oh, problem. So just return TODO 021
850 return;
851 }
852
853 m_VLayerAboveBasement[nThisLayer]
854 .pGetUnconsolidatedSediment()
855 ->InitThisIterSedimentInputAll();
856}
857
859void CGeomCell::SetWaveHeight(double const dWaveHeight)
860{
861 m_dWaveHeight = dWaveHeight;
862 m_dTotWaveHeight += dWaveHeight;
863
864 // if (m_dWaveHeight != DBL_NODATA)
865 // assert(m_dWaveHeight >= 0);
866}
867
869double CGeomCell::dGetWaveHeight(void) const { return m_dWaveHeight; }
870
872double CGeomCell::dGetTotWaveHeight(void) const { return m_dTotWaveHeight; }
873
876void CGeomCell::SetWaveAngle(double const dWaveAngle)
877{
878 m_dWaveAngle = dWaveAngle;
879 m_dTotWaveAngle += dWaveAngle;
880}
881
883double CGeomCell::dGetWaveAngle(void) const { return m_dWaveAngle; }
884
886double CGeomCell::dGetTotWaveAngle(void) const { return m_dTotWaveAngle; }
887
889void CGeomCell::SetCellDeepWaterWaveHeight(double const dWaveHeight)
890{
891 m_dDeepWaterWaveHeight = dWaveHeight;
892}
893
896{
898}
899
901void CGeomCell::SetCellDeepWaterWaveAngle(double const dWaveAngle)
902{
903 m_dDeepWaterWaveAngle = dWaveAngle;
904}
905
908{
910}
911
913void CGeomCell::SetCellDeepWaterWavePeriod(double const dWavePeriod)
914{
915 m_dDeepWaterWavePeriod = dWavePeriod;
916}
917
920{
922}
923
932
933// Sets this cell's beach protection factor
934void CGeomCell::SetBeachProtectionFactor(double const dFactor)
935{
936 m_dBeachProtectionFactor = dFactor;
937}
938
941{
943}
944
947void CGeomCell::IncrCliffCollapseErosion(double const dFineDepth,
948 double const dSandDepth,
949 double const dCoarseDepth)
950{
951 m_dCliffCollapseFineThisIter += dFineDepth;
952 m_dCliffCollapseSandThisIter += dSandDepth;
953 m_dCliffCollapseCoarseThisIter += dCoarseDepth;
954
955 m_dTotFineCliffCollapse += dFineDepth;
956 m_dTotSandCliffCollapse += dSandDepth;
957 m_dTotCoarseCliffCollapse += dCoarseDepth;
958}
959
966
973
980
984{
986}
987
991{
993}
994
998{
1000}
1001
1004void CGeomCell::AddSandTalusDeposition(double const dDepth)
1005{
1007 m_dTotTalusSandDeposition += dDepth;
1008}
1009
1013{
1016}
1017
1024
1031
1035{
1037}
1038
1045
1048void CGeomCell::SetPotentialBeachErosion(double const dPotentialIn)
1049{
1050 m_dPotentialBeachErosionThisIter = dPotentialIn;
1051 m_dTotPotentialBeachErosion += dPotentialIn;
1052}
1053
1059
1065
1068void CGeomCell::SetActualBeachErosion(double const dThisActualErosion)
1069{
1070 m_dActualBeachErosionThisIter = dThisActualErosion;
1071 m_dTotActualBeachErosion += dThisActualErosion;
1072}
1073
1076{
1078}
1079
1082{
1084}
1085
1086// //! Returns true if there has been actual beach erosion this timestep
1087// bool CGeomCell::bActualBeachErosionThisIter(void) const
1088// {
1089// return (m_dActualBeachErosionThisIter > 0 ? true : false);
1090// }
1091
1094void CGeomCell::IncrBeachDeposition(double const dThisDeposition)
1095{
1096 m_dBeachDepositionThisIter += dThisDeposition;
1097 m_dTotBeachDeposition += dThisDeposition;
1098}
1099
1102{
1104}
1105
1108{
1109 return m_dTotBeachDeposition;
1110}
1111
1112// //! Returns true if there has been beach deposition this timestep
1113// bool CGeomCell::bBeachDepositionThisIter(void) const
1114// {
1115// return (m_dBeachDepositionThisIter > 0 ? true : false);
1116// }
1117
1121{
1123 return true;
1124
1125 return false;
1126}
1127
1129double CGeomCell::dGetUnconsD50(void) const { return m_dUnconsD50; }
1130
1132void CGeomCell::SetInterventionClass(int const nSubCatCode)
1133{
1134 if (nSubCatCode != LF_NONE)
1135 {
1136 this->m_Landform.SetLFCategory(LF_CAT_INTERVENTION);
1137
1138 if (nSubCatCode == IO_INTERVENTION_STRUCT)
1139 this->m_Landform.SetLFSubCategory(LF_SUBCAT_INTERVENTION_STRUCT);
1140
1141 else if (nSubCatCode == IO_INTERVENTION_NON_STRUCT)
1142 this->m_Landform.SetLFSubCategory(LF_SUBCAT_INTERVENTION_NON_STRUCT);
1143 }
1144}
1145
1148{
1149 int nTmp = INT_NODATA;
1150
1151 if (this->m_Landform.nGetLFCategory() == LF_CAT_INTERVENTION)
1152 {
1153 if (this->m_Landform.nGetLFSubCategory() == LF_SUBCAT_INTERVENTION_STRUCT)
1155
1156 else if (this->m_Landform.nGetLFSubCategory() ==
1159 }
1160
1161 return nTmp;
1162}
1163
1165void CGeomCell::SetInterventionHeight(double const dHeight)
1166{
1167 m_dInterventionHeight = dHeight;
1168}
1169
1172{
1173 return m_dInterventionHeight;
1174}
1175
1179{
1181}
Contains CGeomCell definitions.
Contains CRWCellLayer definitions.
Contains CRWCellSediment definitions.
double m_dTotActualPlatformErosion
Total depth of sediment actually eroded from the shore platform.
Definition cell.h:176
double dGetTotCliffCollapseFine(void) const
Definition cell.cpp:983
void SetCellDeepWaterWavePeriod(double const)
Sets the deep water wave Period on this cell.
Definition cell.cpp:913
double dGetTotWaveHeight(void) const
Returns the total wave height on this cell.
Definition cell.cpp:872
void SetInContiguousFlood(void)
Set this cell as in the contiguous runup flood area.
Definition cell.cpp:99
double dGetThisIterCliffCollapseErosionFine(void) const
Definition cell.cpp:962
double m_dTotTalusCoarseDeposition
Definition cell.h:216
double dGetTotCoarseTalusDeposition(void) const
Definition cell.cpp:1041
double m_dTotPotentialPlatformErosion
Definition cell.h:170
int m_nBoundingBoxEdge
If this cell is an edge (or bounding box) cell, this specifies the edge.
Definition cell.h:93
double m_dWaveAngle
Wave orientation.
Definition cell.h:136
double dGetTotPotentialPlatformErosion(void) const
Get total potential (unconstrained) shore platform erosion.
Definition cell.cpp:781
bool bIsinAnyShadowZone(void) const
Returns true if this cell is in any shadow zone, false otherwise.
Definition cell.cpp:265
double dGetTotConsFineThickConsiderNotch(void) const
Definition cell.cpp:563
bool bIsFloodBySetupSurge(void) const
Is this cell flooded by setup surge?
Definition cell.cpp:108
bool m_bCheckFloodCell
TODO 007 What is this used for?
Definition cell.h:75
void CalcAllLayerElevsAndD50(void)
Definition cell.cpp:688
bool m_bCliff
Is this cell a cliff.
Definition cell.h:63
int nGetTopLayerAboveBasement(void) const
Definition cell.cpp:445
double dCalcLayerElev(const int)
For this cell, calculates the elevation of the top of a given layer.
Definition cell.cpp:755
int nGetShadowZoneNumber(void) const
Gets the number of the shadow zone that this cell is in.
Definition cell.cpp:252
void SetWaveHeight(double const)
Sets the wave height on this cell, also increments the total wave height.
Definition cell.cpp:859
bool bIsShadowZoneBoundary(void) const
Returns a flag which shows whether this cell is a shadow zone boundary.
Definition cell.cpp:141
double dGetCellDeepWaterWavePeriod(void) const
Returns the deep water wave period on this cell.
Definition cell.cpp:919
void InitCell(void)
Initialise values for this cell.
Definition cell.cpp:816
double dGetCellDeepWaterWaveAngle(void) const
Returns the deep water wave orientation on this cell.
Definition cell.cpp:907
bool bBeachErosionOrDepositionThisIter(void) const
Definition cell.cpp:1120
double dGetTotPotentialBeachErosion(void) const
Get total potential (supply-unconstrained) beach erosion.
Definition cell.cpp:1061
bool bIsFloodBySetupSurgeRunup(void) const
Is this cell flooded by setup surge runup?
Definition cell.cpp:120
void SetInActiveZone(bool const)
Sets a flag to show whether this cell is in the active zone.
Definition cell.cpp:132
double dGetPotentialBeachErosion(void) const
Get potential (unconstrained) beach erosion.
Definition cell.cpp:1055
bool bIsInContiguousSea(void) const
Is this a sea cell?
Definition cell.cpp:96
double m_dBeachProtectionFactor
Definition cell.h:155
bool m_bInContiguousSea
Switch to indicate if this is a sea cell, contiguous with other sea cells.
Definition cell.h:51
int nGetPolygonCoastID(void) const
Definition cell.cpp:234
bool bIsBoundingBoxEdge(void) const
Is this an edge bounding-box cell?
Definition cell.cpp:87
double m_dTotActualBeachErosion
Total depth of unconsolidated beach sediment actually eroded.
Definition cell.h:230
double dGetTotBeachDeposition(void) const
Get beach erosion.
Definition cell.cpp:1107
void SetSuspendedSediment(double const)
Definition cell.cpp:394
double dGetTotWaveAngle(void) const
Returns the total wave orientation on this cell.
Definition cell.cpp:886
void IncrBeachDeposition(double const)
Definition cell.cpp:1094
void SetActualPlatformErosion(double const)
Definition cell.cpp:788
double dGetSeaDepth(void) const
Returns the depth of seawater on this cell.
Definition cell.cpp:387
bool bPotentialPlatformErosion(void) const
Returns true if this cell has had potential erosion this timestep.
Definition cell.cpp:172
double dGetTotActualBeachErosion(void) const
Get total actual (supply-constrained) beach erosion.
Definition cell.cpp:1081
double m_dBasementElevation
Elevation of basement surface (m)
Definition cell.h:117
int m_nCoastlineNormal
Definition cell.h:103
double dGetCellDeepWaterWaveHeight(void) const
Returns the deep water wave height on this cell.
Definition cell.cpp:895
double dGetInterventionTopElev(void) const
Definition cell.cpp:1178
double dGetOverallTopElev(void) const
Definition cell.cpp:512
double dGetTotUnconsFine(void) const
Returns the total thickness of fine unconsolidated sediment on this cell.
Definition cell.cpp:580
double m_dLocalConsSlope
Used in erosion calculations, stored here for display purposes.
Definition cell.h:114
int nGetTopNonZeroLayerAboveBasement(void) const
Definition cell.cpp:427
bool m_bFloodBySetupSurgeRunup
TODO 007 What is this used for?
Definition cell.h:90
double dGetTotConsSandThickConsiderNotch(void) const
Definition cell.cpp:592
double dGetTotSandTalusDeposition(void) const
Definition cell.cpp:1034
double m_dBeachDepositionThisIter
Depth of unconsolidated beach sediment deposited this timestep.
Definition cell.h:233
bool m_bPossibleFloodStartCell
TODO 007 What is this used for?
Definition cell.h:84
double dGetTotCliffCollapseSand(void) const
Definition cell.cpp:990
double dGetBeachDeposition(void) const
Get beach deposition.
Definition cell.cpp:1101
bool bIsInundated(void) const
Definition cell.cpp:520
void AppendLayers(int const)
Appends sediment layers.
Definition cell.cpp:680
bool bIsPossibleCoastStartCell(void) const
Definition cell.cpp:152
int m_nPolygonCoastID
If this cell is within a polygon, this is the ID of the polygon's coast.
Definition cell.h:99
void SetActualBeachErosion(double const)
Definition cell.cpp:1068
double dGetBeachProtectionFactor(void) const
Returns this cell's beach protection factor.
Definition cell.cpp:940
double m_dTalusSandDepositionThisIter
Definition cell.h:204
double m_dTalusCoarseDepositionThisIter
Definition cell.h:212
double dGetTotAllSedThickness(void) const
Returns the total thickness of all sediment (all size classes) on this cell.
Definition cell.cpp:674
double m_dTotBeachDeposition
Total depth of unconsolidated beach sediment deposited.
Definition cell.h:236
void AddCoarseTalusDeposition(double const)
Definition cell.cpp:1012
void SetPotentialBeachErosion(double const)
Definition cell.cpp:1048
double m_dTotWaveHeight
Total wave height (m) (used to calc average)
Definition cell.h:133
int nGetPolygonID(void) const
Definition cell.cpp:224
double dGetSedimentTopElev(void) const
Definition cell.cpp:497
~CGeomCell(void)
Destructor.
Definition cell.cpp:75
int nGetBoundingBoxEdge(void) const
Returns the number of the bounding-box edge, or NO_DIRECTION if it is not.
Definition cell.cpp:84
bool bIsInActiveZone(void) const
Returns a flag which shows whether this cell is in the active zone.
Definition cell.cpp:135
CRWCellLayer * pGetLayerAboveBasement(int const)
Definition cell.cpp:473
double m_dTotWaveAngle
Total wave orientation (used to calc average)
Definition cell.h:142
void SetInterventionHeight(double const)
Sets the intervention height.
Definition cell.cpp:1165
bool bIsFloodLine(void) const
Returns true if the cell is flood line.
Definition cell.cpp:198
int nGetProfileID(void) const
Definition cell.cpp:208
double m_dCliffCollapseSandThisIter
Definition cell.h:184
double dGetThisIterCliffCollapseCoarseTalusDeposition(void) const
Definition cell.cpp:1027
double dGetSedimentPlusInterventionTopElev(void) const
Definition cell.cpp:505
double dGetSlope(void) const
Returns this cell's slope.
Definition cell.cpp:372
double dGetInterventionHeight(void) const
Returns the intervention height.
Definition cell.cpp:1171
void SetPolygonID(int const)
Sets the global ID number of the polygon which 'contains' this cell.
Definition cell.cpp:220
void SetAsCoastline(bool const)
Marks this cell as 'under' a coastline.
Definition cell.cpp:183
double m_dPotentialPlatformErosionThisIter
Definition cell.h:166
double m_dTotSandCliffCollapse
Definition cell.h:196
double dGetThisIterSWL(void) const
Returns the sea surface elevation at current iteration.
Definition cell.cpp:527
int nGetInterventionClass(void) const
Gets the intervention class.
Definition cell.cpp:1147
void SetLocalConsSlope(double const)
Sets the local slope of the consolidated sediment only.
Definition cell.cpp:348
double dGetThisIterCliffCollapseSandTalusDeposition(void) const
Definition cell.cpp:1020
void SetDownDriftZoneNumber(int const)
Sets the down drift zone number.
Definition cell.cpp:333
static CGeomRasterGrid * m_pGrid
Definition cell.h:259
double dGetWaveHeight(void) const
Returns the wave height on this cell.
Definition cell.cpp:869
double dGetWaveAngle(void) const
Returns the wave orientation on this cell.
Definition cell.cpp:883
double dGetTotSeaDepth(void) const
Returns the total depth of seawater on this cell.
Definition cell.cpp:390
void SetSlope(double const)
Sets this cell's slope.
Definition cell.cpp:369
bool bIsCliff(void) const
Returns true if the cell is 'under' a coastline.
Definition cell.cpp:192
double m_dTotFineCliffCollapse
Definition cell.h:192
int nGetLayerAtElev(double const) const
Definition cell.cpp:735
double m_dTotCoarseCliffCollapse
Definition cell.h:200
CRWCellLandform m_Landform
This cell's landform data.
Definition cell.h:246
void SetCoastAndPolygonID(int const, int const)
Definition cell.cpp:238
double m_dCliffCollapseFineThisIter
Definition cell.h:180
double m_dDeepWaterWaveHeight
Wave height if this is a deep water cell.
Definition cell.h:145
double dGetLocalConsSlope(void) const
Returns the local slope of the consolidated sediment only.
Definition cell.cpp:354
double m_dActualBeachErosionThisIter
Depth of unconsolidated beach sediment actually eroded this timestep.
Definition cell.h:227
double m_dTotSuspendedSediment
Definition cell.h:162
void SetInterventionClass(int const)
Sets the landform category and subcategory for an intervention.
Definition cell.cpp:1132
bool m_bInContiguousFlood
Switch to indicate that this cell is in the contiguous runup flood area.
Definition cell.h:54
void SetWaveValuesToDeepWaterWaveValues(void)
Definition cell.cpp:926
void SetBoundingBoxEdge(int const)
Set the edge number if this cell is an edge bounding-box cell.
Definition cell.cpp:78
double dGetTotUnconsCoarse(void) const
Returns the total thickness of coarse unconsolidated sediment on this cell.
Definition cell.cpp:639
void SetFloodBySetupSurgeRunup(void)
Set this cell as flooded by setup surge runup.
Definition cell.cpp:114
void SetPotentialPlatformErosion(double const)
Definition cell.cpp:768
bool m_bIsInActiveZone
Switch to indicate that this cell is in the active zone.
Definition cell.h:57
void SetPossibleFloodStartCell(void)
Definition cell.cpp:159
void AddSuspendedSediment(double const)
Definition cell.cpp:404
bool m_bShadowBoundary
Switch to show this cell is 'under' a shadow boundaryu.
Definition cell.h:78
int nGetDownDriftZoneNumber(void) const
Gets the down drift zone number.
Definition cell.cpp:339
double dGetTotUnconsSand(void) const
Definition cell.cpp:610
void UnSetInContiguousFlood(void)
Set this cell as not in the contiguous runup flood area.
Definition cell.cpp:102
bool bIsInContiguousSeaArea(void) const
Is this cell in the contiguous sea area?
Definition cell.cpp:126
double dGetUnconsD50(void) const
Returns the D50 of unconsolidated sediment on this cell.
Definition cell.cpp:1129
double m_dPotentialBeachErosionThisIter
Definition cell.h:220
bool bIsCellFloodCheck(void) const
Returns true if this cell is checked, false otherwise (flood switch)
Definition cell.cpp:330
double dGetTotActualPlatformErosion(void) const
Get total actual (constrained) shore platform erosion.
Definition cell.cpp:801
bool bIsElevLessThanWaterLevel(void) const
Definition cell.cpp:304
vector< double > m_VdAllHorizonTopElev
Definition cell.h:255
double m_dWavePeriod
Wave period (s)
Definition cell.h:139
double m_dSeaDepth
Depth of still water (m), is zero if not inundated.
Definition cell.h:123
double dGetTotUnconsThickness(void) const
Definition cell.cpp:663
double dGetBasementElev(void) const
Returns this cell's basement elevation.
Definition cell.cpp:363
int m_nPolygonID
If this cell is within a polygon, this is the ID of the polygon.
Definition cell.h:96
bool bIsPossibleFloodStartCell(void) const
Definition cell.cpp:166
double m_dActualPlatformErosionThisIter
Depth of sediment actually eroded from the shore platform this timestep.
Definition cell.h:173
double dGetPotentialPlatformErosion(void) const
Get potential (unconstrained) shore platform erosion.
Definition cell.cpp:775
double dGetTotSuspendedSediment(void) const
Returns the total suspended sediment depth equivalent on this cell.
Definition cell.cpp:419
double m_dDeepWaterWaveAngle
Wave orientation if this is a deep water cell.
Definition cell.h:148
double dGetActualBeachErosion(void) const
Get actual (supply-constrained) beach erosion.
Definition cell.cpp:1075
void SetSeaDepth(void)
Definition cell.cpp:808
void SetShadowZoneNumber(int const)
Set the number of the shadow zone that this cell is in.
Definition cell.cpp:246
double dGetTotConsCoarseThickConsiderNotch(void) const
Definition cell.cpp:622
void SetCellDeepWaterWaveAngle(double const)
Sets the deep water wave orientation on this cell.
Definition cell.cpp:901
bool m_bPossibleCoastStartCell
Switch to show that this cell could be the start of a coastline.
Definition cell.h:81
CGeomCell()
Constructor with initialization list.
Definition cell.cpp:44
double dGetActualPlatformErosion(void) const
Get actual (constrained) shore platform erosion.
Definition cell.cpp:795
void SetFloodBySetupSurge(void)
Set this cell as flooded by setup surge.
Definition cell.cpp:105
int m_nShadowZoneNumber
Definition cell.h:107
bool bIsinThisShadowZone(int const) const
Definition cell.cpp:256
double m_dDeepWaterWavePeriod
Wave period if this is a deep water cell.
Definition cell.h:151
double m_dTotPotentialBeachErosion
Definition cell.h:224
double m_dSuspendedSediment
Suspended sediment as depth equivalent (m)
Definition cell.h:158
double m_dTotTalusSandDeposition
Definition cell.h:208
double dGetTotConsThickness(void) const
Definition cell.cpp:651
void SetCheckFloodCell(void)
Set this cell as checked (flood switch)
Definition cell.cpp:324
void SetInContiguousSea(void)
Set this cell as a sea cell.
Definition cell.cpp:93
int m_nDownDriftZoneNumber
Definition cell.h:111
double m_dWaveHeight
Wave height (m)
Definition cell.h:130
void SetWaveAngle(double const)
Definition cell.cpp:876
void SetProfileID(int const)
Marks this cell as 'under' a coastline-normal profile.
Definition cell.cpp:201
void SetPossibleCoastStartCell(void)
Definition cell.cpp:145
double m_dSlope
Slope at this cell (degrees or unitless)
Definition cell.h:120
void SetShadowZoneBoundary(void)
Sets a flag to show that this cell is a shadow zone boundary.
Definition cell.cpp:138
double dGetThisIterCliffCollapseErosionCoarse(void) const
Definition cell.cpp:976
void SetBasementElev(double const)
Sets this cell's basement elevation.
Definition cell.cpp:357
void IncrCliffCollapseErosion(double const, double const, double const)
Definition cell.cpp:947
void AddSandTalusDeposition(double const)
Definition cell.cpp:1004
double dGetSuspendedSediment(void) const
Returns the suspended sediment depth equivalent on this cell.
Definition cell.cpp:413
bool bIsProfile(void) const
Returns true if this cell is 'under' a coastline normal.
Definition cell.cpp:211
double m_dUnconsD50
Definition cell.h:240
double m_dInterventionHeight
Height of intervention structure.
Definition cell.h:243
vector< CRWCellLayer > m_VLayerAboveBasement
Number of layers NOT including the basement. Layer 0 is the lowest.
Definition cell.h:250
bool m_bFloodLine
Switch to indicate that this cell is 'under' a runup flood line.
Definition cell.h:66
bool bIsCoastline(void) const
Returns true if the cell is 'under' a coastline.
Definition cell.cpp:186
void SetPolygonCoastID(int const)
Sets the coast number of the polygon which 'contains' this cell.
Definition cell.cpp:227
void UnSetCheckFloodCell(void)
Set the cell as not checked (flood switch)
Definition cell.cpp:327
void SetAsCliff(bool const)
Marks this cell as 'under' a coastline.
Definition cell.cpp:189
void SetCellDeepWaterWaveHeight(double const)
Sets the deep water wave height on this cell.
Definition cell.cpp:889
double dGetThisIterCliffCollapseErosionSand(void) const
Definition cell.cpp:969
bool bBasementElevIsMissingValue(void) const
Definition cell.cpp:376
double dGetTotCliffCollapseCoarse(void) const
Definition cell.cpp:997
bool m_bWaveFlood
Switch to indicate that this cell is 'under' a runup wave flood line.
Definition cell.h:69
double m_dCliffCollapseCoarseThisIter
Definition cell.h:188
CRWCellLandform * pGetLandform(void)
Returns a pointer to this cell's CRWCellLandform object.
Definition cell.cpp:345
void SetBeachProtectionFactor(double const)
Definition cell.cpp:934
void SetWaveFlood(void)
Set this cell as flooded by swl + surge + setup + runup.
Definition cell.cpp:274
void SetAsFloodLine(bool const)
Marks this cell is flood line.
Definition cell.cpp:195
double m_dTotSeaDepth
Definition cell.h:127
double dGetConsSedTopForLayerAboveBasement(int const) const
Definition cell.cpp:455
bool m_bFloodBySetupSurge
TODO 007 What is this used for?
Definition cell.h:87
double dGetThisIterTotWaterLevel(void) const
Returns the total water level at current iteration.
Definition cell.cpp:533
bool m_bCoastline
Switch to indicate that this cell is 'under' a coastline.
Definition cell.h:60
Real-world class used to represent the landform of a cell.
Real-world class used to represent the sediment layers associated with a cell object.
Definition cell_layer.h:32
CRWCellSediment * pGetConsolidatedSediment(void)
Returns a pointer to the cell's consolidated sediment object.
double dGetCoarseConsolidatedThickness(void) const
Returns the thickness of this cell's coarse consolidated sediment.
double dGetFineConsolidatedThickness(void) const
Returns the thickness of this cell's fine consolidated sediment.
double dGetSandConsolidatedThickness(void) const
Returns the thickness of this cell's sand consolidated sediment.
Real-world class used to represent the sediment (either consolidated or unconsolidated) associated wi...
double dGetCoarseDepth(void) const
Returns the coarse sediment depth equivalent for this sediment layer object.
double dGetNotchFineLost(void) const
Gets the depth equivalent of fine sediment lost by notch incision.
double dGetFineDepth(void) const
Returns the fine sediment depth equivalent for this sediment layer object.
double dGetNotchSandLost(void) const
Gets the depth equivalent of sand sediment lost by notch incision.
double dGetNotchCoarseLost(void) const
Gets the depth equivalent of coarse sediment lost by notch incision.
double dGetSandDepth(void) const
Returns the sand sediment depth equivalent for this sediment layer.
This file contains global definitions for CoastalME.
int const NO_NONZERO_THICKNESS_LAYERS
Definition cme.h:769
int const INT_NODATA
Definition cme.h:476
double const TOLERANCE
Definition cme.h:813
int const ELEV_ABOVE_SEDIMENT_TOP
Definition cme.h:768
int const IO_INTERVENTION_STRUCT
Definition cme.h:528
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1293
T tMax(T a, T b)
Definition cme.h:1242
int const LF_SUBCAT_INTERVENTION_NON_STRUCT
Definition cme.h:560
int const NO_DIRECTION
Definition cme.h:496
int const IO_INTERVENTION_NON_STRUCT
Definition cme.h:529
double const DBL_NODATA
Definition cme.h:824
int const LF_NONE
Definition cme.h:532
int const ELEV_IN_BASEMENT
Definition cme.h:767
int const LF_SUBCAT_INTERVENTION_STRUCT
Definition cme.h:559
int const LF_CAT_INTERVENTION
Definition cme.h:545
Contains CSimulation definitions.