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 <assert.h>
25#include "cme.h"
26#include "cell.h"
27
30 : m_bInContiguousSea(false),
31 m_bInContiguousFlood(false), // TODO 007 What is this?
32 m_bIsInActiveZone(false),
33 m_bCoastline(false),
34 m_bFloodLine(false),
35 m_bWaveFlood(false),
36 // m_bCheckCell(false), // TODO 007 What is this?
37 m_bCheckFloodCell(false), // TODO 007 What is this?
38 m_bShadowBoundary(false),
40 m_bPossibleFloodStartCell(false), // TODO 007 What is this?
48 m_dSeaDepth(0),
79 m_dUnconsD50(0),
81{
82 m_Landform.SetLFCategory(LF_NONE);
83}
84
89
91void CGeomCell::SetBoundingBoxEdge(int const nDirection)
92{
93 m_nBoundingBoxEdge = nDirection;
94}
95
98{
99 return m_nBoundingBoxEdge;
100}
101
104{
106}
107
110{
111 m_bInContiguousSea = true;
112}
113
116{
117 return m_bInContiguousSea;
118}
119
125
131
137
140{
142}
143
149
155
158{
160}
161
163void CGeomCell::SetInActiveZone(bool const bFlag)
164{
165 m_bIsInActiveZone = bFlag;
166}
167
170{
171 return m_bIsInActiveZone;
172}
173
179
182{
183 return m_bShadowBoundary;
184}
185
191
197
203
204// //! TODO 007 What is this for? Returns a flag which shows whether this cell has been flagged as a possible start- or end-point for a coastline
205// bool CGeomCell::bIsPossibleFloodStartCell(void) const
206// {
207// return m_bPossibleFloodStartCell;
208// }
209
215
216// bool CGeomCell::bActualPlatformErosion(void) const
217// {
218// return (m_dActualPlatformErosionThisIter > 0);
219// }
220
222void CGeomCell::SetAsCoastline(bool const bNewFlag)
223{
224 m_bCoastline = bNewFlag;
225}
226
229{
230 return m_bCoastline;
231}
232
234void CGeomCell::SetAsFloodLine(bool const bNewFlag)
235{
236 m_bFloodLine = bNewFlag;
237}
238
241{
242 return m_bFloodLine;
243}
244
246void CGeomCell::SetProfileID(int const nNormal)
247{
248 m_nCoastlineNormal = nNormal;
249}
250
253{
254 return m_nCoastlineNormal;
255}
256
258bool CGeomCell::bIsProfile(void) const
259{
261 return false;
262
263 return true;
264}
265
267void CGeomCell::SetPolygonID(int const nPolyID)
268{
269 m_nPolygonID = nPolyID;
270}
271
274{
275 return m_nPolygonID;
276}
277
280{
281 m_nShadowZoneNumber = nCode;
282}
283
286{
287 return m_nShadowZoneNumber;
288}
289
291bool CGeomCell::bIsinThisShadowZone(int const nZone) const
292{
293 if (m_nShadowZoneNumber == nZone)
294 return true;
295
296 return false;
297}
298
301{
302 if (m_nShadowZoneNumber != 0)
303 return true;
304
305 return false;
306}
307
308// Set this cell as flooded by swl + surge + setup + runup
309// void CGeomCell::SetWaveFlood(void)
310// {
311// m_bWaveFlood = true;
312// }
313
314// void CGeomCell::SetWaveSetup(int const dWaveSetup)
315// {
316// m_dWaveSetup = dWaveSetup;
317// }
318
319// void CGeomCell::SetStormSurge(int const dStormSurge)
320// {
321// m_dStormSurge = dStormSurge;
322// }
323
324// void CGeomCell::SetRunUp(int const dRunUp)
325// {
326// m_dRunUp = dRunUp;
327// }
328
329// void CGeomCell::SetTotLevel(void) const
330// {
331// m_dTotLevel = m_dWaveSetup + m_dStormSurge + m_dRunUp + m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL();
332// }
333
334// int CGeomCell::nGetTotLevel(void) const
335// {
336// return m_dTotLevel;
337// }
338
341{
342 return ((m_VdAllHorizonTopElev.back() + m_dInterventionHeight) < (m_pGrid->pGetSim()->dGetThisIterTotWaterLevel() + m_pGrid->pGetSim()->dGetThisIterSWL()));
343}
344
345// //! Set this cell as checked TODO What is this used for?
346// void CGeomCell::SetCheckCell(void)
347// {
348// m_bCheckCell = true;
349// }
350
351// //! Returns true if this cell is checked, false otherwise TODO 007 What is this used for?
352// bool CGeomCell::bIsCellCheck(void) const
353// {
354// return m_bCheckCell;
355// }
356
359{
360 m_bCheckFloodCell = true;
361}
362
365{
366 m_bCheckFloodCell = false;
367}
368
371{
372 return m_bCheckFloodCell;
373}
374
377{
379}
380
383{
385}
386
392
394void CGeomCell::SetLocalConsSlope(double const dNewSlope)
395{
396 m_dLocalConsSlope = dNewSlope;
397}
398
401{
402 return m_dLocalConsSlope;
403}
404
406void CGeomCell::SetBasementElev(double const dNewElev)
407{
408 m_dBasementElevation = dNewElev;
409}
410
413{
414 return (m_dBasementElevation);
415}
416
419{
420 if (bFPIsEqual(m_dBasementElevation, m_pGrid->pGetSim()->CSimulation::dGetMissingValue(), TOLERANCE))
421 return true;
422
423 return false;
424}
425
427double CGeomCell::dGetSeaDepth(void) const
428{
429 return (m_dSeaDepth);
430}
431
434{
435 return (m_dTotSeaDepth);
436}
437
439void CGeomCell::SetSuspendedSediment(double const dNewSedDepth)
440{
441 // Note no checks here to see if new equiv depth is sensible (e.g. non-negative)
442 m_dSuspendedSediment = dNewSedDepth;
443 m_dTotSuspendedSediment += dNewSedDepth;
444}
445
447void CGeomCell::AddSuspendedSediment(double const dIncSedDepth)
448{
449 // Note no checks here to see if increment equiv depth is sensible (e.g. non-negative)
450 m_dSuspendedSediment += dIncSedDepth;
451 m_dTotSuspendedSediment += dIncSedDepth;
452}
453
456{
457 return (m_dSuspendedSediment);
458}
459
462{
464}
465
468{
469 if (m_VLayerAboveBasement.empty())
470 return INT_NODATA;
471
472 int nTop = static_cast<int>(m_VLayerAboveBasement.size()) - 1;
473 while (m_VLayerAboveBasement[nTop].dGetTotalThickness() <= 0)
474 {
475 if (--nTop < 0)
477 }
478
479 return nTop;
480}
481
484{
485 if (m_VLayerAboveBasement.empty())
486 return INT_NODATA;
487
488 return static_cast<int>(m_VLayerAboveBasement.size()) - 1;
489}
490
493{
494 // Note no check to see if nLayer < m_VLayerAboveBasement.size()
495 double dTopElev = m_dBasementElevation;
496
497 for (int n = 0; n < nLayer; n++)
498 {
499 dTopElev += m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
500 dTopElev += m_VLayerAboveBasement[n].dGetConsolidatedThickness();
501 }
502
503 dTopElev += m_VLayerAboveBasement[nLayer].dGetConsolidatedThickness();
504
505 return dTopElev;
506}
507
510{
511 // TODO 055 No check that nLayer < size()
512 return &m_VLayerAboveBasement[nLayer];
513}
514
515// //! 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)
516// double CGeomCell::dGetVolEquivSedTopElev(void) const
517// {
518// double dTopElev = m_dBasementElevation;
519// for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
520// {
521// dTopElev += (m_VLayerAboveBasement[n].dGetUnconsolidatedThickness() - m_VLayerAboveBasement[n].dGetNotchUnconsolidatedLost());
522// dTopElev += (m_VLayerAboveBasement[n].dGetConsolidatedThickness() - m_VLayerAboveBasement[n].dGetNotchConsolidatedLost());
523// }
524//
525// return dTopElev;
526// }
527
530{
531 return m_VdAllHorizonTopElev.back();
532}
533
539
545
548{
549 return ((m_VdAllHorizonTopElev.back() + m_dInterventionHeight) < m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL());
550}
551
554{
555 return m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL();
556}
557
560{
561 return m_pGrid->pGetSim()->CSimulation::dGetThisIterTotWaterLevel();
562}
563
564// //! 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
565// bool CGeomCell::bIsSeaIncBeach(void) const
566// {
567// if (m_bInContiguousSea)
568// // Sea
569// return true;
570//
571// double
572// dWaterLevel = m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL(),
573// dSedTop = m_VdAllHorizonTopElev.back();
574//
575// // Beach
576// if ((m_VLayerAboveBasement.back().dGetUnconsolidatedThickness() > 0) && ((dSedTop - m_pGrid->pGetSim()->CSimulation::dGetMaxBeachElevAboveSWL()) < dWaterLevel))
577// return true;
578//
579// return false;
580// }
581
584{
585 double dTotThick = 0;
586 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
587 {
589 double dLayerThick = m_Layer.dGetFineConsolidatedThickness();
590 double dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchFineLost();
591
592 dTotThick += (dLayerThick - dNotchEquiv);
593 }
594
595 return dTotThick;
596}
597
600{
601 double dTotThick = 0;
602 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
603 dTotThick += m_VLayerAboveBasement[n].dGetFineUnconsolidatedThickness();
604
605 return dTotThick;
606}
607
610{
611 double dTotThick = 0;
612 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
613 {
615 double dLayerThick = m_Layer.dGetSandConsolidatedThickness();
616 double dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchSandLost();
617
618 dTotThick += (dLayerThick - dNotchEquiv);
619 }
620
621 return dTotThick;
622}
623
626{
627 double dTotThick = 0;
628 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
629 dTotThick += m_VLayerAboveBasement[n].dGetSandUnconsolidatedThickness();
630
631 return dTotThick;
632}
633
636{
637 double dTotThick = 0;
638 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
639 {
641 double dLayerThick = m_Layer.dGetCoarseConsolidatedThickness();
642 double dNotchEquiv = m_Layer.pGetConsolidatedSediment()->dGetNotchCoarseLost();
643
644 dTotThick += (dLayerThick - dNotchEquiv);
645 }
646
647 return dTotThick;
648}
649
652{
653double dTotThick = 0;
654 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
655 dTotThick += m_VLayerAboveBasement[n].dGetCoarseUnconsolidatedThickness();
656
657 return dTotThick;
658}
659
662{
663 double dTotThick = 0;
664 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
665 dTotThick += m_VLayerAboveBasement[n].dGetConsolidatedThickness();
666
667 return dTotThick;
668}
669
672{
673 double dTotThick = 0;
674 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
675 dTotThick += m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
676
677 return dTotThick;
678}
679
682{
683 return (this->dGetTotUnconsThickness() + this->dGetTotConsThickness());
684}
685
687void CGeomCell::AppendLayers(int const nLayer)
688{
689 for (int i = 0; i < nLayer; i++)
691}
692
695{
696 m_VdAllHorizonTopElev.clear();
697 m_VdAllHorizonTopElev.push_back(m_dBasementElevation); // Elevation of top of the basement
698
699 // Calculate the elevation of the top of all other layers
700 int m = 0;
701 for (unsigned int n = 0; n < m_VLayerAboveBasement.size(); n++)
702 m_VdAllHorizonTopElev.push_back(m_VLayerAboveBasement[n].dGetTotalThickness() + m_VdAllHorizonTopElev[m++]); // Elevation of top of layer n
703
704 // 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
706 for (int n = static_cast<int>(m_VLayerAboveBasement.size()) - 1; n >= 0; n--)
707 {
708 double dUnconsThick = m_VLayerAboveBasement[n].dGetUnconsolidatedThickness();
709 if (dUnconsThick > 0)
710 {
711 // This is a layer with non-zero thickness of unconsolidated sediment
712 CRWCellSediment const* pUnconsSedLayer = m_VLayerAboveBasement[n].pGetUnconsolidatedSediment();
713 double dFineProp = pUnconsSedLayer->dGetFineDepth() / dUnconsThick;
714 double dSandProp = pUnconsSedLayer->dGetSandDepth() / dUnconsThick;
715 double dCoarseProp = pUnconsSedLayer->dGetCoarseDepth() / dUnconsThick;
716
717 // Calculate d50 for the unconsolidated sediment
718 m_dUnconsD50 = (dFineProp * m_pGrid->pGetSim()->dGetD50Fine()) + (dSandProp * m_pGrid->pGetSim()->dGetD50Sand()) + (dCoarseProp * m_pGrid->pGetSim()->dGetD50Coarse());
719
720 break;
721 }
722 }
723}
724
726int CGeomCell::nGetLayerAtElev(double const dElev) const
727{
729 if (dElev < m_VdAllHorizonTopElev[0])
730 return ELEV_IN_BASEMENT;
731
732 for (unsigned int nLayer = 1; nLayer < m_VdAllHorizonTopElev.size(); nLayer++)
733 {
734 if ((m_VLayerAboveBasement[nLayer - 1].dGetTotalThickness() > 0) && (dElev >= m_VdAllHorizonTopElev[nLayer - 1]) && (dElev <= m_VdAllHorizonTopElev[nLayer]))
735 return (nLayer - 1);
736 }
737
739}
740
742double CGeomCell::dCalcLayerElev(const int nLayer)
743{
744 // Note no check to see if nLayer < m_VLayerAboveBasement.size()
745 double dTopElev = m_dBasementElevation;
746
747 for (int n = 0; n <= nLayer; n++)
748 dTopElev += m_VLayerAboveBasement[n].dGetTotalThickness();
749
750 return dTopElev;
751}
752
754void CGeomCell::SetPotentialPlatformErosion(double const dPotentialIn)
755{
757 m_dTotPotentialPlatformErosion += dPotentialIn;
758}
759
765
771
773void CGeomCell::SetActualPlatformErosion(double const dThisActualErosion)
774{
775 m_dActualPlatformErosionThisIter = dThisActualErosion;
776 m_dTotActualPlatformErosion += dThisActualErosion;
777}
778
784
790
793{
794 m_dSeaDepth = tMax(m_pGrid->pGetSim()->CSimulation::dGetThisIterSWL() - (m_VdAllHorizonTopElev.back() + m_dInterventionHeight), 0.0);
795}
796
799{
801 m_bInContiguousFlood = // TODO 007 What is this?
805 // m_bEstimated =
807 m_bPossibleCoastStartCell = // TODO 007 What is this?
810 // m_bCheckCell = // TODO 007 What is this?
811 m_bCheckFloodCell = false;
812
815
818
834 m_dWaveAngle = 0;
835
837
838 // Initialize this-iteration sediment input event values
839 int nThisLayer = this->nGetTopNonZeroLayerAboveBasement();
840
841 // Safety check
842 if ((nThisLayer == NO_NONZERO_THICKNESS_LAYERS) || (nThisLayer == INT_NODATA))
843 {
844 // Uh-oh, problem. So just return TODO 021
845 return;
846 }
847
848 m_VLayerAboveBasement[nThisLayer].pGetUnconsolidatedSediment()->InitThisIterSedimentInputAll();
849}
850
852void CGeomCell::SetWaveHeight(double const dWaveHeight)
853{
854 m_dWaveHeight = dWaveHeight;
855 m_dTotWaveHeight += dWaveHeight;
856
857 // if (m_dWaveHeight != DBL_NODATA)
858 // assert(m_dWaveHeight >= 0);
859}
860
863{
864 return m_dWaveHeight;
865}
866
869{
870 return m_dTotWaveHeight;
871}
872
874void CGeomCell::SetWaveAngle(double const dWaveAngle)
875{
876 m_dWaveAngle = dWaveAngle;
877 m_dTotWaveAngle += dWaveAngle;
878}
879
881double CGeomCell::dGetWaveAngle(void) const
882{
883 return m_dWaveAngle;
884}
885
888{
889 return m_dTotWaveAngle;
890}
891
893void CGeomCell::SetCellDeepWaterWaveHeight(double const dWaveHeight)
894{
895 m_dDeepWaterWaveHeight = dWaveHeight;
896}
897
900{
902}
903
905void CGeomCell::SetCellDeepWaterWaveAngle(double const dWaveAngle)
906{
907 m_dDeepWaterWaveAngle = dWaveAngle;
908}
909
912{
914}
915
917void CGeomCell::SetCellDeepWaterWavePeriod(double const dWavePeriod)
918{
919 m_dDeepWaterWavePeriod = dWavePeriod;
920}
921
924{
926}
927
935
936// Sets this cell's beach protection factor
937void CGeomCell::SetBeachProtectionFactor(double const dFactor)
938{
939 m_dBeachProtectionFactor = dFactor;
940}
941
944{
946}
947
949void CGeomCell::IncrCliffCollapseErosion(double const dFineDepth, double const dSandDepth, 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
965
971
977
980{
982}
983
986{
988}
989
995
997void CGeomCell::AddSandTalusDeposition(double const dDepth)
998{
1000 m_dTotTalusSandDeposition += dDepth;
1001}
1002
1005{
1008}
1009
1015
1021
1024{
1026}
1027
1033
1035void CGeomCell::SetPotentialBeachErosion(double const dPotentialIn)
1036{
1037 m_dPotentialBeachErosionThisIter = dPotentialIn;
1038 m_dTotPotentialBeachErosion += dPotentialIn;
1039}
1040
1046
1052
1054void CGeomCell::SetActualBeachErosion(double const dThisActualErosion)
1055{
1056 m_dActualBeachErosionThisIter = dThisActualErosion;
1057 m_dTotActualBeachErosion += dThisActualErosion;
1058}
1059
1062{
1064}
1065
1068{
1070}
1071
1072// //! Returns true if there has been actual beach erosion this timestep
1073// bool CGeomCell::bActualBeachErosionThisIter(void) const
1074// {
1075// return (m_dActualBeachErosionThisIter > 0 ? true : false);
1076// }
1077
1079void CGeomCell::IncrBeachDeposition(double const dThisDeposition)
1080{
1081 m_dBeachDepositionThisIter += dThisDeposition;
1082 m_dTotBeachDeposition += dThisDeposition;
1083}
1084
1087{
1089}
1090
1093{
1094 return m_dTotBeachDeposition;
1095}
1096
1097// //! Returns true if there has been beach deposition this timestep
1098// bool CGeomCell::bBeachDepositionThisIter(void) const
1099// {
1100// return (m_dBeachDepositionThisIter > 0 ? true : false);
1101// }
1102
1105{
1107 return true;
1108
1109 return false;
1110}
1111
1114{
1115 return m_dUnconsD50;
1116}
1117
1119void CGeomCell::SetInterventionClass(int const nSubCatCode)
1120{
1121 if (nSubCatCode != LF_NONE)
1122 {
1123 this->m_Landform.SetLFCategory(LF_CAT_INTERVENTION);
1124
1125 if (nSubCatCode == IO_INTERVENTION_STRUCT)
1126 this->m_Landform.SetLFSubCategory(LF_SUBCAT_INTERVENTION_STRUCT);
1127 else if (nSubCatCode == IO_INTERVENTION_NON_STRUCT)
1128 this->m_Landform.SetLFSubCategory(LF_SUBCAT_INTERVENTION_NON_STRUCT);
1129 }
1130}
1131
1134{
1135 int nTmp = INT_NODATA;
1136
1137 if (this->m_Landform.nGetLFCategory() == LF_CAT_INTERVENTION)
1138 {
1139 if (this->m_Landform.nGetLFSubCategory() == LF_SUBCAT_INTERVENTION_STRUCT)
1141 else if (this->m_Landform.nGetLFSubCategory() == LF_SUBCAT_INTERVENTION_NON_STRUCT)
1143 }
1144
1145 return nTmp;
1146}
1147
1149void CGeomCell::SetInterventionHeight(double const dHeight)
1150{
1151 m_dInterventionHeight = dHeight;
1152}
1153
1156{
1157 return m_dInterventionHeight;
1158}
1159
1162{
1164}
Contains CGeomCell definitions.
double m_dTotActualPlatformErosion
Total depth of sediment actually eroded from the shore platform.
Definition cell.h:146
double dGetTotCliffCollapseFine(void) const
Returns the running total depth of fine-sized sediment eroded by cliff collapse on this cell.
Definition cell.cpp:979
void SetCellDeepWaterWavePeriod(double const)
Sets the deep water wave Period on this cell.
Definition cell.cpp:917
double dGetTotWaveHeight(void) const
Returns the total wave height on this cell.
Definition cell.cpp:868
void SetInContiguousFlood(void)
TODO 007 What do this do? Does it duplicate SetInContiguousSea()?
Definition cell.cpp:121
double dGetThisIterCliffCollapseErosionFine(void) const
Returns the depth of this-timestep fine-sized sediment cliff collapse on this cell.
Definition cell.cpp:961
double m_dTotTalusCoarseDeposition
Total depth of unconsolidated coarse sediment deposited as a result of cliff collapse.
Definition cell.h:176
double dGetTotCoarseTalusDeposition(void) const
Returns the total depth of coarse talus deposition from cliff collapse on this cell.
Definition cell.cpp:1029
double m_dTotPotentialPlatformErosion
Total depth of sediment eroded from the shore platform, if no supply-limitation.
Definition cell.h:140
int m_nBoundingBoxEdge
If this cell is an edge (or bounding box) cell, this specifies the edge.
Definition cell.h:77
double m_dWaveAngle
Wave orientation.
Definition cell.h:110
double dGetTotPotentialPlatformErosion(void) const
Get total potential (unconstrained) shore platform erosion.
Definition cell.cpp:767
bool bIsinAnyShadowZone(void) const
Returns true if this cell is in any shadow zone, false otherwise.
Definition cell.cpp:300
double dGetTotConsFineThickConsiderNotch(void) const
Returns the total thickness of fine consolidated sediment on this cell, minus the depth-equivalent of...
Definition cell.cpp:583
bool bIsFloodBySetupSurge(void) const
TODO 007 What does this do? Is this cell flood by setup surge?
Definition cell.cpp:139
bool m_bCheckFloodCell
TODO 007 What is this used for?
Definition cell.h:59
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:694
int nGetTopLayerAboveBasement(void) const
Returns the index of the topmost sediment layer (layer 0 being the one just above basement),...
Definition cell.cpp:483
double dCalcLayerElev(const int)
For this cell, calculates the elevation of the top of a given layer.
Definition cell.cpp:742
int nGetShadowZoneNumber(void) const
Gets the number of the shadow zone that this cell is in.
Definition cell.cpp:285
void SetWaveHeight(double const)
Sets the wave height on this cell, also increments the total wave height.
Definition cell.cpp:852
bool bIsShadowZoneBoundary(void) const
Returns a flag which shows whether this cell is a shadow zone boundary.
Definition cell.cpp:181
double dGetCellDeepWaterWavePeriod(void) const
Returns the deep water wave period on this cell.
Definition cell.cpp:923
void InitCell(void)
Initialise values for this cell.
Definition cell.cpp:798
double dGetCellDeepWaterWaveAngle(void) const
Returns the deep water wave orientation on this cell.
Definition cell.cpp:911
bool bBeachErosionOrDepositionThisIter(void) const
Returns true only if this cell has had no deposition or erosion this timestep.
Definition cell.cpp:1104
double dGetTotPotentialBeachErosion(void) const
Get total potential (supply-unconstrained) beach erosion.
Definition cell.cpp:1048
bool bIsFloodBySetupSurgeRunup(void) const
TODO 007 What does this do? Is this cell flood by setup surge runup?
Definition cell.cpp:151
void SetInActiveZone(bool const)
Sets a flag to show whether this cell is in the active zone.
Definition cell.cpp:163
double dGetPotentialBeachErosion(void) const
Get potential (unconstrained) beach erosion.
Definition cell.cpp:1042
bool bIsInContiguousSea(void) const
Is this a sea cell?
Definition cell.cpp:115
double m_dBeachProtectionFactor
Only meaningful if in zone of platform erosion. 0 is fully protected; 1 = no protection.
Definition cell.h:128
bool m_bInContiguousSea
Switch to indicate if this is a sea cell, contiguous with other sea cells.
Definition cell.h:38
bool bIsBoundingBoxEdge(void) const
Is this an edge bounding-box cell?
Definition cell.cpp:103
double m_dTotActualBeachErosion
Total depth of unconsolidated beach sediment actually eroded.
Definition cell.h:188
double dGetTotBeachDeposition(void) const
Get beach erosion.
Definition cell.cpp:1092
void SetSuspendedSediment(double const)
Sets this cell's suspended sediment depth equivalent, it also increments the running total of suspend...
Definition cell.cpp:439
double dGetTotWaveAngle(void) const
Returns the total wave orientation on this cell.
Definition cell.cpp:887
void IncrBeachDeposition(double const)
Increment this-timestep beach deposition, also increment total beach deposition.
Definition cell.cpp:1079
void SetActualPlatformErosion(double const)
Set this-timestep actual (constrained) shore platform erosion and increment total actual shore platfo...
Definition cell.cpp:773
double dGetSeaDepth(void) const
Returns the depth of seawater on this cell.
Definition cell.cpp:427
bool bPotentialPlatformErosion(void) const
Returns true if this cell has had potential erosion this timestep.
Definition cell.cpp:211
double dGetTotActualBeachErosion(void) const
Get total actual (supply-constrained) beach erosion.
Definition cell.cpp:1067
double m_dBasementElevation
Elevation of basement surface (m)
Definition cell.h:95
int m_nCoastlineNormal
If this cell is 'under' a coastline normal, this is the number of the normal.
Definition cell.h:83
double dGetCellDeepWaterWaveHeight(void) const
Returns the deep water wave height on this cell.
Definition cell.cpp:899
double dGetInterventionTopElev(void) const
Returns the elevation of the top of the intervention, assuming it rests on the sediment-top surface.
Definition cell.cpp:1161
double dGetOverallTopElev(void) const
Returns the highest elevation of the cell, which is either the sediment top elevation plus interventi...
Definition cell.cpp:541
double dGetTotUnconsFine(void) const
Returns the total thickness of fine unconsolidated sediment on this cell.
Definition cell.cpp:599
double m_dLocalConsSlope
Used in erosion calculations, stored here for display purposes.
Definition cell.h:92
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:467
bool m_bFloodBySetupSurgeRunup
TODO 007 What is this used for?
Definition cell.h:74
double dGetTotConsSandThickConsiderNotch(void) const
Returns the total thickness of sand-sized consolidated sediment on this cell, minus the depth-equival...
Definition cell.cpp:609
double dGetTotSandTalusDeposition(void) const
Returns the total depth of sand talus deposition from cliff collapse on this cell.
Definition cell.cpp:1023
bool bIsInContiguousFlood(void) const
TODO 007 What does this do? Does it just duplicate bIsInContiguousSea()?
Definition cell.cpp:157
double m_dBeachDepositionThisIter
Depth of unconsolidated beach sediment deposited this timestep.
Definition cell.h:191
bool m_bPossibleFloodStartCell
TODO 007 What is this used for?
Definition cell.h:68
double dGetTotCliffCollapseSand(void) const
Returns the running total depth of sand-sized sediment eroded by cliff collapse on this cell.
Definition cell.cpp:985
double dGetBeachDeposition(void) const
Get beach deposition.
Definition cell.cpp:1086
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:547
void AppendLayers(int const)
Appends sediment layers.
Definition cell.cpp:687
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:193
void SetActualBeachErosion(double const)
Set this-timestep actual (supply-constrained) beach erosion and increment total actual beach erosion.
Definition cell.cpp:1054
double dGetBeachProtectionFactor(void) const
Returns this cell's beach protection factor.
Definition cell.cpp:943
double m_dTalusSandDepositionThisIter
Depth of unconsolidated sand sediment deposited as a result of cliff collapse this timestep.
Definition cell.h:167
double m_dTalusCoarseDepositionThisIter
Depth of unconsolidated coarse sediment deposited as a result of cliff collapse this timestep.
Definition cell.h:173
double dGetTotAllSedThickness(void) const
Returns the total thickness of all sediment (all size classes) on this cell.
Definition cell.cpp:681
double m_dTotBeachDeposition
Total depth of unconsolidated beach sediment deposited.
Definition cell.h:194
void AddCoarseTalusDeposition(double const)
Increments the depth of this-timestep coarse-sized talus from cliff collapse on this cell,...
Definition cell.cpp:1004
void SetPotentialBeachErosion(double const)
Set potential (unconstrained) beach erosion and increment total beach potential erosion.
Definition cell.cpp:1035
double m_dTotWaveHeight
Total wave height (m) (used to calc average)
Definition cell.h:107
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:273
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:529
~CGeomCell(void)
Destructor.
Definition cell.cpp:86
int nGetBoundingBoxEdge(void) const
Returns the number of the bounding-box edge, or NO_DIRECTION if it is not.
Definition cell.cpp:97
bool bIsInActiveZone(void) const
Returns a flag which shows whether this cell is in the active zone.
Definition cell.cpp:169
CRWCellLayer * pGetLayerAboveBasement(int const)
Return a reference to the Nth sediment layer (layer 0 being just above basement)
Definition cell.cpp:509
double m_dTotWaveAngle
Total wave orientation (used to calc average)
Definition cell.h:116
void SetInterventionHeight(double const)
Sets the intervention height.
Definition cell.cpp:1149
bool bIsFloodLine(void) const
Returns true if the cell is flood line.
Definition cell.cpp:240
int nGetProfileID(void) const
If this cell is 'under' a coastline-normal profile, returns the number of the profile....
Definition cell.cpp:252
double m_dCliffCollapseSandThisIter
Depth of sand sediment (consolidated and unconsolidated) removed via cliff collapse this timestep.
Definition cell.h:152
double dGetThisIterCliffCollapseCoarseTalusDeposition(void) const
Retuns the depth of this-timestep coarse talus deposition from cliff collapse on this cell.
Definition cell.cpp:1017
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:535
double dGetInterventionHeight(void) const
Returns the intervention height.
Definition cell.cpp:1155
void SetPolygonID(int const)
Sets the global ID number of the polygon which 'contains' this cell.
Definition cell.cpp:267
void SetAsCoastline(bool const)
Marks this cell as 'under' a coastline.
Definition cell.cpp:222
double m_dPotentialPlatformErosionThisIter
Depth of sediment on the shore platform that could be eroded this timestep, if no supply-limitation.
Definition cell.h:137
double m_dTotSandCliffCollapse
Total depth of sand sediment (consolidated and unconsolidated) removed via cliff collapse.
Definition cell.h:161
double dGetThisIterSWL(void) const
Returns the sea surface elevation at current iteration.
Definition cell.cpp:553
int nGetInterventionClass(void) const
Gets the intervention class.
Definition cell.cpp:1133
void SetLocalConsSlope(double const)
Sets the local slope of the consolidated sediment only.
Definition cell.cpp:394
double dGetThisIterCliffCollapseSandTalusDeposition(void) const
Returns the depth of this-timestep sand talus deposition from cliff collapse on this cell.
Definition cell.cpp:1011
void SetDownDriftZoneNumber(int const)
Sets the down drift zone number.
Definition cell.cpp:376
static CGeomRasterGrid * m_pGrid
Definition cell.h:215
double dGetWaveHeight(void) const
Returns the wave height on this cell.
Definition cell.cpp:862
double dGetWaveAngle(void) const
Returns the wave orientation on this cell.
Definition cell.cpp:881
double dGetTotSeaDepth(void) const
Returns the total depth of seawater on this cell.
Definition cell.cpp:433
double m_dTotFineCliffCollapse
Total depth of fine sediment (consolidated and unconsolidated) removed via cliff collapse.
Definition cell.h:158
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:726
double m_dTotCoarseCliffCollapse
Total depth of coarse sediment (consolidated and unconsolidated) removed via cliff collapse.
Definition cell.h:164
CRWCellLandform m_Landform
This cell's landform data.
Definition cell.h:203
double m_dCliffCollapseFineThisIter
Depth of fine sediment (consolidated and unconsolidated) removed via cliff collapse this timestep.
Definition cell.h:149
double m_dDeepWaterWaveHeight
Wave height if this is a deep water cell.
Definition cell.h:119
double dGetLocalConsSlope(void) const
Returns the local slope of the consolidated sediment only.
Definition cell.cpp:400
double m_dActualBeachErosionThisIter
Depth of unconsolidated beach sediment actually eroded this timestep.
Definition cell.h:185
double m_dTotSuspendedSediment
Total depth of suspended sediment (m) since simulation start (used to calc average)
Definition cell.h:134
void SetInterventionClass(int const)
Sets the landform category and subcategory for an intervention.
Definition cell.cpp:1119
bool m_bInContiguousFlood
TODO 007 What is this?
Definition cell.h:41
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:929
void SetBoundingBoxEdge(int const)
Set the edge number if this cell is an edge bounding-box cell.
Definition cell.cpp:91
double dGetTotUnconsCoarse(void) const
Returns the total thickness of coarse unconsolidated sediment on this cell.
Definition cell.cpp:651
void SetFloodBySetupSurgeRunup(void)
TODO 007 What does this do? Set this cell as flood by setup surge runup.
Definition cell.cpp:145
void SetPotentialPlatformErosion(double const)
Set potential (unconstrained) shore platform erosion and increment total shore platform potential ero...
Definition cell.cpp:754
bool m_bIsInActiveZone
Switch to indicate that this cell is in the active zone.
Definition cell.h:44
void SetPossibleFloodStartCell(void)
TODO 007 What is this for? Sets a flag to show that this cell has been flagged as a possible start-po...
Definition cell.cpp:199
void AddSuspendedSediment(double const)
Adds to this cell's suspended sediment depth equivalent, it also increments the running total of susp...
Definition cell.cpp:447
bool m_bShadowBoundary
Switch to show this cell is 'under' a shadow boundaryu.
Definition cell.h:62
int nGetDownDriftZoneNumber(void) const
Gets the down drift zone number.
Definition cell.cpp:382
double dGetTotUnconsSand(void) const
Returns the total thickness of sand-sized unconsolidated sediment on this cell.
Definition cell.cpp:625
void UnSetInContiguousFlood(void)
TODO 007 What does this do? Is it just the inverse of SetInContiguousSea()?
Definition cell.cpp:127
double dGetUnconsD50(void) const
Returns the D50 of unconsolidated sediment on this cell.
Definition cell.cpp:1113
double m_dPotentialBeachErosionThisIter
Depth of unconsolidated beach sediment that could be eroded this timestep, if no supply-limitation.
Definition cell.h:179
bool bIsCellFloodCheck(void) const
Returns true if this cell is checked, false otherwise (flood switch)
Definition cell.cpp:370
double dGetTotActualPlatformErosion(void) const
Get total actual (constrained) shore platform erosion.
Definition cell.cpp:786
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:340
vector< double > m_VdAllHorizonTopElev
Number of layer-top elevations (inc. that of the basement, which is m_VdAllHorizonTopElev[0]); size 1...
Definition cell.h:210
double m_dWavePeriod
Wave period (s)
Definition cell.h:113
double m_dSeaDepth
Depth of still water (m), is zero if not inundated.
Definition cell.h:98
double dGetTotUnconsThickness(void) const
Returns the total thickness of unconsolidated sediment (all size classes) on this cell.
Definition cell.cpp:671
double dGetBasementElev(void) const
Returns this cell's basement elevation.
Definition cell.cpp:412
int m_nPolygonID
If this cell is within a polygon, this is the ID of the polygon.
Definition cell.h:80
double m_dActualPlatformErosionThisIter
Depth of sediment actually eroded from the shore platform this timestep.
Definition cell.h:143
double dGetPotentialPlatformErosion(void) const
Get potential (unconstrained) shore platform erosion.
Definition cell.cpp:761
double dGetTotSuspendedSediment(void) const
Returns the total suspended sediment depth equivalent on this cell.
Definition cell.cpp:461
double m_dDeepWaterWaveAngle
Wave orientation if this is a deep water cell.
Definition cell.h:122
double dGetActualBeachErosion(void) const
Get actual (supply-constrained) beach erosion.
Definition cell.cpp:1061
void SetSeaDepth(void)
Returns the depth of seawater on this cell if the sediment top is < SWL, or zero.
Definition cell.cpp:792
void SetShadowZoneNumber(int const)
Set the number of the shadow zone that this cell is in.
Definition cell.cpp:279
double dGetTotConsCoarseThickConsiderNotch(void) const
Returns the total thickness of coarse consolidated sediment on this cell, minus the depth-equivalent ...
Definition cell.cpp:635
void SetCellDeepWaterWaveAngle(double const)
Sets the deep water wave orientation on this cell.
Definition cell.cpp:905
bool m_bPossibleCoastStartCell
Switch to show that this cell could be the start of a coastline.
Definition cell.h:65
CGeomCell()
Constructor with initialization list.
Definition cell.cpp:29
double dGetActualPlatformErosion(void) const
Get actual (constrained) shore platform erosion.
Definition cell.cpp:780
void SetFloodBySetupSurge(void)
TODO 007 What does this do? Set this cell as flood by setup surger.
Definition cell.cpp:133
int m_nShadowZoneNumber
If this cell is within a shadow zone, this is the number of the shadow zone.
Definition cell.h:86
bool bIsinThisShadowZone(int const) const
Returns true if this cell is in the shadow zone with number given by the parameter,...
Definition cell.cpp:291
double m_dDeepWaterWavePeriod
Wave period if this is a deep water cell.
Definition cell.h:125
double m_dTotPotentialBeachErosion
Total depth of unconsolidated beach sediment eroded; if no supply-limitation.
Definition cell.h:182
double m_dSuspendedSediment
Suspended sediment as depth equivalent (m)
Definition cell.h:131
double m_dTotTalusSandDeposition
Total depth of unconsolidated sand sediment deposited as a result of cliff collapse.
Definition cell.h:170
double dGetTotConsThickness(void) const
Returns the total thickness of consolidated sediment (all size classes) on this cell.
Definition cell.cpp:661
void SetCheckFloodCell(void)
Set this cell as checked (flood switch)
Definition cell.cpp:358
void SetInContiguousSea(void)
Set this cell as a sea cell.
Definition cell.cpp:109
int m_nDownDriftZoneNumber
If this cell is within a downdrift zone, this is the number of the downdrift zone.
Definition cell.h:89
double m_dWaveHeight
Wave height (m)
Definition cell.h:104
void SetWaveAngle(double const)
Sets the wave orientation on this cell, also increments the total wave orientation.
Definition cell.cpp:874
void SetProfileID(int const)
Marks this cell as 'under' a coastline-normal profile.
Definition cell.cpp:246
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:187
void SetShadowZoneBoundary(void)
Sets a flag to show that this cell is a shadow zone boundary.
Definition cell.cpp:175
double dGetThisIterCliffCollapseErosionCoarse(void) const
Returns the depth of this-timestep coarse-sized sediment cliff collapse on this cell.
Definition cell.cpp:973
void SetBasementElev(double const)
Sets this cell's basement elevation.
Definition cell.cpp:406
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:949
void AddSandTalusDeposition(double const)
Increments the depth of this-timestep sand-sized talus from cliff collapse on this cell,...
Definition cell.cpp:997
double dGetSuspendedSediment(void) const
Returns the suspended sediment depth equivalent on this cell.
Definition cell.cpp:455
bool bIsProfile(void) const
Returns true if this cell is 'under' a coastline normal.
Definition cell.cpp:258
double m_dUnconsD50
d50 of unconsolidated sediment on top layer with unconsolidated sediment depth > 0
Definition cell.h:197
double m_dInterventionHeight
Height of intervention structure.
Definition cell.h:200
vector< CRWCellLayer > m_VLayerAboveBasement
Number of layers NOT including the basement. Layer 0 is the lowest.
Definition cell.h:207
bool m_bFloodLine
TODO 007 What is this used for? Switch to indicate that this cell is 'under' a flood line.
Definition cell.h:50
bool bIsCoastline(void) const
Returns true if the cell is 'under' a coastline.
Definition cell.cpp:228
void UnSetCheckFloodCell(void)
Set the cell as not checked (flood switch)
Definition cell.cpp:364
void SetCellDeepWaterWaveHeight(double const)
Sets the deep water wave height on this cell.
Definition cell.cpp:893
double dGetThisIterCliffCollapseErosionSand(void) const
Returns the depth of this-timestep sand-sized sediment cliff collapse on this cell.
Definition cell.cpp:967
bool bBasementElevIsMissingValue(void) const
Returns true if this cells's basement data is NODATA, is needed for irregularly-shaped DEMs.
Definition cell.cpp:418
double dGetTotCliffCollapseCoarse(void) const
Returns the running total depth of coarse-sized sediment eroded by cliff collapse on this cell.
Definition cell.cpp:991
bool m_bWaveFlood
TODO 007 What is this used for? Switch to indicate that this cell is 'under' a wave flood line.
Definition cell.h:53
double m_dCliffCollapseCoarseThisIter
Depth of coarse sediment (consolidated and unconsolidated) removed via cliff collapse this timestep.
Definition cell.h:155
CRWCellLandform * pGetLandform(void)
Returns a pointer to this cell's CRWCellLandform object.
Definition cell.cpp:388
void SetBeachProtectionFactor(double const)
Definition cell.cpp:937
void SetAsFloodLine(bool const)
Marks this cell is flood line.
Definition cell.cpp:234
double m_dTotSeaDepth
Total depth of still water (m) since beginning of simulation (used to calc average)
Definition cell.h:101
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:492
bool m_bFloodBySetupSurge
TODO 007 What is this used for?
Definition cell.h:71
double dGetThisIterTotWaterLevel(void) const
Returns the total water level at current iteration.
Definition cell.cpp:559
bool m_bCoastline
Switch to indicate that this cell is 'under' a coastline.
Definition cell.h:47
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:652
int const INT_NODATA
Definition cme.h:362
double const TOLERANCE
Definition cme.h:698
int const ELEV_ABOVE_SEDIMENT_TOP
Definition cme.h:651
int const IO_INTERVENTION_STRUCT
Definition cme.h:414
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1176
T tMax(T a, T b)
Definition cme.h:1123
int const LF_SUBCAT_INTERVENTION_NON_STRUCT
Definition cme.h:446
int const NO_DIRECTION
Definition cme.h:382
int const IO_INTERVENTION_NON_STRUCT
Definition cme.h:415
double const DBL_NODATA
Definition cme.h:707
int const LF_NONE
Definition cme.h:418
int const ELEV_IN_BASEMENT
Definition cme.h:650
int const LF_SUBCAT_INTERVENTION_STRUCT
Definition cme.h:445
int const LF_CAT_INTERVENTION
Definition cme.h:431