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
15This file is part of CoastalME, the Coastal Modelling Environment.
16
17CoastalME 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
19This 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
21You 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 <vector>
25using std::vector;
26
27#include <assert.h>
28
29#include "cme.h"
30#include "simulation.h"
31#include "cell.h"
32
35 : m_bInContiguousSea(false),
37 m_bIsInActiveZone(false),
38 m_bCoastline(false),
39 m_bFloodLine(false),
40 m_bWaveFlood(false),
41 // m_bCheckCell(false),
42 m_bCheckFloodCell(false),
43 m_bShadowBoundary(false),
53 m_dSeaDepth(0),
84 m_dUnconsD50(0),
86{
87 m_Landform.SetLFCategory(LF_NONE);
88}
89
94
96void CGeomCell::SetBoundingBoxEdge(int const nDirection)
97{
98 m_nBoundingBoxEdge = nDirection;
99}
100
103{
104 return m_nBoundingBoxEdge;
105}
106
109{
111}
112
115{
116 m_bInContiguousSea = true;
117}
118
121{
122 return m_bInContiguousSea;
123}
124
130
136
142
145{
147}
148
154
160
163{
165}
166
168void CGeomCell::SetInActiveZone(bool const bFlag)
169{
170 m_bIsInActiveZone = bFlag;
171}
172
175{
176 return m_bIsInActiveZone;
177}
178
184
187{
188 return m_bShadowBoundary;
189}
190
196
202
208
214
220
221// bool CGeomCell::bActualPlatformErosion(void) const
222// {
223// return (m_dActualPlatformErosionThisIter > 0);
224// }
225
227void CGeomCell::SetAsCoastline(bool const bNewFlag)
228{
229 m_bCoastline = bNewFlag;
230}
231
234{
235 return m_bCoastline;
236}
237
239void CGeomCell::SetAsFloodLine(bool const bNewFlag)
240{
241 m_bFloodLine = bNewFlag;
242}
243
246{
247 return m_bFloodLine;
248}
249
251void CGeomCell::SetProfileID(int const nNormal)
252{
253 m_nCoastlineNormal = nNormal;
254}
255
258{
259 return m_nCoastlineNormal;
260}
261
263bool CGeomCell::bIsProfile(void) const
264{
266 return false;
267
268 return true;
269}
270
272void CGeomCell::SetPolygonID(int const nPolyID)
273{
274 m_nPolygonID = nPolyID;
275}
276
279{
280 return m_nPolygonID;
281}
282
285{
286 m_nShadowZoneNumber = nCode;
287}
288
291{
292 return m_nShadowZoneNumber;
293}
294
296bool CGeomCell::bIsinThisShadowZone(int const nZone) const
297{
298 if (m_nShadowZoneNumber == nZone)
299 return true;
300
301 return false;
302}
303
306{
307 if (m_nShadowZoneNumber != 0)
308 return true;
309
310 return false;
311}
312
315{
316 m_bWaveFlood = true;
317}
318
319// void CGeomCell::SetWaveSetup(int const dWaveSetup)
320// {
321// m_dWaveSetup = dWaveSetup;
322// }
323
324// void CGeomCell::SetStormSurge(int const dStormSurge)
325// {
326// m_dStormSurge = dStormSurge;
327// }
328
329// void CGeomCell::SetRunUp(int const dRunUp)
330// {
331// m_dRunUp = dRunUp;
332// }
333
334// void CGeomCell::SetTotLevel(void) const
335// {
336// m_dTotLevel = m_dWaveSetup + m_dStormSurge + m_dRunUp + m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL();
337// }
338
339// int CGeomCell::nGetTotLevel(void) const
340// {
341// return m_dTotLevel;
342// }
343
346{
347 return ((m_VdAllHorizonTopElev.back() + m_dInterventionHeight) < (m_pGrid->pGetSim()->dGetThisIterTotWaterLevel() + m_pGrid->pGetSim()->dGetThisIterSWL()));
348}
349
350// //! Set this cell as checked TODO What is this used for?
351// void CGeomCell::SetCheckCell(void)
352// {
353// m_bCheckCell = true;
354// }
355
356// //! Returns true if this cell is checked, false otherwise TODO 007 What is this used for?
357// bool CGeomCell::bIsCellCheck(void) const
358// {
359// return m_bCheckCell;
360// }
361
364{
365 m_bCheckFloodCell = true;
366}
367
370{
371 m_bCheckFloodCell = false;
372}
373
376{
377 return m_bCheckFloodCell;
378}
379
382{
384}
385
388{
390}
391
397
399void CGeomCell::SetLocalConsSlope(double const dNewSlope)
400{
401 m_dLocalConsSlope = dNewSlope;
402}
403
406{
407 return m_dLocalConsSlope;
408}
409
411void CGeomCell::SetBasementElev(double const dNewElev)
412{
413 m_dBasementElevation = dNewElev;
414}
415
418{
419 return (m_dBasementElevation);
420}
421
424{
425 if (bFPIsEqual(m_dBasementElevation, m_pGrid->pGetSim()->CSimulation::dGetMissingValue(), TOLERANCE))
426 return true;
427
428 return false;
429}
430
432double CGeomCell::dGetSeaDepth(void) const
433{
434 return (m_dSeaDepth);
435}
436
439{
440 return (m_dTotSeaDepth);
441}
442
444void CGeomCell::SetSuspendedSediment(double const dNewSedDepth)
445{
446 // Note no checks here to see if new equiv depth is sensible (e.g. non-negative)
447 m_dSuspendedSediment = dNewSedDepth;
448 m_dTotSuspendedSediment += dNewSedDepth;
449}
450
452void CGeomCell::AddSuspendedSediment(double const dIncSedDepth)
453{
454 // Note no checks here to see if increment equiv depth is sensible (e.g. non-negative)
455 m_dSuspendedSediment += dIncSedDepth;
456 m_dTotSuspendedSediment += dIncSedDepth;
457}
458
461{
462 return (m_dSuspendedSediment);
463}
464
467{
469}
470
473{
474 if (m_VLayerAboveBasement.empty())
475 return INT_NODATA;
476
477 int nTop = static_cast<int>(m_VLayerAboveBasement.size()) - 1;
478 while (m_VLayerAboveBasement[nTop].dGetTotalThickness() <= 0)
479 {
480 if (--nTop < 0)
482 }
483
484 return nTop;
485}
486
489{
490 if (m_VLayerAboveBasement.empty())
491 return INT_NODATA;
492
493 return static_cast<int>(m_VLayerAboveBasement.size()) - 1;
494}
495
498{
499 // Note no check to see if nLayer < m_VLayerAboveBasement.size()
500 double dTopElev = m_dBasementElevation;
501
502 for (int n = 0; n < nLayer; n++)
503 {
504 dTopElev += m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
505 dTopElev += m_VLayerAboveBasement[n].dGetConsolidatedThickness();
506 }
507
508 dTopElev += m_VLayerAboveBasement[nLayer].dGetConsolidatedThickness();
509
510 return dTopElev;
511}
512
515{
516 // TODO 055 No check that nLayer < size()
517 return &m_VLayerAboveBasement[nLayer];
518}
519
520// //! Returns the volume-equivalent elevation of the sediment's top surface for this cell (i.e. if there is a cliff notch, then lower the elevation by the notch's volume)
521// double CGeomCell::dGetVolEquivSedTopElev(void) const
522// {
523// double dTopElev = m_dBasementElevation;
524// for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
525// {
526// dTopElev += (m_VLayerAboveBasement[n].dGetUnconsolidatedThickness() - m_VLayerAboveBasement[n].dGetNotchUnconsolidatedLost());
527// dTopElev += (m_VLayerAboveBasement[n].dGetConsolidatedThickness() - m_VLayerAboveBasement[n].dGetNotchConsolidatedLost());
528// }
529//
530// return dTopElev;
531// }
532
535{
536 return m_VdAllHorizonTopElev.back();
537}
538
544
550
553{
554 return ((m_VdAllHorizonTopElev.back() + m_dInterventionHeight) < m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL());
555}
556
559{
560 return m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL();
561}
562
565{
566 return m_pGrid->pGetSim()->CSimulation::dGetThisIterTotWaterLevel();
567}
568
569// //! Returns true if the elevation of the sediment top surface for this cell is greater than or equal to the grid's this-timestep still water elevation. Also returns true if the cell has unconsolidated sediment on it and the elevation of the sediment top surface, minus a tolerance value, is less than the grid's this-timestep still water elevation
570// bool CGeomCell::bIsSeaIncBeach(void) const
571// {
572// if (m_bInContiguousSea)
573// // Sea
574// return true;
575//
576// double
577// dWaterLevel = m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL(),
578// dSedTop = m_VdAllHorizonTopElev.back();
579//
580// // Beach
581// if ((m_VLayerAboveBasement.back().dGetUnconsolidatedThickness() > 0) && ((dSedTop - m_pGrid->pGetSim()->CSimulation::dGetMaxBeachElevAboveSWL()) < dWaterLevel))
582// return true;
583//
584// return false;
585// }
586
589{
590 double dTotThick = 0;
591 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
592 {
594 double dLayerThick = m_Layer.dGetFineConsolidatedThickness();
595 double dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchFineLost();
596
597 dTotThick += (dLayerThick - dNotchEquiv);
598 }
599
600 return dTotThick;
601}
602
605{
606 double dTotThick = 0;
607 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
608 dTotThick += m_VLayerAboveBasement[n].dGetFineUnconsolidatedThickness();
609
610 return dTotThick;
611}
612
615{
616 double dTotThick = 0;
617 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
618 {
620 double dLayerThick = m_Layer.dGetSandConsolidatedThickness();
621 double dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchSandLost();
622
623 dTotThick += (dLayerThick - dNotchEquiv);
624 }
625
626 return dTotThick;
627}
628
631{
632 double dTotThick = 0;
633 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
634 dTotThick += m_VLayerAboveBasement[n].dGetSandUnconsolidatedThickness();
635
636 return dTotThick;
637}
638
641{
642 double dTotThick = 0;
643 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
644 {
646 double dLayerThick = m_Layer.dGetCoarseConsolidatedThickness();
647 double dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchCoarseLost();
648
649 dTotThick += (dLayerThick - dNotchEquiv);
650 }
651
652 return dTotThick;
653}
654
657{
658double dTotThick = 0;
659 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
660 dTotThick += m_VLayerAboveBasement[n].dGetCoarseUnconsolidatedThickness();
661
662 return dTotThick;
663}
664
667{
668 double dTotThick = 0;
669 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
670 dTotThick += m_VLayerAboveBasement[n].dGetConsolidatedThickness();
671
672 return dTotThick;
673}
674
677{
678 double dTotThick = 0;
679 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
680 dTotThick += m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
681
682 return dTotThick;
683}
684
687{
688 return (this->dGetTotUnconsThickness() + this->dGetTotConsThickness());
689}
690
692void CGeomCell::AppendLayers(int const nLayer)
693{
694 for (int i = 0; i < nLayer; i++)
696}
697
700{
701 m_VdAllHorizonTopElev.clear();
702 m_VdAllHorizonTopElev.push_back(m_dBasementElevation); // Elevation of top of the basement
703
704 // Calculate the elevation of the top of all other layers
705 int m = 0;
706 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
707 m_VdAllHorizonTopElev.push_back(m_VLayerAboveBasement[n].dGetTotalThickness() + m_VdAllHorizonTopElev[m++]); // Elevation of top of layer n
708
709 // Now calculate the d50 of the topmost unconsolidated sediment layer with non-zero thickness. If there is no unconsolidated sediment, m_dUnconsD50 is set to DBL_NODATA
711 for (int n = static_cast<int>(m_VLayerAboveBasement.size()) - 1; n >= 0; n--)
712 {
713 double dUnconsThick = m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
714 if (dUnconsThick > 0)
715 {
716 // This is a layer with non-zero thickness of unconsolidated sediment
717 CRWCellSediment const* pUnconsSedLayer = m_VLayerAboveBasement[n].pGetUnconsolidatedSediment();
718 double dFineProp = pUnconsSedLayer->dGetFineDepth() / dUnconsThick;
719 double dSandProp = pUnconsSedLayer->dGetSandDepth() / dUnconsThick;
720 double dCoarseProp = pUnconsSedLayer->dGetCoarseDepth() / dUnconsThick;
721
722 // Calculate d50 for the unconsolidated sediment
723 m_dUnconsD50 = (dFineProp * m_pGrid->pGetSim()->dGetD50Fine()) + (dSandProp * m_pGrid->pGetSim()->dGetD50Sand()) + (dCoarseProp * m_pGrid->pGetSim()->dGetD50Coarse());
724
725 break;
726 }
727 }
728}
729
731int CGeomCell::nGetLayerAtElev(double const dElev) const
732{
734 if (dElev < m_VdAllHorizonTopElev[0])
735 return ELEV_IN_BASEMENT;
736
737 for (unsigned int nLayer = 1; nLayer < m_VdAllHorizonTopElev.size(); nLayer++)
738 {
739 if ((m_VLayerAboveBasement[nLayer - 1].dGetTotalThickness() > 0) && (dElev >= m_VdAllHorizonTopElev[nLayer - 1]) && (dElev <= m_VdAllHorizonTopElev[nLayer]))
740 return (nLayer - 1);
741 }
742
744}
745
747double CGeomCell::dCalcLayerElev(const int nLayer)
748{
749 // Note no check to see if nLayer < m_VLayerAboveBasement.size()
750 double dTopElev = m_dBasementElevation;
751
752 for (int n = 0; n <= nLayer; n++)
753 dTopElev += m_VLayerAboveBasement[n].dGetTotalThickness();
754
755 return dTopElev;
756}
757
759void CGeomCell::SetPotentialPlatformErosion(double const dPotentialIn)
760{
762 m_dTotPotentialPlatformErosion += dPotentialIn;
763}
764
770
776
778void CGeomCell::SetActualPlatformErosion(double const dThisActualErosion)
779{
780 m_dActualPlatformErosionThisIter = dThisActualErosion;
781 m_dTotActualPlatformErosion += dThisActualErosion;
782}
783
789
795
798{
799 m_dSeaDepth = tMax(m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL() - (m_VdAllHorizonTopElev.back() + m_dInterventionHeight), 0.0);
800}
801
804{
810 // m_bEstimated =
815 // m_bCheckCell =
816 m_bCheckFloodCell = false;
817
820
823
837 m_dWaveAngle = 0;
838
840
841 // Initialize this-iteration sediment input event values
842 int nThisLayer = this->nGetTopNonZeroLayerAboveBasement();
843
844 // Safety check
845 if ((nThisLayer == NO_NONZERO_THICKNESS_LAYERS) || (nThisLayer == INT_NODATA))
846 {
847 // Uh-oh, problem. So just return TODO 021
848 return;
849 }
850
851 m_VLayerAboveBasement[nThisLayer].pGetUnconsolidatedSediment()->InitThisIterSedimentInputAll();
852}
853
855void CGeomCell::SetWaveHeight(double const dWaveHeight)
856{
857 m_dWaveHeight = dWaveHeight;
858 m_dTotWaveHeight += dWaveHeight;
859
860 // if (m_dWaveHeight != DBL_NODATA)
861 // assert(m_dWaveHeight >= 0);
862}
863
866{
867 return m_dWaveHeight;
868}
869
872{
873 return m_dTotWaveHeight;
874}
875
877void CGeomCell::SetWaveAngle(double const dWaveAngle)
878{
879 m_dWaveAngle = dWaveAngle;
880 m_dTotWaveAngle += dWaveAngle;
881}
882
884double CGeomCell::dGetWaveAngle(void) const
885{
886 return m_dWaveAngle;
887}
888
891{
892 return m_dTotWaveAngle;
893}
894
896void CGeomCell::SetCellDeepWaterWaveHeight(double const dWaveHeight)
897{
898 m_dDeepWaterWaveHeight = dWaveHeight;
899}
900
903{
905}
906
908void CGeomCell::SetCellDeepWaterWaveAngle(double const dWaveAngle)
909{
910 m_dDeepWaterWaveAngle = dWaveAngle;
911}
912
915{
917}
918
920void CGeomCell::SetCellDeepWaterWavePeriod(double const dWavePeriod)
921{
922 m_dDeepWaterWavePeriod = dWavePeriod;
923}
924
927{
929}
930
938
939// Sets this cell's beach protection factor
940void CGeomCell::SetBeachProtectionFactor(double const dFactor)
941{
942 m_dBeachProtectionFactor = dFactor;
943}
944
947{
949}
950
952void CGeomCell::IncrCliffCollapseErosion(double const dFineDepth, double const dSandDepth, double const dCoarseDepth)
953{
954 m_dCliffCollapseFineThisIter += dFineDepth;
955 m_dCliffCollapseSandThisIter += dSandDepth;
956 m_dCliffCollapseCoarseThisIter += dCoarseDepth;
957
958 m_dTotFineCliffCollapse += dFineDepth;
959 m_dTotSandCliffCollapse += dSandDepth;
960 m_dTotCoarseCliffCollapse += dCoarseDepth;
961}
962
968
974
980
983{
985}
986
989{
991}
992
998
1000void CGeomCell::AddSandTalusDeposition(double const dDepth)
1001{
1003 m_dTotTalusSandDeposition += dDepth;
1004}
1005
1008{
1011}
1012
1018
1024
1027{
1029}
1030
1036
1038void CGeomCell::SetPotentialBeachErosion(double const dPotentialIn)
1039{
1040 m_dPotentialBeachErosionThisIter = dPotentialIn;
1041 m_dTotPotentialBeachErosion += dPotentialIn;
1042}
1043
1049
1055
1057void CGeomCell::SetActualBeachErosion(double const dThisActualErosion)
1058{
1059 m_dActualBeachErosionThisIter = dThisActualErosion;
1060 m_dTotActualBeachErosion += dThisActualErosion;
1061}
1062
1065{
1067}
1068
1071{
1073}
1074
1075// //! Returns true if there has been actual beach erosion this timestep
1076// bool CGeomCell::bActualBeachErosionThisIter(void) const
1077// {
1078// return (m_dActualBeachErosionThisIter > 0 ? true : false);
1079// }
1080
1082void CGeomCell::IncrBeachDeposition(double const dThisDeposition)
1083{
1084 m_dBeachDepositionThisIter += dThisDeposition;
1085 m_dTotBeachDeposition += dThisDeposition;
1086}
1087
1090{
1092}
1093
1096{
1097 return m_dTotBeachDeposition;
1098}
1099
1100// //! Returns true if there has been beach deposition this timestep
1101// bool CGeomCell::bBeachDepositionThisIter(void) const
1102// {
1103// return (m_dBeachDepositionThisIter > 0 ? true : false);
1104// }
1105
1108{
1110 return true;
1111
1112 return false;
1113}
1114
1117{
1118 return m_dUnconsD50;
1119}
1120
1122void CGeomCell::SetInterventionClass(int const nSubCatCode)
1123{
1124 if (nSubCatCode != LF_NONE)
1125 {
1126 this->m_Landform.SetLFCategory(LF_CAT_INTERVENTION);
1127
1128 if (nSubCatCode == IO_INTERVENTION_STRUCT)
1129 this->m_Landform.SetLFSubCategory(LF_SUBCAT_INTERVENTION_STRUCT);
1130 else if (nSubCatCode == IO_INTERVENTION_NON_STRUCT)
1131 this->m_Landform.SetLFSubCategory(LF_SUBCAT_INTERVENTION_NON_STRUCT);
1132 }
1133}
1134
1137{
1138 int nTmp = INT_NODATA;
1139
1140 if (this->m_Landform.nGetLFCategory() == LF_CAT_INTERVENTION)
1141 {
1142 if (this->m_Landform.nGetLFSubCategory() == LF_SUBCAT_INTERVENTION_STRUCT)
1144 else if (this->m_Landform.nGetLFSubCategory() == LF_SUBCAT_INTERVENTION_NON_STRUCT)
1146 }
1147
1148 return nTmp;
1149}
1150
1152void CGeomCell::SetInterventionHeight(double const dHeight)
1153{
1154 m_dInterventionHeight = dHeight;
1155}
1156
1159{
1160 return m_dInterventionHeight;
1161}
1162
1165{
1167}
Contains CGeomCell definitions.
double m_dTotActualPlatformErosion
Total depth of sediment actually eroded from the shore platform.
Definition cell.h:151
double dGetTotCliffCollapseFine(void) const
Returns the running total depth of fine-sized sediment eroded by cliff collapse on this cell.
Definition cell.cpp:982
void SetCellDeepWaterWavePeriod(double const)
Sets the deep water wave Period on this cell.
Definition cell.cpp:920
double dGetTotWaveHeight(void) const
Returns the total wave height on this cell.
Definition cell.cpp:871
void SetInContiguousFlood(void)
Set this cell as in the contiguous runup flood area.
Definition cell.cpp:126
double dGetThisIterCliffCollapseErosionFine(void) const
Returns the depth of this-timestep fine-sized sediment cliff collapse on this cell.
Definition cell.cpp:964
double m_dTotTalusCoarseDeposition
Total depth of unconsolidated coarse sediment deposited as a result of cliff collapse.
Definition cell.h:181
double dGetTotCoarseTalusDeposition(void) const
Returns the total depth of coarse talus deposition from cliff collapse on this cell.
Definition cell.cpp:1032
double m_dTotPotentialPlatformErosion
Total depth of sediment eroded from the shore platform, if no supply-limitation.
Definition cell.h:145
int m_nBoundingBoxEdge
If this cell is an edge (or bounding box) cell, this specifies the edge.
Definition cell.h:82
double m_dWaveAngle
Wave orientation.
Definition cell.h:115
double dGetTotPotentialPlatformErosion(void) const
Get total potential (unconstrained) shore platform erosion.
Definition cell.cpp:772
bool bIsinAnyShadowZone(void) const
Returns true if this cell is in any shadow zone, false otherwise.
Definition cell.cpp:305
double dGetTotConsFineThickConsiderNotch(void) const
Returns the total thickness of fine consolidated sediment on this cell, minus the depth-equivalent of...
Definition cell.cpp:588
bool bIsFloodBySetupSurge(void) const
Is this cell flooded by setup surge?
Definition cell.cpp:144
bool m_bCheckFloodCell
TODO 007 What is this used for?
Definition cell.h:64
void CalcAllLayerElevsAndD50(void)
For this cell, calculates the elevation of the top of every layer, and the d50 for the topmost uncons...
Definition cell.cpp:699
int nGetTopLayerAboveBasement(void) const
Returns the index of the topmost sediment layer (layer 0 being the one just above basement),...
Definition cell.cpp:488
double dCalcLayerElev(const int)
For this cell, calculates the elevation of the top of a given layer.
Definition cell.cpp:747
int nGetShadowZoneNumber(void) const
Gets the number of the shadow zone that this cell is in.
Definition cell.cpp:290
void SetWaveHeight(double const)
Sets the wave height on this cell, also increments the total wave height.
Definition cell.cpp:855
bool bIsShadowZoneBoundary(void) const
Returns a flag which shows whether this cell is a shadow zone boundary.
Definition cell.cpp:186
double dGetCellDeepWaterWavePeriod(void) const
Returns the deep water wave period on this cell.
Definition cell.cpp:926
void InitCell(void)
Initialise values for this cell.
Definition cell.cpp:803
double dGetCellDeepWaterWaveAngle(void) const
Returns the deep water wave orientation on this cell.
Definition cell.cpp:914
bool bBeachErosionOrDepositionThisIter(void) const
Returns true only if this cell has had no deposition or erosion this timestep.
Definition cell.cpp:1107
double dGetTotPotentialBeachErosion(void) const
Get total potential (supply-unconstrained) beach erosion.
Definition cell.cpp:1051
bool bIsFloodBySetupSurgeRunup(void) const
Is this cell flooded by setup surge runup?
Definition cell.cpp:156
void SetInActiveZone(bool const)
Sets a flag to show whether this cell is in the active zone.
Definition cell.cpp:168
double dGetPotentialBeachErosion(void) const
Get potential (unconstrained) beach erosion.
Definition cell.cpp:1045
bool bIsInContiguousSea(void) const
Is this a sea cell?
Definition cell.cpp:120
double m_dBeachProtectionFactor
Only meaningful if in zone of platform erosion. 0 is fully protected; 1 = no protection.
Definition cell.h:133
bool m_bInContiguousSea
Switch to indicate if this is a sea cell, contiguous with other sea cells.
Definition cell.h:43
bool bIsBoundingBoxEdge(void) const
Is this an edge bounding-box cell?
Definition cell.cpp:108
double m_dTotActualBeachErosion
Total depth of unconsolidated beach sediment actually eroded.
Definition cell.h:193
double dGetTotBeachDeposition(void) const
Get beach erosion.
Definition cell.cpp:1095
void SetSuspendedSediment(double const)
Sets this cell's suspended sediment depth equivalent, it also increments the running total of suspend...
Definition cell.cpp:444
double dGetTotWaveAngle(void) const
Returns the total wave orientation on this cell.
Definition cell.cpp:890
void IncrBeachDeposition(double const)
Increment this-timestep beach deposition, also increment total beach deposition.
Definition cell.cpp:1082
void SetActualPlatformErosion(double const)
Set this-timestep actual (constrained) shore platform erosion and increment total actual shore platfo...
Definition cell.cpp:778
double dGetSeaDepth(void) const
Returns the depth of seawater on this cell.
Definition cell.cpp:432
bool bPotentialPlatformErosion(void) const
Returns true if this cell has had potential erosion this timestep.
Definition cell.cpp:216
double dGetTotActualBeachErosion(void) const
Get total actual (supply-constrained) beach erosion.
Definition cell.cpp:1070
double m_dBasementElevation
Elevation of basement surface (m)
Definition cell.h:100
int m_nCoastlineNormal
If this cell is 'under' a coastline normal, this is the number of the normal.
Definition cell.h:88
double dGetCellDeepWaterWaveHeight(void) const
Returns the deep water wave height on this cell.
Definition cell.cpp:902
double dGetInterventionTopElev(void) const
Returns the elevation of the top of the intervention, assuming it rests on the sediment-top surface.
Definition cell.cpp:1164
double dGetOverallTopElev(void) const
Returns the highest elevation of the cell, which is either the sediment top elevation plus interventi...
Definition cell.cpp:546
double dGetTotUnconsFine(void) const
Returns the total thickness of fine unconsolidated sediment on this cell.
Definition cell.cpp:604
double m_dLocalConsSlope
Used in erosion calculations, stored here for display purposes.
Definition cell.h:97
int nGetTopNonZeroLayerAboveBasement(void) const
Returns the index of the topmost sediment layer (layer 0 being the one just above basement) with non-...
Definition cell.cpp:472
bool m_bFloodBySetupSurgeRunup
TODO 007 What is this used for?
Definition cell.h:79
double dGetTotConsSandThickConsiderNotch(void) const
Returns the total thickness of sand-sized consolidated sediment on this cell, minus the depth-equival...
Definition cell.cpp:614
double dGetTotSandTalusDeposition(void) const
Returns the total depth of sand talus deposition from cliff collapse on this cell.
Definition cell.cpp:1026
double m_dBeachDepositionThisIter
Depth of unconsolidated beach sediment deposited this timestep.
Definition cell.h:196
bool m_bPossibleFloodStartCell
TODO 007 What is this used for?
Definition cell.h:73
double dGetTotCliffCollapseSand(void) const
Returns the running total depth of sand-sized sediment eroded by cliff collapse on this cell.
Definition cell.cpp:988
double dGetBeachDeposition(void) const
Get beach deposition.
Definition cell.cpp:1089
bool bIsInundated(void) const
Returns true if the elevation of the sediment top surface for this cell (plus any intervention) is le...
Definition cell.cpp:552
void AppendLayers(int const)
Appends sediment layers.
Definition cell.cpp:692
bool bIsPossibleCoastStartCell(void) const
Returns a flag which shows whether this cell has been flagged as a possible start- or end-point for a...
Definition cell.cpp:198
void SetActualBeachErosion(double const)
Set this-timestep actual (supply-constrained) beach erosion and increment total actual beach erosion.
Definition cell.cpp:1057
double dGetBeachProtectionFactor(void) const
Returns this cell's beach protection factor.
Definition cell.cpp:946
double m_dTalusSandDepositionThisIter
Depth of unconsolidated sand sediment deposited as a result of cliff collapse this timestep.
Definition cell.h:172
double m_dTalusCoarseDepositionThisIter
Depth of unconsolidated coarse sediment deposited as a result of cliff collapse this timestep.
Definition cell.h:178
double dGetTotAllSedThickness(void) const
Returns the total thickness of all sediment (all size classes) on this cell.
Definition cell.cpp:686
double m_dTotBeachDeposition
Total depth of unconsolidated beach sediment deposited.
Definition cell.h:199
void AddCoarseTalusDeposition(double const)
Increments the depth of this-timestep coarse-sized talus from cliff collapse on this cell,...
Definition cell.cpp:1007
void SetPotentialBeachErosion(double const)
Set potential (unconstrained) beach erosion and increment total beach potential erosion.
Definition cell.cpp:1038
double m_dTotWaveHeight
Total wave height (m) (used to calc average)
Definition cell.h:112
int nGetPolygonID(void) const
Returns the global ID number of the polygon which 'contains' this cell (returns INT_NODATA if the cel...
Definition cell.cpp:278
double dGetSedimentTopElev(void) const
Returns the true elevation of the sediment's top surface for this cell (if there is a cliff notch,...
Definition cell.cpp:534
~CGeomCell(void)
Destructor.
Definition cell.cpp:91
int nGetBoundingBoxEdge(void) const
Returns the number of the bounding-box edge, or NO_DIRECTION if it is not.
Definition cell.cpp:102
bool bIsInActiveZone(void) const
Returns a flag which shows whether this cell is in the active zone.
Definition cell.cpp:174
CRWCellLayer * pGetLayerAboveBasement(int const)
Return a reference to the Nth sediment layer (layer 0 being just above basement)
Definition cell.cpp:514
double m_dTotWaveAngle
Total wave orientation (used to calc average)
Definition cell.h:121
void SetInterventionHeight(double const)
Sets the intervention height.
Definition cell.cpp:1152
bool bIsFloodLine(void) const
Returns true if the cell is flood line.
Definition cell.cpp:245
int nGetProfileID(void) const
If this cell is 'under' a coastline-normal profile, returns the number of the profile....
Definition cell.cpp:257
double m_dCliffCollapseSandThisIter
Depth of sand sediment (consolidated and unconsolidated) removed via cliff collapse this timestep.
Definition cell.h:157
double dGetThisIterCliffCollapseCoarseTalusDeposition(void) const
Retuns the depth of this-timestep coarse talus deposition from cliff collapse on this cell.
Definition cell.cpp:1020
double dGetSedimentPlusInterventionTopElev(void) const
Returns the true elevation of the sediment's top surface for this cell (if there is a cliff notch,...
Definition cell.cpp:540
double dGetInterventionHeight(void) const
Returns the intervention height.
Definition cell.cpp:1158
void SetPolygonID(int const)
Sets the global ID number of the polygon which 'contains' this cell.
Definition cell.cpp:272
void SetAsCoastline(bool const)
Marks this cell as 'under' a coastline.
Definition cell.cpp:227
double m_dPotentialPlatformErosionThisIter
Depth of sediment on the shore platform that could be eroded this timestep, if no supply-limitation.
Definition cell.h:142
double m_dTotSandCliffCollapse
Total depth of sand sediment (consolidated and unconsolidated) removed via cliff collapse.
Definition cell.h:166
double dGetThisIterSWL(void) const
Returns the sea surface elevation at current iteration.
Definition cell.cpp:558
int nGetInterventionClass(void) const
Gets the intervention class.
Definition cell.cpp:1136
void SetLocalConsSlope(double const)
Sets the local slope of the consolidated sediment only.
Definition cell.cpp:399
double dGetThisIterCliffCollapseSandTalusDeposition(void) const
Returns the depth of this-timestep sand talus deposition from cliff collapse on this cell.
Definition cell.cpp:1014
void SetDownDriftZoneNumber(int const)
Sets the down drift zone number.
Definition cell.cpp:381
static CGeomRasterGrid * m_pGrid
Definition cell.h:220
double dGetWaveHeight(void) const
Returns the wave height on this cell.
Definition cell.cpp:865
double dGetWaveAngle(void) const
Returns the wave orientation on this cell.
Definition cell.cpp:884
double dGetTotSeaDepth(void) const
Returns the total depth of seawater on this cell.
Definition cell.cpp:438
double m_dTotFineCliffCollapse
Total depth of fine sediment (consolidated and unconsolidated) removed via cliff collapse.
Definition cell.h:163
int nGetLayerAtElev(double const) const
Given an elevation, this finds the index of the layer that contains that elevation (layer 0 being the...
Definition cell.cpp:731
double m_dTotCoarseCliffCollapse
Total depth of coarse sediment (consolidated and unconsolidated) removed via cliff collapse.
Definition cell.h:169
CRWCellLandform m_Landform
This cell's landform data.
Definition cell.h:208
double m_dCliffCollapseFineThisIter
Depth of fine sediment (consolidated and unconsolidated) removed via cliff collapse this timestep.
Definition cell.h:154
double m_dDeepWaterWaveHeight
Wave height if this is a deep water cell.
Definition cell.h:124
double dGetLocalConsSlope(void) const
Returns the local slope of the consolidated sediment only.
Definition cell.cpp:405
double m_dActualBeachErosionThisIter
Depth of unconsolidated beach sediment actually eroded this timestep.
Definition cell.h:190
double m_dTotSuspendedSediment
Total depth of suspended sediment (m) since simulation start (used to calc average)
Definition cell.h:139
void SetInterventionClass(int const)
Sets the landform category and subcategory for an intervention.
Definition cell.cpp:1122
bool m_bInContiguousFlood
Switch to indicate that this cell is in the contiguous runup flood area.
Definition cell.h:46
void SetWaveValuesToDeepWaterWaveValues(void)
Sets wave height to the deep water wave height value, and sets wave orientation to the deep water wav...
Definition cell.cpp:932
void SetBoundingBoxEdge(int const)
Set the edge number if this cell is an edge bounding-box cell.
Definition cell.cpp:96
double dGetTotUnconsCoarse(void) const
Returns the total thickness of coarse unconsolidated sediment on this cell.
Definition cell.cpp:656
void SetFloodBySetupSurgeRunup(void)
Set this cell as flooded by setup surge runup.
Definition cell.cpp:150
void SetPotentialPlatformErosion(double const)
Set potential (unconstrained) shore platform erosion and increment total shore platform potential ero...
Definition cell.cpp:759
bool m_bIsInActiveZone
Switch to indicate that this cell is in the active zone.
Definition cell.h:49
void SetPossibleFloodStartCell(void)
Sets a flag to show that this cell has been flagged as a possible start-point for runup flooding.
Definition cell.cpp:204
void AddSuspendedSediment(double const)
Adds to this cell's suspended sediment depth equivalent, it also increments the running total of susp...
Definition cell.cpp:452
bool m_bShadowBoundary
Switch to show this cell is 'under' a shadow boundaryu.
Definition cell.h:67
int nGetDownDriftZoneNumber(void) const
Gets the down drift zone number.
Definition cell.cpp:387
double dGetTotUnconsSand(void) const
Returns the total thickness of sand-sized unconsolidated sediment on this cell.
Definition cell.cpp:630
void UnSetInContiguousFlood(void)
Set this cell as not in the contiguous runup flood area.
Definition cell.cpp:132
bool bIsInContiguousSeaArea(void) const
Is this cell in the contiguous sea area?
Definition cell.cpp:162
double dGetUnconsD50(void) const
Returns the D50 of unconsolidated sediment on this cell.
Definition cell.cpp:1116
double m_dPotentialBeachErosionThisIter
Depth of unconsolidated beach sediment that could be eroded this timestep, if no supply-limitation.
Definition cell.h:184
bool bIsCellFloodCheck(void) const
Returns true if this cell is checked, false otherwise (flood switch)
Definition cell.cpp:375
double dGetTotActualPlatformErosion(void) const
Get total actual (constrained) shore platform erosion.
Definition cell.cpp:791
bool bIsElevLessThanWaterLevel(void) const
Returns true if the top elevation of this cell (sediment plus any intervention) is less than this ite...
Definition cell.cpp:345
vector< double > m_VdAllHorizonTopElev
Number of layer-top elevations (inc. that of the basement, which is m_VdAllHorizonTopElev[0]); size 1...
Definition cell.h:215
double m_dWavePeriod
Wave period (s)
Definition cell.h:118
double m_dSeaDepth
Depth of still water (m), is zero if not inundated.
Definition cell.h:103
double dGetTotUnconsThickness(void) const
Returns the total thickness of unconsolidated sediment (all size classes) on this cell.
Definition cell.cpp:676
double dGetBasementElev(void) const
Returns this cell's basement elevation.
Definition cell.cpp:417
int m_nPolygonID
If this cell is within a polygon, this is the ID of the polygon.
Definition cell.h:85
bool bIsPossibleFloodStartCell(void) const
Returns a flag which shows whether this cell has been flagged as a possible start point for runup flo...
Definition cell.cpp:210
double m_dActualPlatformErosionThisIter
Depth of sediment actually eroded from the shore platform this timestep.
Definition cell.h:148
double dGetPotentialPlatformErosion(void) const
Get potential (unconstrained) shore platform erosion.
Definition cell.cpp:766
double dGetTotSuspendedSediment(void) const
Returns the total suspended sediment depth equivalent on this cell.
Definition cell.cpp:466
double m_dDeepWaterWaveAngle
Wave orientation if this is a deep water cell.
Definition cell.h:127
double dGetActualBeachErosion(void) const
Get actual (supply-constrained) beach erosion.
Definition cell.cpp:1064
void SetSeaDepth(void)
Returns the depth of seawater on this cell if the sediment top is < SWL, or zero.
Definition cell.cpp:797
void SetShadowZoneNumber(int const)
Set the number of the shadow zone that this cell is in.
Definition cell.cpp:284
double dGetTotConsCoarseThickConsiderNotch(void) const
Returns the total thickness of coarse consolidated sediment on this cell, minus the depth-equivalent ...
Definition cell.cpp:640
void SetCellDeepWaterWaveAngle(double const)
Sets the deep water wave orientation on this cell.
Definition cell.cpp:908
bool m_bPossibleCoastStartCell
Switch to show that this cell could be the start of a coastline.
Definition cell.h:70
CGeomCell()
Constructor with initialization list.
Definition cell.cpp:34
double dGetActualPlatformErosion(void) const
Get actual (constrained) shore platform erosion.
Definition cell.cpp:785
void SetFloodBySetupSurge(void)
Set this cell as flooded by setup surge.
Definition cell.cpp:138
int m_nShadowZoneNumber
If this cell is within a shadow zone, this is the number of the shadow zone.
Definition cell.h:91
bool bIsinThisShadowZone(int const) const
Returns true if this cell is in the shadow zone with number given by the parameter,...
Definition cell.cpp:296
double m_dDeepWaterWavePeriod
Wave period if this is a deep water cell.
Definition cell.h:130
double m_dTotPotentialBeachErosion
Total depth of unconsolidated beach sediment eroded; if no supply-limitation.
Definition cell.h:187
double m_dSuspendedSediment
Suspended sediment as depth equivalent (m)
Definition cell.h:136
double m_dTotTalusSandDeposition
Total depth of unconsolidated sand sediment deposited as a result of cliff collapse.
Definition cell.h:175
double dGetTotConsThickness(void) const
Returns the total thickness of consolidated sediment (all size classes) on this cell.
Definition cell.cpp:666
void SetCheckFloodCell(void)
Set this cell as checked (flood switch)
Definition cell.cpp:363
void SetInContiguousSea(void)
Set this cell as a sea cell.
Definition cell.cpp:114
int m_nDownDriftZoneNumber
If this cell is within a downdrift zone, this is the number of the downdrift zone.
Definition cell.h:94
double m_dWaveHeight
Wave height (m)
Definition cell.h:109
void SetWaveAngle(double const)
Sets the wave orientation on this cell, also increments the total wave orientation.
Definition cell.cpp:877
void SetProfileID(int const)
Marks this cell as 'under' a coastline-normal profile.
Definition cell.cpp:251
void SetPossibleCoastStartCell(void)
Sets a flag to show that this cell has been flagged as a possible start- or end-point for a coastline...
Definition cell.cpp:192
void SetShadowZoneBoundary(void)
Sets a flag to show that this cell is a shadow zone boundary.
Definition cell.cpp:180
double dGetThisIterCliffCollapseErosionCoarse(void) const
Returns the depth of this-timestep coarse-sized sediment cliff collapse on this cell.
Definition cell.cpp:976
void SetBasementElev(double const)
Sets this cell's basement elevation.
Definition cell.cpp:411
void IncrCliffCollapseErosion(double const, double const, double const)
Increments the fine, sand, and coarse depths of this-timestep cliff collapse on this cell,...
Definition cell.cpp:952
void AddSandTalusDeposition(double const)
Increments the depth of this-timestep sand-sized talus from cliff collapse on this cell,...
Definition cell.cpp:1000
double dGetSuspendedSediment(void) const
Returns the suspended sediment depth equivalent on this cell.
Definition cell.cpp:460
bool bIsProfile(void) const
Returns true if this cell is 'under' a coastline normal.
Definition cell.cpp:263
double m_dUnconsD50
d50 of unconsolidated sediment on top layer with unconsolidated sediment depth > 0
Definition cell.h:202
double m_dInterventionHeight
Height of intervention structure.
Definition cell.h:205
vector< CRWCellLayer > m_VLayerAboveBasement
Number of layers NOT including the basement. Layer 0 is the lowest.
Definition cell.h:212
bool m_bFloodLine
Switch to indicate that this cell is 'under' a runup flood line.
Definition cell.h:55
bool bIsCoastline(void) const
Returns true if the cell is 'under' a coastline.
Definition cell.cpp:233
void UnSetCheckFloodCell(void)
Set the cell as not checked (flood switch)
Definition cell.cpp:369
void SetCellDeepWaterWaveHeight(double const)
Sets the deep water wave height on this cell.
Definition cell.cpp:896
double dGetThisIterCliffCollapseErosionSand(void) const
Returns the depth of this-timestep sand-sized sediment cliff collapse on this cell.
Definition cell.cpp:970
bool bBasementElevIsMissingValue(void) const
Returns true if this cells's basement data is NODATA, is needed for irregularly-shaped DEMs.
Definition cell.cpp:423
double dGetTotCliffCollapseCoarse(void) const
Returns the running total depth of coarse-sized sediment eroded by cliff collapse on this cell.
Definition cell.cpp:994
bool m_bWaveFlood
Switch to indicate that this cell is 'under' a runup wave flood line.
Definition cell.h:58
double m_dCliffCollapseCoarseThisIter
Depth of coarse sediment (consolidated and unconsolidated) removed via cliff collapse this timestep.
Definition cell.h:160
CRWCellLandform * pGetLandform(void)
Returns a pointer to this cell's CRWCellLandform object.
Definition cell.cpp:393
void SetBeachProtectionFactor(double const)
Definition cell.cpp:940
void SetWaveFlood(void)
Set this cell as flooded by swl + surge + setup + runup.
Definition cell.cpp:314
void SetAsFloodLine(bool const)
Marks this cell is flood line.
Definition cell.cpp:239
double m_dTotSeaDepth
Total depth of still water (m) since beginning of simulation (used to calc average)
Definition cell.h:106
double dGetConsSedTopForLayerAboveBasement(int const) const
Returns the elevation of the top of the consolidated sediment only, for a given layer (layer 0 being ...
Definition cell.cpp:497
bool m_bFloodBySetupSurge
TODO 007 What is this used for?
Definition cell.h:76
double dGetThisIterTotWaterLevel(void) const
Returns the total water level at current iteration.
Definition cell.cpp:564
bool m_bCoastline
Switch to indicate that this cell is 'under' a coastline.
Definition cell.h:52
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:655
int const INT_NODATA
Definition cme.h:365
double const TOLERANCE
Definition cme.h:699
int const ELEV_ABOVE_SEDIMENT_TOP
Definition cme.h:654
int const IO_INTERVENTION_STRUCT
Definition cme.h:417
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1178
T tMax(T a, T b)
Definition cme.h:1125
int const LF_SUBCAT_INTERVENTION_NON_STRUCT
Definition cme.h:449
int const NO_DIRECTION
Definition cme.h:385
int const IO_INTERVENTION_NON_STRUCT
Definition cme.h:418
double const DBL_NODATA
Definition cme.h:709
int const LF_NONE
Definition cme.h:421
int const ELEV_IN_BASEMENT
Definition cme.h:653
int const LF_SUBCAT_INTERVENTION_STRUCT
Definition cme.h:448
int const LF_CAT_INTERVENTION
Definition cme.h:434
Contains CSimulation definitions.