CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
simulation.h
Go to the documentation of this file.
1
15
16#ifndef SIMULATION_H
17#define SIMULATION_H
18/* ===============================================================================================================================
19
20 This file is part of CoastalME, the Coastal Modelling Environment.
21
22 CoastalME is free software; you can redistribute it and/or modify it under
23the terms of the GNU General Public License as published by the Free Software
24Foundation; either version 3 of the License, or (at your option) any later
25version.
26
27 This program is distributed in the hope that it will be useful, but WITHOUT
28ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
29FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
30
31 You should have received a copy of the GNU General Public License along with
32this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
33Cambridge, MA 02139, USA.
34
35===============================================================================================================================*/
36#include <ctime>
37using std::localtime;
38using std::time;
39using std::time_t;
40
41#include <fstream>
42using std::ofstream;
43
44#include <string>
45using std::string;
46
47#include <utility>
48using std::pair;
49
50#include <stack>
51using std::stack;
52
53#include <random>
54using std::default_random_engine;
55using std::normal_distribution;
56
57#include <gdal_priv.h>
58
59#include "cme.h"
60#include "i_line.h"
61#include "line.h"
62
63#include "inc/cshore.h"
64
65class CGeomRasterGrid; // Forward declarations
66class CRWCoast;
67class CGeomProfile;
69class CRWCliff;
70class CSedInputEvent;
71class CRWCellLandform;
72
74private:
77
80
83
86
89
92
95
98
101
104
107
110
113
116
119
122
125
128
131
134
137
140
143
146
149
153
156
160
164
168
171
174
177
180
183
186
189
192
195
198
201
204
207
210
213
216
219
222
225
228
231
234
237
240
243
246
249
252
255
258
261
264
267
270
273
276
279
282
285
288
291
294
297
300
303
306
309
312
315
318
321
324
328
332
335
338
341
344
347
350
353
356
359
362
365
368
371
375
379
382
385
389
392
395
398
401
404
407
410
413
416
419
422
425
428
431
434
437
440
443
446
450
454
457
460
463
466
469
472
475
479
482
485
489
492
496
499
503
506
510
513
516
519
523
527
528 // NOT USED
529 // int m_nNThisIterCliffCollapse;
530
531 // NOT USED
532 // int m_nNTotCliffCollapse;
533
536
540
544
547
550
553
556
559
562
566
569
572
575
578
581
584
588
592
595
598
600
604
608
612
616
618 unsigned long m_ulIter;
619
621 unsigned long m_ulTotTimestep;
622
625
627 unsigned long m_ulNumCells;
628
631
634
638
642
646
650
654
658
662
665
668
672
676
680
684
687
690
693
696
699
702
705
708
711
715
718
722
725
728
732
735
738
742
745
749
753
757
759 double m_dMinSWL;
760
762 double m_dMaxSWL;
763
766
769
772
775
778
780 double m_dC_0;
781
783 double m_dL_0;
784
787
790
793
796
799
802
805
807 double m_dR;
808
811
814
817
820
823
826
829
832
835
838
841
843 double m_dKLS;
844
847
849 double m_dG;
850
855
859
862
865
868
871
875
879
883
887
891
895
899
903
907
911
915
919
923
927
931
935
939
943
947
951
955
958
961
964
967
970
974
977
981
984
987
991
995
999
1003
1007
1011
1015
1019
1023
1026
1029
1032
1035
1038
1041
1044
1047
1050
1053
1057
1061
1065
1069
1073
1077
1081
1085
1089
1093
1097
1101
1105
1109
1113
1117
1118 // These grand totals are all long doubles. The aim is to minimize rounding
1119 // errors when many very small numbers are added to a single much larger
1120 // number, see e.g. http://www.ddj.com/cpp/184403224
1121
1124
1127
1130
1133
1137
1141
1145
1149
1152
1155
1158
1161
1164
1168
1172
1176
1180
1184
1188
1191
1195
1199
1203
1207
1211
1214
1218
1222
1225
1228
1231
1234
1237
1240
1243
1246
1248
1251
1254
1257
1260
1263
1266
1269
1272
1275
1278
1281
1284
1287
1290
1293
1296
1299
1302
1305
1308
1311
1314
1317
1320
1323
1326
1329
1332
1335
1338
1341
1344
1347
1350
1353
1356
1357 // GDAL description for the deep water wave stations vector file
1359
1362
1365
1368
1369 // GDAL description for the sediment input event locations vector file
1371
1374
1377
1380
1381 // GDAL description for the flood input locations point or vector file
1383
1386
1389
1392
1395
1398
1401
1404
1407
1410
1413
1416
1419
1422
1425
1427 ofstream OutStream;
1428
1431
1434
1437
1440
1443
1447
1450
1453
1457
1460
1463
1466
1470
1474
1477
1481
1485
1488
1491
1493 vector<unsigned long> m_VulProfileTimestep;
1494
1497
1499 vector<double> m_VdSliceElev;
1500
1502 vector<double> m_VdErosionPotential;
1503
1505 vector<double> m_VdDepthOverDB;
1506
1508 vector<double> m_VdSavGolFCRWCoast;
1509
1512
1515 vector<double> m_VdTideData;
1516
1519
1522
1525
1528
1531
1534
1537
1540
1543
1546
1548 vector<double> m_VdFloodLocationX;
1549
1551 vector<double> m_VdFloodLocationY;
1552
1555
1558
1561
1564
1567
1570
1573
1577
1580
1583
1586
1590
1593
1596
1599
1603
1606
1609
1612
1616
1619
1622
1625
1629
1632
1635
1638
1642
1645
1648
1651
1653 vector<CRWCoast> m_VCoast;
1654
1656 vector<CGeomLine> m_VCliffEdge;
1657
1659 vector<CRWCoast> m_VFloodWaveSetupSurge;
1660
1663
1666 vector<CGeomCoastPolygon *> m_pVCoastPolygon;
1667
1669 vector<CGeom2DIPoint> m_VEdgeCell;
1670
1672 vector<int> m_VEdgeCellEdge;
1673
1676
1678 vector<CSedInputEvent *> m_pVSedInputEvent;
1679
1681 default_random_engine m_Rand[NUMBER_OF_RNGS];
1682
1684 normal_distribution<double> m_dGetFromUnitNormalDist{0.0, 1.0};
1685
1686private:
1687 // Input and output routines
1688 int nHandleCommandLineParams(int, char const *[]);
1689 bool bReadIniFile(void);
1690 bool bReadRunDataFile(void);
1691 bool bOpenLogFile(void);
1692 bool bSetUpTSFiles(void);
1693 void WriteStartRunDetails(void);
1694 bool bWritePerTimestepResults(void);
1696 bool bWritePerTimestepResultsCSV(void);
1697 bool bWriteTSFiles(void);
1698 int nWriteEndRunDetails(void);
1699 int nReadShapeFunctionFile(void);
1700 int nReadWaveStationInputFile(int const);
1702 int nReadTideDataFile(void);
1703 int nSaveProfile(int const, CGeomProfile const *, int const,
1704 vector<double> const *, vector<double> const *,
1705 vector<double> const *, vector<double> const *,
1706 vector<double> const *, vector<double> const *,
1707 vector<double> const *, vector<CGeom2DIPoint> *const,
1708 vector<double> const *) const;
1709 bool bWriteProfileData(int const, CGeomProfile const *, int const,
1710 vector<double> const *, vector<double> const *,
1711 vector<double> const *, vector<double> const *,
1712 vector<double> const *, vector<double> const *,
1713 vector<double> const *, vector<CGeom2DIPoint> *const,
1714 vector<double> const *) const;
1715 int nSaveParProfile(int const, CGeomProfile const *, int const, int const,
1716 int const, vector<double> const *, vector<double> const *,
1717 vector<double> const *, vector<double> const *,
1718 vector<double> const *, vector<double> const *,
1719 vector<double> const *, vector<CGeom2DIPoint> *const,
1720 vector<double> const *) const;
1721 bool bWriteParProfileData(int const, int const, int const, int const,
1722 int const, vector<double> const *,
1723 vector<double> const *, vector<double> const *,
1724 vector<double> const *, vector<double> const *,
1725 vector<double> const *, vector<double> const *,
1726 vector<CGeom2DIPoint> *const,
1727 vector<double> const *) const;
1728 void WriteLookUpData(void) const;
1729
1730 // GIS input and output stuff
1731 void InitializeGDALPerformance(void);
1732 int nReadRasterBasementDEM(void);
1733 int nReadRasterGISFile(int const, int const);
1734 int nReadVectorGISFile(int const);
1735 bool bWriteRasterGISFile(int const, string const *, int const = 0,
1736 double const = 0);
1737 bool bWriteVectorGISFile(int const, string const *);
1738 void GetRasterOutputMinMax(int const, double &, double &, int const,
1739 double const);
1741 int nInterpolateWavesToPolygonCells(vector<double> const *,
1742 vector<double> const *,
1743 vector<double> const *,
1744 vector<double> const *);
1745
1746 // Initialization
1747 bool bCreateErosionPotentialLookUp(vector<double> *, vector<double> *,
1748 vector<double> *);
1749
1750 // Top-level simulation routines
1751 static int nUpdateIntervention(void);
1753 int nCalcExternalForcing(void);
1755 int nLocateSeaAndCoasts(int &);
1756 int nLocateFloodAndCoasts(void);
1759 int nDoAllPropagateWaves(void);
1762 int nDoCliffCollapse(int const, CRWCliff *, double &, double &, double &,
1763 double &, double &);
1764 int nDoCliffCollapseDeposition(int const, CRWCliff const *, double const,
1765 double const, double const, double const);
1766 int nUpdateGrid(void);
1767 // Cliff finder
1768 int nLocateCliffToe(void);
1769 void nCalcSlopeAtAllCells(void);
1770 void nLocateCliffCell(void);
1771 void nTraceSeawardCliffEdge(void);
1772 void nValidateCliffToeEdges(void);
1773 CGeomLine nValidateCliffToeDirection(CGeomLine &CliffEdge, bool bReverse);
1774 void nRemoveSmallCliffIslands(int const);
1775
1776 // Lower-level simulation routines
1777 void FindAllSeaCells(void);
1778 int FindAllInundatedCells(void);
1779 void CellByCellFillSea(int const, int const);
1780 void FloodFillLand(int const, int const);
1781 int nTraceCoastLine(unsigned int const, int const, int const, vector<bool> *,
1782 vector<CGeom2DIPoint> const *);
1783 int nTraceAllCoasts(int &);
1784 int nTraceFloodCoastLine(unsigned int const, int const, int const,
1785 vector<bool> *, vector<CGeom2DIPoint> const *);
1786 int nTraceAllFloodCoasts(void);
1787 void DoCoastCurvature(int const, int const);
1788 int nCheckAllProfiles(void);
1789 int nCreateAllProfiles(void);
1790 void LocateAndCreateProfiles(int const, int &, int &, vector<bool> *,
1791 vector<pair<int, double>> const *);
1792 int nCreateProfile(int const, int const, int const, int const, int &,
1793 bool const, CGeom2DIPoint const *);
1794 int nLocateAndCreateGridEdgeProfile(bool const, int const, int &, int &);
1795 void MarkProfilesOnGrid(int const, int &);
1797 static bool bCheckForIntersection(CGeomProfile *const, CGeomProfile *const,
1798 int &, int &, double &, double &, double &,
1799 double &);
1801 CGeomProfile *, int const, int const,
1802 double const, double const,
1803 double const, double const);
1805 CGeomProfile *, double, double, int,
1806 int, bool const);
1808 double const, double const,
1809 int const, CGeomProfile *,
1810 int const, bool const);
1811 void TruncateProfileAndAppendNew(int const, CGeomProfile *, int const,
1812 vector<CGeom2DPoint> const *,
1813 vector<vector<pair<int, int>>> const *);
1814 void CreateRasterizedProfile(int const, CGeomProfile *,
1815 vector<CGeom2DIPoint> *, vector<bool> *, bool &,
1816 bool &, bool &, bool &, bool &,
1817 bool &); // TODO 044
1818 static void CalcDeanProfile(vector<double> *, double const, double const,
1819 double const, bool const, int const,
1820 double const);
1821 static double dSubtractProfiles(vector<double> const *,
1822 vector<double> const *, vector<bool> const *);
1823 void RasterizeCliffCollapseProfile(vector<CGeom2DPoint> const *,
1824 vector<CGeom2DIPoint> *) const;
1827 int const);
1828 void ConstructParallelProfile(int const, int const, int const, int const,
1829 int const, vector<CGeom2DIPoint> *const,
1830 vector<CGeom2DIPoint> *,
1831 vector<CGeom2DPoint> *);
1832 double dCalcBeachProtectionFactor(int const, int const, double const);
1833 void FillInBeachProtectionHoles(void);
1835 void DoActualPlatformErosionOnCell(int const, int const);
1836 double dLookUpErosionPotential(double const) const;
1837 static CGeom2DPoint PtChooseEndPoint(int const, CGeom2DPoint const *,
1838 CGeom2DPoint const *, double const,
1839 double const, double const,
1840 double const);
1841 int nGetCoastNormalEndPoint(int const, int const, int const,
1842 CGeom2DPoint const *, double const,
1843 CGeom2DPoint *, CGeom2DIPoint *, bool const);
1844 int nLandformToGrid(int const, int const);
1845 int nCalcWavePropertiesOnProfile(int const, int const, CGeomProfile *,
1846 vector<double> *, vector<double> *,
1847 vector<double> *, vector<double> *,
1848 vector<bool> *);
1849 int nGetThisProfileElevationsForCShore(int const, CGeomProfile *, int const,
1850 vector<double> *, vector<double> *,
1851 vector<double> *);
1852 int nCreateCShoreInfile(int const, int const, int const, int const, int const,
1853 int const, int const, int const, int const, int const,
1854 int const, int const, int const, double const,
1855 double const, double const, double const,
1856 double const, double const, double const,
1857 double const, vector<double> const *,
1858 vector<double> const *, vector<double> const *);
1859 int nReadCShoreOutput(int const, string const *, int const, int const,
1860 vector<double> const *, vector<double> *);
1861 /* static */ void
1862 InterpolateCShoreOutput(vector<double> const *, int const, int const,
1863 vector<double> *, vector<double> *, vector<double> *,
1864 vector<double> *, vector<double> *, vector<double> *,
1865 vector<double> *, vector<double> *, vector<double> *);
1866 static double dCalcWaveAngleToCoastNormal(double const, double const,
1867 int const);
1868 void CalcCoastTangents(int const);
1869 void InterpolateWavePropertiesBetweenProfiles(int const, int const);
1870 void InterpolateWaveHeightToCoastPoints(int const);
1871 // void InterpolateWavePropertiesToCells(int const, int const, int const);
1873 int const);
1874 static double dCalcCurvature(int const, CGeom2DPoint const *,
1875 CGeom2DPoint const *, CGeom2DPoint const *);
1876 void CalcD50AndFillWaveCalcHoles(void);
1877 int nDoAllShadowZones(void);
1878 static bool bOnOrOffShoreAndUpOrDownCoast(double const, double const,
1879 int const, bool &);
1880 static CGeom2DIPoint PtiFollowWaveAngle(CGeom2DIPoint const *, double const,
1881 double &);
1882 // int nFindAllShadowZones(void);
1883 int nFloodFillShadowZone(int const, CGeom2DIPoint const *,
1884 CGeom2DIPoint const *, CGeom2DIPoint const *);
1885 void DoShadowZoneAndDownDriftZone(int const, int const, int const, int const);
1886 void ProcessDownDriftCell(int const, int const, int const, double const,
1887 int const);
1888 void ProcessShadowZoneCell(int const, int const, int const,
1889 CGeom2DIPoint const *, int const, int const,
1890 int const);
1891 int nCreateAllPolygons(void);
1892 void RasterizePolygonJoiningLine(int const, CGeom2DIPoint const *,
1893 CGeom2DIPoint const *, int const);
1894 static bool bIsWithinPolygon(CGeom2DPoint const *,
1895 vector<CGeom2DPoint> const *);
1896 static CGeom2DPoint PtFindPointInPolygon(vector<CGeom2DPoint> const *,
1897 int const);
1898 void MarkPolygonCells(void);
1900 void DoAllPotentialBeachErosion(void);
1902 int nDoParallelProfileUnconsErosion(CGeomCoastPolygon *, int const, int const,
1903 int const, int const, int const,
1904 int const, vector<CGeom2DIPoint> const *,
1905 vector<double> const *, double &,
1906 double &, double &);
1907 void ErodeCellBeachSedimentSupplyLimited(int const, int const, int const,
1908 int const, double const, double &);
1909 int nDoUnconsErosionOnPolygon(int const, CGeomCoastPolygon *, int const,
1910 double const, double &);
1911 int nDoUnconsDepositionOnPolygon(int const, CGeomCoastPolygon *, int const,
1912 double, double &);
1913 void CalcDepthOfClosure(void);
1916 int nDoSedimentInputEvent(int const);
1917 void AllPolygonsUpdateStoredUncons(int const);
1918 bool bIsInterventionCell(int const, int const) const;
1919 bool bSurroundedByDriftCells(int const, int const);
1920 bool bElevAboveDeanElev(int const, int const, double const,
1921 CRWCellLandform const *);
1922 // void CreatePolygonIndexIDSeq(int const);
1923
1924 // GIS utility routines
1925 int nMarkBoundingBoxEdgeCells(void);
1926 bool bCheckRasterGISOutputFormat(void);
1927 bool bCheckVectorGISOutputFormat(void);
1928 bool bSaveAllRasterGISFiles(void);
1929 bool bSaveAllVectorGISFiles(void);
1930 bool bIsWithinValidGrid(int const, int const) const;
1931 bool bIsWithinValidGrid(CGeom2DIPoint const *) const;
1932 double dGridCentroidXToExtCRSX(int const) const;
1933 double dGridCentroidYToExtCRSY(int const) const;
1934 double dGridXToExtCRSX(double const) const;
1935 double dGridYToExtCRSY(double const) const;
1936 // double dExtCRSXToGridCentroidX(double const) const;
1937 // double dExtCRSYToGridCentroidY(double const) const;
1940 double dExtCRSXToGridX(double const) const;
1941 double dExtCRSYToGridY(double const) const;
1942 static double dGetDistanceBetween(CGeom2DPoint const *, CGeom2DPoint const *);
1943 static double dGetDistanceBetween(CGeom2DIPoint const *,
1944 CGeom2DIPoint const *);
1945 static double dTriangleAreax2(CGeom2DPoint const *, CGeom2DPoint const *,
1946 CGeom2DPoint const *);
1947 void KeepWithinValidGrid(int &, int &) const;
1948 void KeepWithinValidGrid(int, int, int &, int &) const;
1949 void KeepWithinValidGrid(CGeom2DIPoint const *, CGeom2DIPoint *) const;
1950 static double dKeepWithin360(double const);
1951 // vector<CGeom2DPoint> VGetPerpendicular(CGeom2DPoint const*, CGeom2DPoint
1952 // const*, double const, int const);
1954 CGeom2DPoint const *, double const,
1955 int const);
1957 CGeom2DIPoint const *, double const,
1958 int const);
1959 static CGeom2DIPoint PtiGetPerpendicular(int const, int const, int const,
1960 int const, double const, int const);
1961 static CGeom2DPoint PtAverage(CGeom2DPoint const *, CGeom2DPoint const *);
1962 static CGeom2DPoint PtAverage(vector<CGeom2DPoint> *);
1963 // static CGeom2DIPoint PtiAverage(CGeom2DIPoint const*, CGeom2DIPoint
1964 // const*); static CGeom2DIPoint PtiAverage(vector<CGeom2DIPoint>*);
1966 CGeom2DIPoint const *, double const);
1967 static CGeom2DIPoint PtiPolygonCentroid(vector<CGeom2DIPoint> *);
1968 static double dAngleSubtended(CGeom2DIPoint const *, CGeom2DIPoint const *,
1969 CGeom2DIPoint const *);
1970 static int nGetOppositeDirection(int const);
1971 // static void GetSlopeAndInterceptFromPoints(CGeom2DIPoint const*,
1972 // CGeom2DIPoint const*, double&, double&);
1973 CGeom2DIPoint PtiFindClosestCoastPoint(int const, int const);
1974 int nConvertMetresToNumCells(double const) const;
1975
1976 // Utility routines
1977 static void AnnounceStart(void);
1978 void AnnounceLicence(void);
1979 void AnnounceReadBasementDEM(void) const;
1980 static void AnnounceAddLayers(void);
1981 static void AnnounceReadRasterFiles(void);
1982 static void AnnounceReadVectorFiles(void);
1983 void AnnounceReadLGIS(void) const;
1984 void AnnounceReadICGIS(void) const;
1985 void AnnounceReadIHGIS(void) const;
1986 static void AnnounceInitializing(void);
1987 void AnnounceReadInitialSuspSedGIS(void) const;
1988 void AnnounceReadInitialFineUnconsSedGIS(int const) const;
1989 void AnnounceReadInitialSandUnconsSedGIS(int const) const;
1990 void AnnounceReadInitialCoarseUnconsSedGIS(int const) const;
1991 void AnnounceReadInitialFineConsSedGIS(int const) const;
1992 void AnnounceReadInitialSandConsSedGIS(int const) const;
1993 void AnnounceReadInitialCoarseConsSedGIS(int const) const;
1994 void AnnounceReadDeepWaterWaveValuesGIS(void) const;
1996 void AnnounceReadFloodLocationGIS(void) const;
1997 void AnnounceReadTideData(void) const;
1998 static void AnnounceReadSCAPEShapeFunctionFile(void);
1999 static void AnnounceAllocateMemory(void);
2000 static void AnnounceIsRunning(void);
2001 static void AnnounceSimEnd(void);
2002 void StartClock(void);
2003 bool bFindExeDir(char const *);
2004 bool bTimeToQuit(void);
2005 static int nDoTimeUnits(string const *);
2006 int nDoSimulationTimeMultiplier(string const *);
2007 static double dGetTimeMultiplier(string const *);
2008 static bool bParseDate(string const *, int &, int &, int &);
2009 static bool bParseTime(string const *, int &, int &, int &);
2010 void DoEndOfTimestepTotals(void);
2011 static string strGetBuild(void);
2012 static string strGetComputerName(void);
2013 void DoCPUClockReset(void);
2014 void CalcTime(double const);
2015 static string strDispTime(double const, bool const, bool const);
2016 static string strDispSimTime(double const);
2017 void AnnounceProgress(void);
2018 static string strGetErrorText(int const);
2019 string strListRasterFiles(void) const;
2020 string strListVectorFiles(void) const;
2021 string strListTSFiles(void) const;
2022 void CalcProcessStats(void);
2023 void CalcSavitzkyGolayCoeffs(void);
2024 CGeomLine LSmoothCoastSavitzkyGolay(CGeomLine *, int const, int const) const;
2026 vector<double> dVSmoothProfileSlope(vector<double> *) const;
2027 // vector<double> dVCalCGeomProfileSlope(vector<CGeom2DPoint>*,
2028 // vector<double>*); // TODO 007 Why was this removed? vector<double>
2029 // dVSmoothProfileSavitzkyGolay(vector<double>*, vector<double>*); //
2030 // TODO 007 was this removed? vector<double>
2031 // dVSmoothProfileRunningMean(vector<double>*); //
2032 // TODO 007 was this removed?
2033 static void CalcSavitzkyGolay(double[], int const, int const, int const,
2034 int const, int const);
2035 static string pstrChangeToBackslash(string const *);
2036 static string pstrChangeToForwardSlash(string const *);
2037 static string strTrim(string const *);
2038 static string strTrimLeft(string const *);
2039 static string strTrimRight(string const *);
2040 static string strToLower(string const *);
2041 // static string strToUpper(string const*);
2042 static string strRemoveSubstr(string *, string const *);
2043 static vector<string> *VstrSplit(string const *, char const,
2044 vector<string> *);
2045 static vector<string> VstrSplit(string const *, char const);
2046 // static double dCrossProduct(double const, double const, double const,
2047 // double const, double const, double const); static double
2048 // dGetMean(vector<double> const*); static double dGetStdDev(vector<double>
2049 // const*);
2050 static void AppendEnsureNoGap(vector<CGeom2DIPoint> *, CGeom2DIPoint const *);
2051 // static bool bIsNumeric(string const*);
2052 unsigned long ulConvertToTimestep(string const *) const;
2053 void WritePolygonInfoTable(int const);
2056 void WritePolygonShorePlatformErosion(int const);
2057 void WritePolygonCliffCollapseErosion(int const);
2058 void WritePolygonSedimentBeforeMovement(int const);
2059 void WritePolygonPotentialErosion(int const);
2060 // void WritePolygonUnconsErosion(int const);
2061 void WritePolygonUnsortedSequence(int const, vector<vector<int>> &);
2062 void WritePolygonSortedSequence(int const, vector<vector<int>> &);
2063 void WritePolygonEstimatedMovement(int const, vector<vector<int>> &);
2064 void WritePolygonActualMovement(int const, vector<vector<int>> const &);
2065 void DoEndOfRunDeletes(void);
2066
2067protected:
2068public:
2069 ofstream LogStream;
2070
2071 CSimulation(void);
2072 ~CSimulation(void);
2073
2075 int nGetCoastPolygonSize(void) const;
2076
2078 CGeomCoastPolygon *pGetPolygon(int const) const;
2079
2082
2084 double dGetMissingValue(void) const;
2085
2087 double dGetThisIterSWL(void) const;
2088
2090 double dGetThisIterTotWaterLevel(void) const;
2091
2092 // //! Returns the vertical tolerance for beach cells to be included in
2093 // smoothing double dGetMaxBeachElevAboveSWL(void) const;
2094
2096 // double dGetCellSide(void) const;
2097
2099 int nGetGridXMax(void) const;
2100
2102 int nGetGridYMax(void) const;
2103
2105 double dGetD50Fine(void) const;
2106
2108 double dGetD50Sand(void) const;
2109
2111 double dGetD50Coarse(void) const;
2112
2114 int nDoSimulation(int, char const *[]);
2115
2117 void DoSimulationEnd(int const);
2118};
2119#endif // SIMULATION_H
Geometry class used to represent 2D point objects with integer coordinates.
Definition 2di_point.h:29
Geometry class used to represent 2D point objects with floating-point coordinates.
Definition 2d_point.h:27
Geometry class used for coast polygon objects.
Geometry class used to represent 2D vector line objects.
Definition line.h:31
Geometry class used to represent coast profile objects.
Definition profile.h:35
Geometry cass used to represent the raster grid of cell objects.
Definition raster_grid.h:35
Real-world class used to represent the landform of a cell.
Real-world class used to represent the 'cliff' category of coastal landform object.
Definition cliff.h:33
Real-world class used to represent coastline objects.
Definition coast.h:40
Class used to represent a sediment input event.
double m_dThisIterPotentialBeachErosion
Definition simulation.h:890
double m_dCliffDepositionPlanviewWidth
Planview width of cliff collapse talus (m)
Definition simulation.h:983
void CalcDepthOfClosure(void)
Calculate the depth of closure.
Definition utils.cpp:2612
bool m_bCliffCollapseSave
Save cliff collapse raster GIS files?
Definition simulation.h:221
int m_nLogFileDetail
Definition simulation.h:591
bool m_bAvgSeaDepthSave
Save average sea depth raster GIS files?
Definition simulation.h:106
void WritePolygonSedimentInputEventTable(int const)
Writes to the log file a table showing per-polygon sediment input event totals.
string m_strGDALISSDriverCode
GDAL code for the initial suspended sediment raster file.
vector< string > m_VstrInitialSandConsSedimentFile
The name of the initial sand-sized consolidated sediment GIS file.
double m_dAllCellsDeepWaterWaveHeight
Deep water wave height (m) for all sea cells.
Definition simulation.h:792
bool m_bDeepWaterWaveAngleSave
Save deep water wave angle raster GIS files?
Definition simulation.h:248
bool bWriteRasterGISFile(int const, string const *, int const =0, double const =0)
Writes GIS raster files using GDAL, using data from the RasterGrid array.
static void AnnounceInitializing(void)
Tells the user that we are now initializing.
Definition utils.cpp:644
int m_nGISMaxSaveDigits
Definition simulation.h:509
bool m_bTopSurfSave
Save fop surface (sediment and sea) raster DEMs?
Definition simulation.h:91
int m_nYMinBoundingBox
The minimum y value of the bounding box.
Definition simulation.h:558
static void AnnounceReadSCAPEShapeFunctionFile(void)
Now reading the SCAPE shape function file.
Definition utils.cpp:636
string m_strGDALISSProjection
GDAL projection string for the initial suspended sediment raster file.
void CalcSavitzkyGolayCoeffs(void)
Calculates the Savitzky-Golay smoothing coefficients for a given size of smoothing window....
string m_strInitialSuspSedimentFile
Name of initial suspended sediment file.
void FindAllSeaCells(void)
Finds and flags all sea areas which have at least one cell at a grid edge (i.e. does not flag 'inland...
vector< double > m_VdTSDeepWaterWaveStationPeriod
Time series of wave period at deep water wave station.
double dLookUpErosionPotential(double const) const
The erosion potential lookup: it returns a value for erosion potential given a value of Depth Over DB...
static void CalcSavitzkyGolay(double[], int const, int const, int const, int const, int const)
CalcSavitzkyGolay uses LULinearSolve and LUDecomp. It returns dFilterCoeffsArray[nWindowSize],...
string m_strOGRVectorOutputExtension
GDAL-OGR vector output drive file extension.
CGeomLine LSmoothCoastRunningMean(CGeomLine *) const
Does running-mean smoothing of a CGeomLine coastline vector (is in external CRS coordinates)
bool bCheckRasterGISOutputFormat(void)
Checks whether the selected raster GDAL driver supports file creation, 32-bit doubles,...
void InterpolateCShoreOutput(vector< double > const *, int const, int const, vector< double > *, vector< double > *, vector< double > *, vector< double > *, vector< double > *, vector< double > *, vector< double > *, vector< double > *, vector< double > *)
static void AnnounceIsRunning(void)
Tell the user that the simulation is now running.
Definition utils.cpp:653
void DoCPUClockReset(void)
Resets the CPU clock timer to prevent it 'rolling over', as can happen during long runs....
Definition utils.cpp:1384
bool m_bSedimentTopSurfSave
Save sediment top surface raster DEMs?
Definition simulation.h:88
bool m_bFineUnconsSedSave
Save fine unconsolidated sediment raster GIS files?
Definition simulation.h:194
string m_strSedimentInputEventFile
The name of the sediment input events time series file.
int nLocateSeaAndCoasts(int &)
First find all connected sea areas, then locate the vector coastline(s), then put these onto the rast...
bool m_bHaveConsolidatedSediment
Definition simulation.h:453
double m_dNotchDepthAtCollapse
Definition simulation.h:973
void GetRasterOutputMinMax(int const, double &, double &, int const, double const)
Finds the max and min values in order to scale raster output if we cannot write doubles.
bool m_bFloodSWLSetupSurgeLine
Are we saving the flood still water level setup surge line? TODO 007.
Definition simulation.h:442
time_t m_tSysEndTime
System finish-simulation time.
string m_strCMEIni
Folder for the CME .ini file.
double m_dTotalCoarseUnconsInPolygons
bool m_bSedimentInputAtPoint
Do we have sediment inputat a point?
Definition simulation.h:397
double m_dMinSWL
Minimum still water level.
Definition simulation.h:759
double m_dG
Gravitational acceleration (m**2/sec)
Definition simulation.h:849
vector< string > m_VstrInitialCoarseUnconsSedimentFile
The name of the initial coarse-sized unconsolidated sediment GIS file.
void AnnounceReadDeepWaterWaveValuesGIS(void) const
Tells the user that we are now reading the deep water wave values GIS file.
Definition utils.cpp:488
double m_dThisIterSWL
Definition simulation.h:748
string m_strGDALICDataType
GDAL data type of the initial intervention class raster file.
int m_nBeachErosionDepositionEquation
Definition simulation.h:543
ofstream CliffCollapseNetChangeTSStream
bool m_bCoastSave
Save.
Definition simulation.h:266
bool m_bBeachDepositionTSSave
Save the beach (unconsolidated sediment) deposition time series file?
Definition simulation.h:317
bool bWritePerTimestepResults(void)
Write the results for this timestep to the .out file.
static string strRemoveSubstr(string *, string const *)
Returns a string with a substring removed, and with whitespace trimmed.
Definition utils.cpp:2408
CGeomRasterGrid * m_pRasterGrid
Pointer to the raster grid object.
vector< string > m_VstrGDALICCDataType
GDAL data type for the initial consolidated coarse sediment GIS data.
int nCalcWavePropertiesOnProfile(int const, int const, CGeomProfile *, vector< double > *, vector< double > *, vector< double > *, vector< double > *, vector< bool > *)
Calculates wave properties along a coastline-normal profile using either the COVE linear wave theory ...
static bool bParseTime(string const *, int &, int &, int &)
Parses a time string into hours, minutes, and seconds, and checks each of them.
Definition utils.cpp:2717
double dGetThisIterTotWaterLevel(void) const
Returns this timestep's total water level.
void AnnounceReadInitialSandConsSedGIS(int const) const
Tells the user that we are now reading the initial sand consolidated sediment depth GIS file.
Definition utils.cpp:598
int m_nXGridSize
The size of the grid in the x direction.
Definition simulation.h:462
string strListRasterFiles(void) const
Return a space-separated string containing the names of the raster GIS output files.
Definition utils.cpp:661
vector< double > m_VdDeepWaterWaveStationY
Y coordinate (grid CRS) for deep water wave station.
int nAssignLandformsForAllCoasts(void)
Each timestep, classify coastal landforms and assign a coastal landform object to every point on ever...
void RasterizeCliffCollapseProfile(vector< CGeom2DPoint > const *, vector< CGeom2DIPoint > *) const
Given the start and end points of a cliff-collapse normal profile, returns an output vector of cells ...
int nFloodFillShadowZone(int const, CGeom2DIPoint const *, CGeom2DIPoint const *, CGeom2DIPoint const *)
Cell-by-cell fills a shadow zone from the centroid.
void AnnounceReadInitialSandUnconsSedGIS(int const) const
Tells the user that we are now reading the initial sand unconsolidated sediment depth GIS file.
Definition utils.cpp:559
double m_dL_0
Deep water wave length (m)
Definition simulation.h:783
double m_dWaveDataWrapHours
Number of hours after which deep water wave data wraps.
static int nGetOppositeDirection(int const)
Returns the opposite direction.
string strListVectorFiles(void) const
Return a space-separated string containing the names of the vector GIS output files.
Definition utils.cpp:915
int nDoCliffCollapseDeposition(int const, CRWCliff const *, double const, double const, double const, double const)
Redistributes the sand-sized and coarse-sized sediment from a cliff collapse onto the foreshore,...
CGeom2DIPoint PtiExtCRSToGridRound(CGeom2DPoint const *) const
Transforms a pointer to a CGeom2DPoint in the external CRS to the equivalent CGeom2DIPoint in the ras...
vector< string > m_VstrGDALICFDataType
GDAL data type for the initial consolidated fine sediment GIS data.
vector< int > m_VCellFloodLocation
The location to compute the total water level for flooding.
vector< CSedInputEvent * > m_pVSedInputEvent
Sediment input events.
double m_dMaxUserInputWavePeriod
Used to constrain depth of closure.
Definition simulation.h:804
bool m_bFloodSetupSurgeRunupTSSave
Definition simulation.h:331
bool bSetUpTSFiles(void)
The bSetUpTSFiles member function sets up the time series files.
Definition utils.cpp:1105
ofstream LogStream
int nWriteEndRunDetails(void)
Writes end-of-run information to Out, Log and time-series files.
void AnnounceReadInitialFineUnconsSedGIS(int const) const
Tells the user that we are now reading the initial fine unconsolidated sediment depth GIS file.
Definition utils.cpp:546
vector< string > m_VstrGDALICCDriverCode
GDAL driver code for the initial consolidated coarse sediment GIS data.
double m_dThisIterBeachErosionCoarse
Definition simulation.h:902
int m_nGISMissingValue
The value for integer missing values, as read from GIS input files.
Definition simulation.h:546
char ** m_papszGDALVectorOptions
Options for GDAL when handling vector files.
Definition simulation.h:459
vector< CRWCoast > m_VFloodWaveSetupSurgeRunup
TODO 007 Info needed.
double m_dStartIterUnconsCoarseAllCells
int nReadRasterGISFile(int const, int const)
Reads all other raster GIS datafiles into the RasterGrid array.
vector< CRWCoast > m_VCoast
The coastline objects.
double m_dCoastNormalLength
Length of the coastline-normal profiles, in m.
Definition simulation.h:867
void WritePolygonCliffCollapseErosion(int const)
Writes to the log file a table showing per-polygon per-polygon cliff collapse.
int nLocateFloodAndCoasts(void)
First find all connected sea areas, then locate the vector coastline(s), then put these onto the rast...
static string pstrChangeToForwardSlash(string const *)
Swaps all backslashes in the input string to forward slashes, leaving the original unchanged.
Definition utils.cpp:2318
vector< string > m_VstrGDALIUFDataType
GDAL data type for the initial unconsolidated fine sediment GIS data.
bool m_bSaveGISThisIter
Save GIS files this iteration?
Definition simulation.h:334
long double m_ldGTotCliffCollapseCoarseErodedDuringDeposition
int nTraceCoastLine(unsigned int const, int const, int const, vector< bool > *, vector< CGeom2DIPoint > const *)
Traces a coastline (which is defined to be just above still water level) on the grid using the 'wall ...
double m_dGISMissingValue
The value for floating-point missing values, as read from GIS input files.
double m_dUnconsCoarseNotDepositedLastIter
string m_strOGRSedInputDataType
GDAL data type for the sediment input event locations vector file.
void DoSimulationEnd(int const)
Carries out end-of-simulation tidying (error messages etc.)
Definition utils.cpp:2190
double m_dCPUClock
Total elapsed CPU time.
Definition simulation.h:727
bool bSaveAllVectorGISFiles(void)
The bSaveAllvectorGISFiles member function saves the vector GIS files TODO 081 Choose more files to o...
bool m_bSingleDeepWaterWaveValues
Definition simulation.h:388
string m_strRunName
The name of this simulation.
int m_nThisSave
Used in calculations of GIS save intervals.
Definition simulation.h:518
static string strGetComputerName(void)
Returns a string, hopefully giving the name of the computer on which the simulation is running.
Definition utils.cpp:1359
long m_lGDALMaxCanWrite
Definition simulation.h:611
static string strDispSimTime(double const)
strDispSimTime returns a string formatted as year Julian_day hour, given a parameter in hours
Definition utils.cpp:1518
bool m_bAvgWaveAngleAndHeightSave
Save average wave angle and average wave height raster GIS files?
Definition simulation.h:124
int nTraceAllFloodCoasts(void)
Locates all the potential coastline start points on the edges of the raster grid, then traces vector ...
void FloodFillLand(int const, int const)
Use the sealevel, wave set-up and run-up to evaluate flood hydraulically connected TODO 007 Not clear...
void MarkProfilesOnGrid(int const, int &)
For this coastline, marks all coastline-normal profiles (apart from the two 'special' ones at the sta...
double m_dSouthEastXExtCRS
Definition simulation.h:679
string m_strSCAPEShapeFunctionFile
Name of SCAPE shape function file.
int m_nMissingValue
Used by CoastalME for integer missing values.
Definition simulation.h:549
bool m_bAvgWaveAngleSave
Save average wave angle raster GIS files?
Definition simulation.h:118
long double m_ldGTotActualCoarseBeachErosion
int nCalcExternalForcing(void)
Calculate external forcings: change in still water level, tide level and deep water waves height,...
int nReadWaveStationInputFile(int const)
Reads the deep water wave station input data. Each point in m_strDeepWaterWavesInputFile is a triad o...
bool m_bCliffEdgeSave
Save cliff edge vector GIS files?
Definition simulation.h:269
double m_dFineErodibilityNormalized
Relative erodibility of fine unconsolidated beach sediment, normalized.
Definition simulation.h:834
void WriteLookUpData(void) const
Output the erosion potential look-up values, for checking purposes.
bool bWriteVectorGISFile(int const, string const *)
Writes vector GIS files using OGR.
double m_dThisIterCliffCollapseFineErodedDuringDeposition
Definition simulation.h:934
void WritePolygonSedimentBeforeMovement(int const)
Writes to the log file a table showing per-polygon totals of stored unconsolidated beach sediment pri...
void nCalcSlopeAtAllCells(void)
bool m_bInvalidNormalsSave
Save invalid coastline-normal vector GIS files?
Definition simulation.h:275
bool m_bShadowBoundarySave
Save wave shadow boundary vector GIS files?
Definition simulation.h:290
double m_dThisIterDiffWaveSetupSurgeWaterLevel
TODO 007 Info needed.
Definition simulation.h:771
static CGeom2DPoint PtChooseEndPoint(int const, CGeom2DPoint const *, CGeom2DPoint const *, double const, double const, double const, double const)
Choose which end point to use for the coastline-normal profile.
int nDoSimulationTimeMultiplier(string const *)
Given a string containing time units, this sets up the appropriate multiplier and display units for t...
Definition utils.cpp:313
int nReadSedimentInputEventFile(void)
Reads the sediment input event file.
vector< int > m_VnSedimentInputLocationID
double m_dThisIterActualPlatformErosionCoarseCons
Definition simulation.h:886
vector< CGeomCoastPolygon * > m_pVCoastPolygon
bool m_bActualBeachErosionSave
Definition simulation.h:159
int nDoAllShorePlatFormErosion(void)
Does platform erosion on all coastlines by first calculating platform erosion on coastline-normal pro...
int m_nYGridSize
The size of the grid in the y direction.
Definition simulation.h:465
vector< double > m_VdErosionPotential
For erosion potential lookup.
int nLocateCliffToe(void)
double m_dThisIterTopElevMin
This-iteration lowest elevation of DEM.
void InitializeGDALPerformance(void)
Initialize GDAL with performance optimizations.
vector< double > m_VdTideData
vector< string > m_VstrGDALIUFProjection
GDAL projection for the initial unconsolidated fine sediment GIS data.
bool m_bStillWaterLevelTSSave
Save the still water level time series file?
Definition simulation.h:299
bool m_bRunUpSave
Are we saving runup? TODO 007.
Definition simulation.h:421
void ConstructParallelProfile(int const, int const, int const, int const, int const, vector< CGeom2DIPoint > *const, vector< CGeom2DIPoint > *, vector< CGeom2DPoint > *)
Constructs a parallel coastline-normal profile.
normal_distribution< double > m_dGetFromUnitNormalDist
c++11 unit normal distribution (mean = 0, stdev = 1)
GDALDataType m_GDALWriteIntDataType
Definition simulation.h:603
long double m_ldGTotCliffTalusFineToSuspension
void ErodeCellBeachSedimentSupplyLimited(int const, int const, int const, int const, double const, double &)
Erodes the unconsolidated beach sediment on a single cell, for a single size class,...
bool m_bCliffCollapseDepositionSave
Save cliff collapse deposition raster GIS files?
Definition simulation.h:227
int nSaveParProfile(int const, CGeomProfile const *, int const, int const, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Save a coastline-normal parallel profile.
string m_strSedimentInputEventShapefile
The name of the sediment input events shape file.
bool m_bTotalActualPlatformErosionSave
Definition simulation.h:152
static string strTrimLeft(string const *)
Trims whitespace from the left side of a string, does not change the original string.
Definition utils.cpp:2328
bool m_bPolygonUnconsSedUpOrDownDriftSave
Save polygon unconsolidated sediment up- or down-drift raster GIS files?
Definition simulation.h:257
double m_dCoarseErodibility
The relative erodibility (0- 1) of coarse unconsolidated beach sediment.
Definition simulation.h:831
double m_dGeoTransform[6]
Definition simulation.h:731
double m_dCliffTalusMinDepositionLength
Planview length of cliff deposition talus (m)
Definition simulation.h:986
static CGeom2DIPoint PtiGetPerpendicular(CGeom2DIPoint const *, CGeom2DIPoint const *, double const, int const)
Returns a CGeom2DIPoint (grid CRS) which is the 'other' point of a two-point vector passing through P...
void WritePolygonSortedSequence(int const, vector< vector< int > > &)
Writes to the log file a table showing the sorted sequence of polygon processing, and any circulariti...
string m_strVectorGISOutFormat
Base name for CME vector GIS output files.
void ProcessShadowZoneCell(int const, int const, int const, CGeom2DIPoint const *, int const, int const, int const)
Process a single cell which is in the shadow zone, changing its wave height and orientation.
vector< string > m_VstrGDALICFDriverCode
GDAL driver code for the initial consolidated fine sediment GIS data.
vector< string > m_VstrInitialFineConsSedimentFile
The name of the initial fine-sized consolidated sediment GIS file.
double m_dMissingValue
Used by CoastalME for floating-point missing values.
int m_nUnconsSedimentHandlingAtGridEdges
Definition simulation.h:539
static double dGetDistanceBetween(CGeom2DPoint const *, CGeom2DPoint const *)
Returns the distance (in external CRS) between two points.
double m_dSandErodibility
The relative erodibility (0- 1) of sand unconsolidated beach sediment.
Definition simulation.h:828
bool m_bBasementElevSave
Save basement raster DEMs?
Definition simulation.h:85
void CreateRasterizedProfile(int const, CGeomProfile *, vector< CGeom2DIPoint > *, vector< bool > *, bool &, bool &, bool &, bool &, bool &, bool &)
Given a pointer to a coastline-normal profile, returns an output vector of cells which are 'under' ev...
double m_dInvCellDiagonal
Inverse of m_dCellDiagonal.
Definition simulation.h:701
int m_nSimStartHour
Start time of the simulation (hours)
Definition simulation.h:574
int nDoAllShadowZones(void)
Finds wave shadow zones and modifies waves in and near them. Note that where up-coast and down-coast ...
static CGeom2DPoint PtAverage(CGeom2DPoint const *, CGeom2DPoint const *)
Returns a point (external CRS) which is the average of (i.e. is midway between) two other external CR...
double m_dCoarseErodibilityNormalized
Relative erodibility of coarse unconsolidated beach sediment, normalized.
Definition simulation.h:840
bool m_bCoarseUnconsSedSave
Save coarse unconsolidated sediment raster GIS files?
Definition simulation.h:200
string m_strGDALLDriverCode
GDAL code for the for the initial landform class raster file.
bool m_bSuspSedTSSave
Save the suspended sediment time series file?
Definition simulation.h:323
static double dKeepWithin360(double const)
Constrains the supplied angle to be within 0 and 360 degrees.
string m_strDeepWaterWaveStationsShapefile
The name of the deep water wave stations shape file.
vector< double > m_VdDepthOverDB
For erosion potential lookup.
void CalcCoastTangents(int const)
Calculates tangents to a coastline: the tangent is assumed to be the orientation of energy/sediment f...
bool m_bCliffCollapseNetTSSave
Save the cliff collapse net change time series file?
Definition simulation.h:311
int nLocateAndCreateGridEdgeProfile(bool const, int const, int &, int &)
Creates a 'special' profile at each end of a coastline, at the edge of the raster grid....
double m_dStartIterSuspFineInPolygons
bool m_bPotentialPlatformErosionMaskSave
Save potential platform erosion mask raster GIS files?
Definition simulation.h:236
unsigned long m_ulThisIterNumCoastCells
The number of grid cells which are marked as coast, for this iteration.
Definition simulation.h:633
void FillInBeachProtectionHoles(void)
Fills in 'holes' in the beach protection i.e. orphan cells which get omitted because of rounding prob...
static void AnnounceSimEnd(void)
Announce the end of the simulation.
Definition utils.cpp:1434
vector< string > m_VstrGDALICSDriverCode
GDAL driver code for the initial consolidated sand sediment GIS data.
unsigned long m_ulNumCells
The number of cells in the grid.
Definition simulation.h:627
double m_dTotPotentialPlatformErosionBetweenProfiles
Total potential platform erosion between profiles.
Definition simulation.h:960
int nGetGridYMax(void) const
Returns the size of the grid in the Y direction.
void AnnounceReadICGIS(void) const
Tells the user that we are now reading the Intervention class GIS file.
Definition utils.cpp:458
void KeepWithinValidGrid(int &, int &) const
Constrains the supplied point (in the grid CRS) to be a valid cell within the raster grid.
int nCheckForSedimentInputEvent(void)
Check to see if we have any sediment input events this timestep, if so then do the event(s)
double m_dWaveDepthRatioForWaveCalcs
Start depth for wave calculations.
Definition simulation.h:786
bool m_bWaveHeightSave
Save wave height raster GIS files?
Definition simulation.h:109
bool m_bFloodLocation
Are we saving the flood location? TODO 007.
Definition simulation.h:436
string m_strGDALISSDataType
GDAL data type for the initial suspended sediment raster file.
void WriteStartRunDetails(void)
Writes beginning-of-run information to Out and Log files.
double m_dThisIterCliffCollapseErosionCoarseUncons
vector< string > m_VstrGDALIUCProjection
GDAL projection for the initial unconsolidated coarse sediment GIS data.
bool m_bGDALCanCreate
Is the selected GDAL output file format capable of writing files?
Definition simulation.h:370
bool m_bLandformSave
Save coast landform raster GIS files?
Definition simulation.h:176
ofstream CliffCollapseDepositionTSStream
Cliff collapse deposition time series file output stream.
string m_strGDALLDataType
GDAL data type for the initial landform class raster file.
vector< CRWCoast > m_VFloodWaveSetupSurge
TODO 007 Info needed.
static string strTrim(string const *)
Trims whitespace from both sides of a string, does not change the original string.
Definition utils.cpp:2363
string m_strRasterGISOutFormat
Base name for CME raster GIS output files.
string m_strGDALIWDriverCode
GDAL code for the initial water depth raster file.
long double m_ldGTotCoarseBeachDeposition
double m_dDepositionCoarseDiff
Definition simulation.h:950
bool m_bTotalBeachDepositionSave
Save total beach (unconsolidated sediment) deposition raster GIS files?
Definition simulation.h:173
int nCreateCShoreInfile(int const, int const, int const, int const, int const, int const, int const, int const, int const, int const, int const, int const, int const, double const, double const, double const, double const, double const, double const, double const, double const, vector< double > const *, vector< double > const *, vector< double > const *)
double m_dBeachSedimentPorosity
The porosity of unconsolidated beach sediment (0 - 1)
Definition simulation.h:822
double dGetMissingValue(void) const
Returns the NODATA value.
int m_nSimStartSec
Start time of the simulation (seconds)
Definition simulation.h:568
int m_nSimStartDay
Start date of the simulation (day)
Definition simulation.h:577
unsigned long m_ulThisIterNumActualPlatformErosionCells
Definition simulation.h:641
bool m_bSandUnconsSedSave
Save sand unconsolidated sediment raster GIS files?
Definition simulation.h:197
bool m_bActualPlatformErosionTSSave
Save the actual (supply-limited) shore platform erosion time series file?
Definition simulation.h:302
unsigned long ulConvertToTimestep(string const *) const
For sediment input events, parses a string that may be relative (a number of hours or days after the ...
Definition utils.cpp:2778
int m_nCoastNormalSpacing
Average spacing between coastline normals, measured in cells.
Definition simulation.h:498
int m_nXMaxBoundingBox
The maximum x value of the bounding box.
Definition simulation.h:555
string m_strOGRFloodGeometry
GDAL geometry for the flood input locations point or vector file.
long double m_ldGTotPotentialSedLostBeachErosion
double m_dThisIterCliffCollapseErosionFineUncons
Definition simulation.h:994
double dGetD50Coarse(void) const
Returns the global d50 value for coarse sediment.
string m_strOGRSedInputDriverDesc
bool m_bTotCliffCollapseSave
Save total cliff collapse raster GIS files?
Definition simulation.h:224
int nReadShapeFunctionFile(void)
Reads the shape of the erosion potential distribution (see shape function in Walkden & Hall,...
void MergeProfilesAtFinalLineSegments(int const, CGeomProfile *, CGeomProfile *, int const, int const, double const, double const, double const, double const)
Merges two profiles which intersect at their final (most seaward) line segments, seaward of their poi...
static void AnnounceAddLayers(void)
Tells the user that we are now adding layers.
Definition utils.cpp:418
vector< unsigned long > m_VlDeepWaterWaveValuesAtTimestep
Calculate deep water wave values at these timesteps.
int nDoAllActualBeachErosionAndDeposition(void)
Does between-polygon and within-polygon actual (supply-limited) redistribution of transported beach s...
bool m_bCliffSave
Save cliff region raster grids?
Definition simulation.h:97
bool m_bDoShorePlatformErosion
Simulate shore platform erosion?
Definition simulation.h:361
bool m_bSliceSave
Save slices?
Definition simulation.h:100
void WritePolygonShorePlatformErosion(int const)
Writes to the log file a table showing per-polygon unconsolidated sand/coarse sediment derived from e...
bool m_bRasterPolygonSave
Save raster polygon raster GIS files?
Definition simulation.h:233
double m_dInitialMeanSWL
The start-of-simulation still water level (m)
Definition simulation.h:737
string m_strOGRDWWVDriverCode
GDAL code for the deep water wave stations vector file.
bool m_bBeachDepositionSave
Save beach (unconsolidated sediment) deposition raster GIS files?
Definition simulation.h:170
vector< double > m_VdFloodLocationX
X coordinate (grid CRS) for total water level flooding.
double m_dNorthWestYExtCRS
Definition simulation.h:675
vector< string > m_VstrGDALICSDriverDesc
bool m_bSaveRegular
Save GIS files at regular intervals?
Definition simulation.h:263
int m_nLayers
The number of sediment layers.
Definition simulation.h:468
bool bFindExeDir(char const *)
Finds the folder (directory) in which the CoastalME executable is located.
Definition utils.cpp:218
double m_dStartIterConsCoarseAllCells
double m_dStartIterConsSandAllCells
void InterpolateWavePropertiesBetweenProfiles(int const, int const)
Interpolates wave properties from profiles to the coastline points between two profiles....
static double dSubtractProfiles(vector< double > const *, vector< double > const *, vector< bool > const *)
Calculate the total elevation difference between every point in two elevation profiles (first profile...
Definition utils.cpp:2569
bool m_bSedimentInputAlongLine
Do we have sediment input along a line?
Definition simulation.h:403
bool m_bSedimentInput
Do we have sediment input events?
Definition simulation.h:394
unsigned long m_ulThisIterNumBeachDepositionCells
Definition simulation.h:653
double m_dInmersedToBulkVolumetric
Definition simulation.h:854
bool m_bNormalsSave
Save coastline-normal vector GIS files?
Definition simulation.h:272
bool m_bAvgWaveHeightSave
Save wave height raster GIS files?
Definition simulation.h:112
static string strToLower(string const *)
Returns the lower case version of an string, leaving the original unchanged.
Definition utils.cpp:2388
int nInterpolateWavesToPolygonCells(vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *)
Interpolates wave properties from all profiles to all within-polygon sea cells, using GDALGridCreate(...
vector< double > m_VdThisIterDeepWaterWaveStationHeight
This-iteration wave height at deep water wave station.
int nCalcPotentialPlatformErosionBetweenProfiles(int const, CGeomProfile *, int const)
Calculates potential platform erosion on cells to one side of a given coastline-normal profile,...
CSimulation(void)
The CSimulation constructor.
double m_dDepositionSandDiff
Definition simulation.h:946
string m_strGDALBasementDEMDriverCode
GDAL code for the basement DEM raster file type.
vector< string > m_VstrGDALIUFDriverCode
GDAL driver code for the initial unconsolidated fine sediment GIS data.
bool m_bHaveSandSediment
Does this simulation consider sand-sized sediment?
Definition simulation.h:79
unsigned long m_ulMissingValueBasementCells
The number of basement cells marked with as missing value.
Definition simulation.h:664
void WritePolygonEstimatedMovement(int const, vector< vector< int > > &)
int nSaveProfile(int const, CGeomProfile const *, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Save a coastline-normal profile.
double m_dThisiterUnconsCoarseInput
Depth (m) of coarse unconsolidated sediment added, at this iteration.
int nReadVectorGISFile(int const)
Reads vector GIS datafiles using OGR.
bool bReadRunDataFile(void)
Reads the run details input file and does some initialization.
int m_nUSave
If user-defined GIS save intervals, the number of these.
Definition simulation.h:515
double m_dThisIterPotentialPlatformErosion
Definition simulation.h:874
bool bWriteTSFiles(void)
Write the results for this timestep to the time series CSV files.
double m_dDeanProfileStartAboveSWL
Berm height i.e. height above SWL of start of depositional Dean profile.
int m_nSavGolCoastPoly
Definition simulation.h:478
void WritePolygonPotentialErosion(int const)
Writes to the log file a table showing per-polygon potential erosion of all size classes of unconsoli...
bool m_bSeaDepthSave
Save sea depth raster GIS files?
Definition simulation.h:103
bool m_bWaveAngleAndHeightSave
Save wave angle and wave height raster GIS files?
Definition simulation.h:121
ofstream BeachDepositionTSStream
Beach sediment deposition time series file output stream.
double m_dNotchBaseBelowSWL
Notch base below SWL (m)
Definition simulation.h:976
vector< double > dVSmoothProfileSlope(vector< double > *) const
Does running-mean smoothing of the slope of a coastline-normal profile.
string m_strInitialBasementDEMFile
Name of initial basement DEM file.
int m_nRunUpEquation
The run-up equation used TODO 007.
Definition simulation.h:594
long double m_ldGTotCliffCollapseFine
All-simulation total of fine sediment from cliff collapse (m)
void WritePolygonActualMovement(int const, vector< vector< int > > const &)
Writes to the log file a table showing per-polygon actual movement of unconsolidated beach sediment.
bool m_bWorldFile
Write a GIS World file?
Definition simulation.h:384
long double m_ldGTotCliffTalusCoarseDeposition
int nDoSedimentInputEvent(int const)
Do a sediment input event.
static string strTrimRight(string const *)
Trims whitespace from the right side of a string, does not change the original string.
Definition utils.cpp:2343
vector< CGeomLine > m_VCliffEdge
The traced cliff edge lines (in external CRS)
vector< double > m_VdDeepWaterWaveStationX
X coordinate (grid CRS) for deep water wave station.
void AnnounceReadSedimentEventInputValuesGIS(void) const
Tells the user that we are now reading the sediment input events GIS file.
Definition utils.cpp:503
double dGetD50Fine(void) const
Returns the global d50 value for fine sediment.
string m_strLogFile
Name of output log file.
double m_dDepthOverDBMax
Definition simulation.h:954
long double m_ldGTotCliffCollapseCoarse
All-simulation total of coarse sediment from cliff collapse (m)
int m_nCoastNormalInterventionSpacing
Definition simulation.h:502
double m_dFineErodibility
The relative erodibility (0- 1) of fine unconsolidated beach sediment.
Definition simulation.h:825
double m_dThisiterUnconsFineInput
Depth (m) of fine unconsolidated sediment added, at this iteration.
time_t m_tSysStartTime
System start-simulation time.
double m_dBreakingWaveHeightDepthRatio
Breaking wave height-to-depth ratio.
Definition simulation.h:789
void AnnounceReadFloodLocationGIS(void) const
Tells the user that we are now reading the flood location GIS file.
Definition utils.cpp:518
double m_dCoastNormalSpacing
Average spacing of the coastline-normal profiles, in m.
Definition simulation.h:861
int nDoUnconsDepositionOnPolygon(int const, CGeomCoastPolygon *, int const, double, double &)
Deposits unconsolidated beach sediment (sand or coarse) on the cells within a polygon....
bool bCheckVectorGISOutputFormat(void)
Checks whether the selected vector OGR driver supports file creation etc.
bool m_bHaveWaveStationData
Do we have wave station data?
Definition simulation.h:391
double m_dSeaWaterDensity
Density of sea water in kg/m**3.
Definition simulation.h:734
int nDoSimulation(int, char const *[])
Runs the simulation.
int nReadCShoreOutput(int const, string const *, int const, int const, vector< double > const *, vector< double > *)
void StartClock(void)
Starts the clock ticking.
Definition utils.cpp:194
long double m_ldGTotSuspendedSediment
All-simulation total of suspended sediment (m)
vector< double > m_VdSedimentInputLocationX
X coordinate (grid CRS) for sediment input event.
int m_nSavGolCliffEdgePoly
Definition simulation.h:488
int nCreateAllPolygons(void)
Create polygons, and mark the polygon boundaries on the raster grid.
double m_dSandErodibilityNormalized
Relative erodibility of sand unconsolidated beach sediment, normalized.
Definition simulation.h:837
double m_dR
Coast platform resistance to erosion R, see Walkden & Hall, 2011.
Definition simulation.h:807
string m_strGDALLProjection
GDAL projection string for the initial landform class raster file.
bool m_bRasterNormalProfileSave
Save rasterized coastline-normal profiles GIS files?
Definition simulation.h:215
bool m_bActiveZoneSave
Save active zone raster GIS files?
Definition simulation.h:218
void AnnounceReadInitialSuspSedGIS(void) const
Tells the user that we are now reading the initial suspended sediment depth GIS file.
Definition utils.cpp:533
ofstream StillWaterLevelTSStream
SWL time series file output stream.
void DoEndOfRunDeletes(void)
Do end-of-run memory clearance.
Definition utils.cpp:2954
vector< string > m_VstrInitialSandUnconsSedimentFile
The name of the initial sand-sized unconsolidated sediment GIS file.
double m_dThisIterActualPlatformErosionSandCons
Definition simulation.h:882
void nTraceSeawardCliffEdge(void)
bool m_bOmitSearchWestEdge
Omit the west edge of the grid from coast-end searches?
Definition simulation.h:355
string m_strGDALIHProjection
GDAL projection string for the initial intervention height raster file.
void CheckForIntersectingProfiles(void)
Checks all coastline-normal profiles for intersection, and modifies those that intersect.
int nTraceFloodCoastLine(unsigned int const, int const, int const, vector< bool > *, vector< CGeom2DIPoint > const *)
Traces a coastline (which is defined to be just above still water level) on the grid using the 'wall ...
static int nDoTimeUnits(string const *)
This finds time units in a string.
Definition utils.cpp:352
void RasterizePolygonJoiningLine(int const, CGeom2DIPoint const *, CGeom2DIPoint const *, int const)
Puts a polygon 'joining line' (the line which is the seaward boundary of the polygon,...
string m_strGDALICDriverDesc
GDAL description of the initial intervention class raster file.
bool m_bSedimentInputAtCoast
Do we have sediment input at the coast?
Definition simulation.h:400
static void AnnounceReadRasterFiles(void)
Now reading raster GIS files.
Definition utils.cpp:427
int m_nCliffEdgeSmooth
Which method to use for cliff edge smoothing.
Definition simulation.h:481
double m_dCliffErosionResistance
Resistance of cliff to notch erosion.
Definition simulation.h:969
vector< string > m_VstrGDALIUSProjection
GDAL projection for the initial unconsolidated sand sediment GIS data.
double m_dThisIterBeachDepositionCoarse
Definition simulation.h:910
vector< double > m_VdThisIterDeepWaterWaveStationPeriod
This-iteration wave period at deep water wave station.
double dGridCentroidYToExtCRSY(int const) const
Given the integer Y-axis ordinate of a cell in the raster grid CRS, returns the external CRS Y-axis o...
Definition gis_utils.cpp:70
double m_dD50Sand
The D50 for sand sediment.
Definition simulation.h:813
void CalcD50AndFillWaveCalcHoles(void)
Calculates an average d50 for each polygon. Also fills in 'holes' in active zone and wave calcs i....
long double m_ldGTotCliffTalusSandDeposition
double m_dCellDiagonal
Length of a cell's diagonal (in external CRS units)
Definition simulation.h:695
string m_strCMEDir
The CME folder.
vector< int > m_VnProfileToSave
The numbers of the profiles which are to be saved.
bool m_bDeepWaterWaveHeightSave
Save deep water wave height raster GIS files?
Definition simulation.h:251
bool m_bMeanWaveEnergySave
Save mean wave energy raster GIS files?
Definition simulation.h:133
double m_dKLS
Transport parameter KLS in the CERC equation.
Definition simulation.h:843
ofstream BeachSedimentNetChangeTSStream
double m_dInvCellSide
Inverse of m_dCellSide.
Definition simulation.h:698
string m_strOGRDWWVDriverDesc
int m_nWavePropagationModel
Definition simulation.h:565
long double m_ldGTotCliffCollapseSandErodedDuringDeposition
double m_dAllCellsDeepWaterWaveAngle
Deep water wave angle for all sea cells.
Definition simulation.h:795
static bool bOnOrOffShoreAndUpOrDownCoast(double const, double const, int const, bool &)
Determines whether the wave orientation at this point on a coast is onshore or offshore,...
vector< string > m_VstrGDALICFProjection
GDAL projection for the initial consolidated fine sediment GIS data.
string m_strOGRFloodDriverCode
GDAL code for the flood input locations point or vector file.
double m_dSimElapsed
Time simulated so far, in hours.
Definition simulation.h:710
vector< string > m_VstrGDALICCProjection
GDAL projection for the initial consolidated coarse sediment GIS data.
static double dGetTimeMultiplier(string const *)
Given a string containing time units, this returns the appropriate multiplier.
Definition utils.cpp:278
bool m_bCoastCurvatureSave
Save coastline-curvature vector GIS files?
Definition simulation.h:278
int nGetGridXMax(void) const
Returns the cell size.
int m_nCliffEdgeSmoothWindow
The size of the window used for cliff edge smoothing. Must be an odd number.
Definition simulation.h:484
int m_nDeepWaterWaveDataNumTimeSteps
Definition simulation.h:587
bool bWriteProfileData(int const, CGeomProfile const *, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Writes values for a single profile, for checking purposes.
void AnnounceReadBasementDEM(void) const
Tells the user that we are now reading the DEM file.
Definition utils.cpp:397
int nConvertMetresToNumCells(double const) const
Given a length in m, this returns the rounded equivalent number of cells.
void nLocateCliffCell(void)
long double m_ldGTotCoarseSedimentInput
All-simulation total of coarse sediment input (m)
double m_dFinalMeanSWL
Definition simulation.h:741
double dGridYToExtCRSY(double const) const
Given a real-valued Y-axis ordinate in the raster grid CRS (i.e. not the centroid of a cell),...
Definition gis_utils.cpp:97
bool bWriteParProfileData(int const, int const, int const, int const, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Writes values for a single parallel profile, for checking purposes.
double m_dThisIterUnconsCoarseCliffDeposition
bool bWritePerTimestepResultsCSV(void)
Write the results for this timestep to the .out file in CSV format.
bool m_bGDALCanWriteInt32
Definition simulation.h:378
bool m_bRasterWaveFloodLineSave
Are we saving the raster wave flood line? TODO 007.
Definition simulation.h:430
bool m_bBreakingWaveHeightSave
Save breaking wave height raster GIS files?
Definition simulation.h:136
double m_dThisIterTotSeaDepth
Total sea depth (m) for this iteration.
Definition simulation.h:870
double m_dTotPotentialPlatformErosionOnProfiles
Total potential platform erosion on profiles.
Definition simulation.h:957
string m_strMailAddress
An email addresx to which to send end-of-simulation messages.
double m_dRegularSaveTime
Definition simulation.h:714
bool m_bPolygonNodeSave
Save polygon node vector GIS files?
Definition simulation.h:281
bool m_bOmitSearchNorthEdge
Omit the north edge of the grid from coast-end searches?
Definition simulation.h:349
long double m_ldGTotCoarseActualPlatformErosion
All-simulation total of coarse sediment actual platform erosion (m)
long double m_ldGTotFineActualPlatformErosion
All-simulation total of fine sediment actual platform erosion (m)
double m_dThisIterUnconsSandCliffDeposition
vector< int > m_VnDeepWaterWaveStationID
long double m_ldGTotSandSedimentInput
All-simulation total of sand sediment input (m)
string strListTSFiles(void) const
Return a space-separated string containing the names of the time series output files.
Definition utils.cpp:1019
bool m_bFloodSetupSurgeTSSave
Definition simulation.h:327
bool m_bTotalPotentialPlatformErosionSave
Save total potential shore platform erosion raster GIS files?
Definition simulation.h:148
string m_strGDALLDriverDesc
GDAL description of the initial landform class raster file.
void SetRasterFileCreationDefaults(void)
Sets per-driver defaults for raster files created using GDAL.
bool m_bSetupSurgeFloodMaskSave
Are we saving the setup surge flood mask? TODO 007.
Definition simulation.h:424
bool m_bWaveEnergySinceCollapseSave
Save wave energy since cliff collapse raster GIS files?
Definition simulation.h:130
double m_dNorthWestXExtCRS
Definition simulation.h:671
double m_dD50Coarse
The D50 for coarse sediment.
Definition simulation.h:816
vector< CGeom2DIPoint > m_VEdgeCell
Edge cells.
static bool bCheckForIntersection(CGeomProfile *const, CGeomProfile *const, int &, int &, double &, double &, double &, double &)
Checks all line segments of a pair of coastline-normal profiles for intersection. If the lines inters...
int nInterpolateAllDeepWaterWaveValues(void)
If the user supplies multiple deep water wave height and angle values, this routine interplates these...
static void AnnounceStart(void)
Tells the user that we have started the simulation.
Definition utils.cpp:186
static int nUpdateIntervention(void)
Check to see if we have a new intervention in place (not yet implemented)
vector< int > m_VnFloodLocationID
ID for flood location.
int m_nCoastCurvatureInterval
Coast curvature interval is a length, measured in coastline points.
Definition simulation.h:505
vector< unsigned long > m_VulProfileTimestep
Timesteps at which to save profiles.
int nCalcPotentialPlatformErosionOnProfile(int const, CGeomProfile *)
Calculates potential (i.e. unconstrained by available sediment) erosional lowering of the shore platf...
ofstream CliffCollapseErosionTSStream
Cliff collapse erosion time series file output stream.
double m_dThisIterPotentialSedLostBeachErosion
Definition simulation.h:918
double m_dSouthEastYExtCRS
Definition simulation.h:683
bool m_bPotentialBeachErosionSave
Save potential beach (unconsolidated sediment) erosion raster GIS files?
Definition simulation.h:155
static bool bParseDate(string const *, int &, int &, int &)
Parses a date string into days, months, and years, and checks each of them.
Definition utils.cpp:2656
string m_strFloodLocationShapefile
The name of the flood loction events shape file.
long double m_ldGTotCliffCollapseFineErodedDuringDeposition
~CSimulation(void)
The CSimulation destructor.
long double m_ldGTotCoarseDepositionDiff
int nSetAllCoastpointDeepWaterWaveValues(void)
Give every coast point a value for deep water wave height and direction TODO 005 This may not be real...
double m_dStartIterConsFineAllCells
long double m_ldGTotActualCoarseLostBeachErosion
bool m_bGISSaveDigitsSequential
Definition simulation.h:449
static CGeom2DIPoint PtiFollowWaveAngle(CGeom2DIPoint const *, double const, double &)
Given a cell and a wave orientation, finds the 'upwave' cell.
vector< double > m_VdSavGolFCRWCoast
Savitzky-Golay filter coefficients for the coastline vector(s)
vector< double > m_VdSavGolFCGeomProfile
Savitzky-Golay filter coefficients for the profile vectors.
int nUpdateGrid(void)
Update all cells in the raster raster grid and do some per-timestep accounting.
int m_nSimStartMonth
Start date of the simulation (month)
Definition simulation.h:580
CGeomLine nValidateCliffToeDirection(CGeomLine &CliffEdge, bool bReverse)
int nGetCoastNormalEndPoint(int const, int const, int const, CGeom2DPoint const *, double const, CGeom2DPoint *, CGeom2DIPoint *, bool const)
Finds the end point of a coastline-normal line, given the start point on the vector coastline....
int nAssignLandformsForAllCells(void)
Each timestep, classify landforms for cells that are not on the coastline.
string m_strGDALIWProjection
GDAL projection string for the initial water depth raster file.
bool m_bSuspSedSave
Save suspended sediment raster GIS files?
Definition simulation.h:188
double m_dMinCliffTalusHeightFrac
Definition simulation.h:990
double m_dThisIterBeachErosionSand
Definition simulation.h:898
static double dAngleSubtended(CGeom2DIPoint const *, CGeom2DIPoint const *, CGeom2DIPoint const *)
Returns the signed angle BAC (in radians) subtended between three CGeom2DIPoints B A C....
vector< string > m_VstrGDALIUSDriverDesc
string m_strDurationUnits
The duration units for this simulation.
void TruncateProfileAndAppendNew(int const, CGeomProfile *, int const, vector< CGeom2DPoint > const *, vector< vector< pair< int, int > > > const *)
Truncate a profile at the point of intersection, and do the same for all its co-incident profiles.
double m_dAccumulatedSeaLevelChange
Definition simulation.h:756
bool m_bPolygonBoundarySave
Save polygon boundary vector GIS files?
Definition simulation.h:284
bool bElevAboveDeanElev(int const, int const, double const, CRWCellLandform const *)
Return true if the given elevation is higher than the Dean elevation (and other conditions are met),...
void WritePolygonPreExistingSedimentTable(int const)
Writes to the log file a table showing per-polygon pre-existing unconsolidated sediment.
bool m_bStormSurgeSave
Are we saving the storm surge? TODO 007.
Definition simulation.h:418
void DoActualPlatformErosionOnCell(int const, int const)
Calculates actual (constrained by available sediment) erosion of the consolidated shore platform on a...
vector< string > m_VstrInitialFineUnconsSedimentFile
The name of the initial fine-sized unconsolidated sediment GIS file.
double dExtCRSXToGridX(double const) const
Transforms an X-axis ordinate in the external CRS to the equivalent X-axis ordinate in the raster gri...
bool m_bActualPlatformErosionSave
Save actual (supply-limited) shore platform erosion raster GIS files?
Definition simulation.h:145
double m_dThisIterFineSedimentToSuspension
Definition simulation.h:914
int nDoAllWaveEnergyToCoastLandforms(void)
Update accumulated wave energy in coastal landform objects.
bool bWritePerTimestepResultsFixedWidth(void)
Write the results for this timestep to the .out file in fixed-width format.
int nInsertPointIntoProfilesIfNeededThenUpdate(int const, CGeomProfile *, double const, double const, int const, CGeomProfile *, int const, bool const)
Inserts an intersection point into the profile that is to be retained, if that point is not already p...
double m_dThisIterBeachErosionFine
Definition simulation.h:894
void DoAllPotentialBeachErosion(void)
Uses either the CERC equation or the Kamphuis (1990) equation to calculate potential (unconstrained) ...
void FillPotentialPlatformErosionHoles(void)
Fills in 'holes' in the potential platform erosion i.e. orphan cells which get omitted because of rou...
bool bSurroundedByDriftCells(int const, int const)
Returns true if this cell has four drift cells surrounding it.
double m_dThisIterCliffCollapseSandErodedDuringDeposition
Definition simulation.h:938
int m_nSimStartMin
Start time of the simulation (minutes)
Definition simulation.h:571
bool bSaveAllRasterGISFiles(void)
The bSaveAllRasterGISFiles member function saves the raster GIS files using values from the RasterGri...
string m_strOGRDWWVGeometry
GDAL geometry for the deep water wave stations vector file.
unsigned long m_ulThisIterNumActualBeachErosionCells
Definition simulation.h:649
bool bReadIniFile(void)
The bReadIniFile member function reads the initialization file.
bool m_bHaveFineSediment
Does this simulation consider fine-sized sediment?
Definition simulation.h:76
double m_dCliffDepositionA
Definition simulation.h:980
string m_strDataPathName
Folder in which the CME data file is found.
string m_strOutPath
Path for all output files.
bool m_bBeachErosionTSSave
Save the beach (unconsolidated sediment) erosion time series file?
Definition simulation.h:314
int m_nYMaxBoundingBox
The maximum y value of the bounding box.
Definition simulation.h:561
int nDoCliffCollapse(int const, CRWCliff *, double &, double &, double &, double &, double &)
Simulates cliff collapse on a single cliff object, which happens when when a notch (incised into a co...
vector< string > m_VstrGDALICFDriverDesc
vector< double > m_VdSedimentInputLocationY
X coordinate (grid CRS) for sediment input event.
static string strGetBuild(void)
Returns the date and time on which the program was compiled.
Definition utils.cpp:1633
string m_strTideDataFile
Name of tide data file.
vector< string > m_VstrGDALIUFDriverDesc
vector< bool > m_bUnconsChangedThisIter
bool m_bTotalPotentialBeachErosionSave
Definition simulation.h:163
unsigned long m_ulThisIterNumPotentialPlatformErosionCells
Definition simulation.h:637
string m_strGDALIWDataType
GDAL data type for the initial water depth raster file.
vector< string > m_VstrGDALIUSDataType
GDAL data type for the initial unconsolidated sand sediment GIS data.
double m_dStartIterUnconsSandAllCells
double m_dMaxSWL
Maximum still water level.
Definition simulation.h:762
void nRemoveSmallCliffIslands(int const)
long double m_ldGTotActualSandLostBeachErosion
double m_dDeltaSWLPerTimestep
If long-term SWL changes, the increment per timestep.
Definition simulation.h:744
void AllPolygonsUpdateStoredUncons(int const)
Before simulating beach erosion, update the per-polygon values of pre-existing unconsolidated sedimen...
int m_nGISSave
The save number for GIS files (can be sequential, or the iteration number)
Definition simulation.h:512
string m_strInterventionClassFile
Name of intervention class file.
static CGeom2DIPoint PtiWeightedAverage(CGeom2DIPoint const *, CGeom2DIPoint const *, double const)
Returns an integer point (grid CRS) which is the weighted average of two other grid CRS integer point...
default_random_engine m_Rand[NUMBER_OF_RNGS]
The c++11 random number generators.
long double m_ldGTotActualFineLostBeachErosion
string m_strGDALBasementDEMDataType
GDAL data type for the basement DEM raster file.
bool m_bFloodSWLSetupLine
Are we saving the flood still water level setup line? TODO 007.
Definition simulation.h:439
bool m_bSeaMaskSave
Save sea mask raster GIS files?
Definition simulation.h:239
void CalcTime(double const)
Calculates and displays time elapsed in terms of CPU time and real time, also calculates time per tim...
Definition utils.cpp:1442
double m_dThisIterCliffCollapseErosionFineCons
bool m_bInterventionClassSave
Save intervention class raster GIS files?
Definition simulation.h:182
long double m_ldGTotCoarseSedLostCliffCollapse
All-simulation total of coarse sediment lost via cliff collapse (m)
double m_dCoastNormalInterventionSpacing
Average spacing of the coastline-normal profiles on interventions, in m.
Definition simulation.h:864
long double m_ldGTotSandActualPlatformErosion
All-simulation total of sand sediment actual platform erosion (m)
int m_nSimStartYear
Start date of the simulation (year)
Definition simulation.h:583
CGeom2DIPoint PtiFindClosestCoastPoint(int const, int const)
Finds the closest point on any coastline to a given point.
bool m_bTotalActualBeachErosionSave
Definition simulation.h:167
bool m_bRasterCoastlineSave
Save rasterized coastline GIS files?
Definition simulation.h:212
string m_strDeepWaterWavesInputFile
The name of the deep water wave stations time series file.
static string pstrChangeToBackslash(string const *)
Changes all forward slashes in the input string to backslashes, leaving the original unchanged.
Definition utils.cpp:2308
static CGeom2DPoint PtFindPointInPolygon(vector< CGeom2DPoint > const *, int const)
Finds a point in a polygon: is guaranteed to succeed, as every strictly closed polygon has at least o...
void WritePolygonInfoTable(int const)
Writes to the log file a table showing polygon info.
long double m_ldGTotSandSedLostCliffCollapse
All-simulation total of sand sediment lost via cliff collapse (m)
double m_dUnconsSandNotDepositedLastIter
double m_dThisIterDiffWaveSetupWaterLevel
TODO 007 Info needed.
Definition simulation.h:768
static CGeom2DPoint PtGetPerpendicular(CGeom2DPoint const *, CGeom2DPoint const *, double const, int const)
Returns a CGeom2DPoint which is the 'other' point of a two-point vector passing through PtStart,...
string m_strGDALICProjection
GDAL projection string for the initial intervention class raster file.
bool m_bInterventionHeightSave
Save intervention height raster GIS files?
Definition simulation.h:185
double m_dTotalCoarseConsInPolygons
int m_nCoastCurvatureMovingWindowSize
Definition simulation.h:599
ofstream SeaAreaTSStream
Sea area time series file output stream.
unsigned long m_ulThisIterNumSeaCells
The number of grid cells which are marked as sea, for this iteration.
Definition simulation.h:630
int nDoUnconsErosionOnPolygon(int const, CGeomCoastPolygon *, int const, double const, double &)
Erodes unconsolidated beach sediment of one texture class on the cells within a polygon....
void AnnounceReadIHGIS(void) const
Tells the user that we are now reading the Intervention height GIS file.
Definition utils.cpp:473
double m_dTotalSandUnconsInPolygons
void AnnounceReadInitialCoarseConsSedGIS(int const) const
Tells the user that we are now reading the initial coarse consolidated sediment depth GIS file.
Definition utils.cpp:611
bool m_bRiverineFlooding
Are we doing flooding? TODO 007.
Definition simulation.h:412
long m_lGDALMinCanWrite
Definition simulation.h:615
int nCreateAllProfiles(void)
Create coastline-normal profiles for all coastlines. The first profiles are created 'around' the most...
double m_dStartIterUnconsFineAllCells
static string strGetErrorText(int const)
Returns an error message given an error code.
Definition utils.cpp:1914
bool m_bSandConsSedSave
Save sand consolidated sediment raster GIS files?
Definition simulation.h:206
CGeomCoastPolygon * pGetPolygon(int const) const
Returns a pointer to a coast polygon, in down-coast sequence.
Definition utils.cpp:2937
bool m_bSedimentInputEventSave
Save sediment inut data?
Definition simulation.h:406
static double dTriangleAreax2(CGeom2DPoint const *, CGeom2DPoint const *, CGeom2DPoint const *)
Returns twice the signed area of a triangle.
bool m_bHaveCoarseSediment
Does this simulation consider coarse-sized sediment?
Definition simulation.h:82
double m_dRegularSaveInterval
The interval between regular saves, in hours.
Definition simulation.h:717
long double m_ldGTotActualFineBeachErosion
CGeomLine LSmoothCoastSavitzkyGolay(CGeomLine *, int const, int const) const
Does smoothing of a CGeomLine coastline vector (is in external CRS coordinates) using a Savitzky-Gola...
bool m_bPolygonUnconsSedGainOrLossSave
Save polygon unconsolidated sediment gain or loss raster GIS files?
Definition simulation.h:260
void MarkPolygonCells(void)
Marks cells of the raster grid that are within each coastal polygon. The cell-by-cell fill (aka 'floo...
string m_strGDALISSDriverDesc
GDAL description for the initial suspended sediment raster file.
double m_dTimeStep
The length of an iteration (a time step) in hours.
Definition simulation.h:707
static void AnnounceAllocateMemory(void)
Tells the user that we are now allocating memory.
Definition utils.cpp:410
unsigned long m_ulTotPotentialPlatformErosionOnProfiles
Definition simulation.h:657
bool m_bCliffCollapseDepositionTSSave
Save the cliff collapse deposition time series file?
Definition simulation.h:308
int m_nXMinBoundingBox
The minimum x value of the bounding box.
Definition simulation.h:552
double dGetD50Sand(void) const
Returns the global d50 value for sand sediment.
string m_strGDALRasterOutputDriverLongname
GDAL raster output driver long name.
vector< string > m_VstrGDALIUCDriverCode
GDAL driver code for the initial unconsolidated coarse sediment GIS data.
ofstream PlatformErosionTSStream
Shore platform erosion time series file output stream.
void DoEndOfTimestepTotals(void)
Update and print totals at the end of each timestep.
double m_dCellArea
Area of a cell (in external CRS units)
Definition simulation.h:692
bool m_bDeepWaterWaveAngleAndHeightSave
Save deep water wave angle and wave height raster GIS files?
Definition simulation.h:127
unsigned long m_ulTotPotentialPlatformErosionBetweenProfiles
Definition simulation.h:661
double dExtCRSYToGridY(double const) const
Transforms a Y-axis ordinate in the external CRS to the equivalent Y-axis ordinate in the raster grid...
double m_dCoastNormalRandSpacingFactor
Random factor for spacing of along-coast normals.
double m_dMaxUserInputWaveHeight
Maximum deep water wave height.
Definition simulation.h:801
vector< double > m_VdSliceElev
Elevations for raster slice output.
void AnnounceReadInitialFineConsSedGIS(int const) const
Tells the user that we are now reading the initial fine consolidated sediment depth GIS file.
Definition utils.cpp:585
bool m_bBeachProtectionSave
Save beach protection raster GIS files>
Definition simulation.h:139
static string strDispTime(double const, bool const, bool const)
strDispTime returns a string formatted as h:mm:ss, given a parameter in seconds, with rounding and fr...
Definition utils.cpp:1569
string m_strOGRSedInputGeometry
GDAL geometry for the sediment input event locations vector file.
string m_strOGRSedInputDriverCode
GDAL code for the sediment input event locations vector file.
bool m_bDoBeachSedimentTransport
Simulate unconsolidated sediment (beach) transport?
Definition simulation.h:367
int nGetThisProfileElevationsForCShore(int const, CGeomProfile *, int const, vector< double > *, vector< double > *, vector< double > *)
Get profile horizontal distance and bottom elevation vectors in CShore units.
unsigned long m_ulThisIterNumPotentialBeachErosionCells
Definition simulation.h:645
bool m_bFineConsSedSave
Save fine consolidated sediment raster GIS files?
Definition simulation.h:203
string m_strGDALIWDriverDesc
GDAL description for the initial water depth raster file.
bool m_bShadowDowndriftBoundarySave
Save wave shadow downdrift boundary vector GIS files?
Definition simulation.h:293
bool bIsWithinValidGrid(int const, int const) const
Checks whether the supplied point (an x-y pair, in the grid CRS) is within the raster grid,...
int nDoParallelProfileUnconsErosion(CGeomCoastPolygon *, int const, int const, int const, int const, int const, int const, vector< CGeom2DIPoint > const *, vector< double > const *, double &, double &, double &)
This routine erodes unconsolidated beach sediment (either fine, sand, or coarse) on a parallel profil...
int m_nCoastSmooth
Which method to use for coast smoothing.
Definition simulation.h:471
bool m_bDeepWaterWavePeriodSave
Save deep water wave period raster GIS files?
Definition simulation.h:254
string m_strGDALBasementDEMDriverDesc
GDAL description of the basement DEM raster file type.
void ModifyBreakingWavePropertiesWithinShadowZoneToCoastline(int const, int const)
Modifies the wave breaking properties at coastline points of profiles within the shadow zone.
string m_strInitialLandformFile
Name of initial landform file.
double m_dC_0
Deep water wave speed (m/s)
Definition simulation.h:780
string m_strInterventionHeightFile
Name of intervention height file.
double m_dThisIterCliffCollapseErosionSandCons
bool m_bBeachSedimentChangeNetTSSave
Save the beach (unconsolidated sediment) net change time series file?
Definition simulation.h:320
int nCreateProfile(int const, int const, int const, int const, int &, bool const, CGeom2DIPoint const *)
Creates a single coastline-normal profile (which may be an intervention profile)
vector< string > m_VstrGDALICSDataType
GDAL data type for the initial consolidated sand sediment GIS data.
double dGridXToExtCRSX(double const) const
Given a real-valued X-axis ordinate in the raster grid CRS (i.e. not the centroid of a cell),...
Definition gis_utils.cpp:89
double m_dThisIterBeachDepositionSand
Definition simulation.h:906
int nReadTideDataFile(void)
Reads the tide time series data.
bool m_bCoarseConsSedSave
Save coarse consolidated sediment raster GIS files?
Definition simulation.h:209
string m_strOGRFloodDriverDesc
bool m_bSeaAreaTSSave
Save the sea area time series file?
Definition simulation.h:296
bool m_bScaleRasterOutput
Scale raster output?
Definition simulation.h:381
double dGetThisIterSWL(void) const
Returns this timestep's still water level.
vector< string > m_VstrGDALICSProjection
GDAL dprojection for the initial consolidated sand sediment GIS data.
void CalcProcessStats(void)
This calculates and displays process statistics.
Definition utils.cpp:1687
void DoShadowZoneAndDownDriftZone(int const, int const, int const, int const)
Traverse the shadow zone, changing wave orientation and height, and the down-drift zone,...
static double dCalcCurvature(int const, CGeom2DPoint const *, CGeom2DPoint const *, CGeom2DPoint const *)
Calculates signed Menger curvature (https://en.wikipedia.org/wiki/Menger_curvature#Definition) from t...
int nGetCoastPolygonSize(void) const
Returns the size of the coast polygon vector.
Definition utils.cpp:2929
CGeom2DPoint PtGridCentroidToExt(CGeom2DIPoint const *) const
Transforms a pointer to a CGeom2DIPoint in the raster grid CRS (assumed to be the centroid of a cell)...
Definition gis_utils.cpp:78
double m_dThisIterLeftGridUnconsCoarse
Definition simulation.h:930
void DoCoastCurvature(int const, int const)
Calculates both detailed and smoothed curvature for every point on a coastline.
double m_dThisIterCliffCollapseErosionSandUncons
Definition simulation.h:998
string m_strOGRFloodDataType
GDAL data type for the flood input locations point or vector file.
double m_dD50Fine
The D50 for fine sediment.
Definition simulation.h:810
unsigned long m_ulRandSeed[NUMBER_OF_RNGS]
A seed for each of the random number generators.
Definition simulation.h:624
bool m_bOmitSearchSouthEdge
Omit the south edge of the grid from coast-end searches?
Definition simulation.h:352
string m_strGDALRasterOutputDriverExtension
GDAL raster output driver file extension.
bool m_bBeachMaskSave
Save beach mask raster GIS files?
Definition simulation.h:242
string m_strGDALBasementDEMProjection
GDAL projection string for the basement DEM raster file.
bool bOpenLogFile(void)
Opens the log file.
Definition utils.cpp:373
double m_dTotalSandConsInPolygons
bool m_bSlopeSave
Save slope raster grids?
Definition simulation.h:94
void LocateAndCreateProfiles(int const, int &, int &, vector< bool > *, vector< pair< int, double > > const *)
For a single coastline, locate the start points for all coastline-normal profiles (except the grid-ed...
static void AppendEnsureNoGap(vector< CGeom2DIPoint > *, CGeom2DIPoint const *)
Appends a CGeom2DIPoint to a vector<CGeom2DIPoint>, making sure that the new end point touches the pr...
Definition utils.cpp:2489
unsigned long m_ulIter
The number of the current iteration (time step)
Definition simulation.h:618
void AnnounceLicence(void)
Tells the user about the licence.
Definition utils.cpp:257
bool m_bAvgSuspSedSave
Save average suspended sediment raster GIS files?
Definition simulation.h:191
void WritePolygonUnsortedSequence(int const, vector< vector< int > > &)
Writes to the log file a table showing the unsorted sequence of polygon processing.
double m_dBeachSedimentDensity
The density of unconsolidated beach sediment (kg/m**3)
Definition simulation.h:819
double dGridCentroidXToExtCRSX(int const) const
Given the integer X-axis ordinate of a cell in the raster grid CRS, returns the external CRS X-axis o...
Definition gis_utils.cpp:62
vector< string > m_VstrInitialCoarseConsSedimentFile
The name of the initial coarse-sized consolidated sediment GIS file.
string m_strOGRDWWVDataType
GDAL data type for the deep water wave stations vector file.
int m_nNumPolygonGlobal
Number of global (all coasts) polygons.
Definition simulation.h:535
int nReadRasterBasementDEM(void)
Reads a raster DEM of basement elevation data to the Cell array.
double m_dSimDuration
Duration of simulation, in hours.
Definition simulation.h:704
double m_dTotalFineUnconsInPolygons
int nTraceAllCoasts(int &)
Locates all the potential coastline start/finish points on the edges of the raster grid,...
string m_strGDALIHDriverCode
GDAL code for the initial intervention height raster file.
long double m_ldGTotSandDepositionDiff
bool m_bCSVPerTimestepResults
Output per-timestep results in CSV format instead of fixed-width?
Definition simulation.h:346
double m_dCliffSlopeLimit
Slope limit for cliff toe detection.
Definition simulation.h:491
void TruncateOneProfileRetainOtherProfile(int const, CGeomProfile *, CGeomProfile *, double, double, int, int, bool const)
Truncates one intersecting profile at the point of intersection, and retains the other profile.
string m_strGDALICDriverCode
GDAL code for the initial intervention class raster file.
ofstream FloodSetupSurgeTSStream
Flood setup surge time series file output stream.
double dCalcBeachProtectionFactor(int const, int const, double const)
Calculates the (inverse) beach protection factor as in SCAPE: 0 is fully protected,...
bool bTimeToQuit(void)
Checks to see if the simulation has gone on too long, amongst other things.
Definition utils.cpp:1331
double m_dTotalFineConsInPolygons
double m_dThisiterUnconsSandInput
Depth (m) of sand unconsolidated sediment added, at this iteration.
double m_dExtCRSGridArea
The area of the grid (in external CRS units)
Definition simulation.h:686
void ProcessDownDriftCell(int const, int const, int const, double const, int const)
Process a single cell which is in the downdrift zone, changing its wave height.
int nDoAllPropagateWaves(void)
Simulates wave propagation along all coastline-normal profiles.
vector< double > m_VdThisIterDeepWaterWaveStationAngle
This-iteration wave orientation at deep water wave station.
bool m_bOutputProfileData
Output profile data?
Definition simulation.h:337
double m_dThisIterDiffWaveSetupSurgeRunupWaterLevel
TODO 007 Info needed.
Definition simulation.h:774
double m_dCellSide
Length of a cell side (in external CRS units)
Definition simulation.h:689
void nValidateCliffToeEdges(void)
void CellByCellFillSea(int const, int const)
Cell-by-cell fills all sea cells starting from a given cell. The cell-by-cell fill (aka 'floodfill') ...
vector< string > m_VstrGDALIUCDriverDesc
bool bIsInterventionCell(int const, int const) const
Returns true if the cell is an intervention.
Definition utils.cpp:2918
double m_dMaxBeachElevAboveSWL
Maximum elevation of beach above SWL (m)
Definition simulation.h:966
long double m_ldGTotActualSandBeachErosion
double m_dBreakingWaveHeight
The height of breaking waves (m)
Definition simulation.h:777
void AnnounceProgress(void)
Displays information regarding the progress of the simulation.
Definition utils.cpp:1650
bool m_bTotCliffCollapseDepositionSave
Save total cliff collapse deposition raster GIS files?
Definition simulation.h:230
double m_dAllCellsDeepWaterWavePeriod
Deep water wave period for all sea cells.
Definition simulation.h:798
double m_dThisIterCliffCollapseCoarseErodedDuringDeposition
Definition simulation.h:942
int nMarkBoundingBoxEdgeCells(void)
Mark cells which are at the edge of a bounding box which represents the valid part of the grid,...
bool bCreateErosionPotentialLookUp(vector< double > *, vector< double > *, vector< double > *)
Creates a look-up table for erosion potential, given depth over DB.
long double m_ldGTotSandBeachDeposition
double m_dUSaveTime[SAVEMAX]
Definition simulation.h:721
vector< int > m_VnSavGolIndexCoast
Savitzky-Golay shift index for the coastline vector(s)
void AnnounceReadLGIS(void) const
Tells the user that we are now reading the Landscape category GIS file.
Definition utils.cpp:443
double m_dThisIterTopElevMax
This-iteration highest elevation of DEM.
double m_dThisIterActualPlatformErosionFineCons
Definition simulation.h:878
vector< double > m_VdFloodLocationY
X coordinate (grid CRS) for total water level flooding.
long double m_ldGTotPotentialBeachErosion
All-simulation total of potential beach erosion (m), all size classes.
double m_dProfileMaxSlope
Maximum slope on coastline-normal profiles.
Definition simulation.h:963
int m_nProfileSmoothWindow
Definition simulation.h:495
string m_strGDALIHDriverDesc
GDAL description for the initial intervention height raster file.
bool m_bDoCliffCollapse
Simulate cliff collapse?
Definition simulation.h:364
static void AnnounceReadVectorFiles(void)
Now reading vector GIS files.
Definition utils.cpp:435
double m_dThisIterCliffCollapseErosionCoarseCons
double m_dThisIterLeftGridUnconsSand
Definition simulation.h:926
double m_dDepthOfClosure
Definition simulation.h:858
int nCheckAllProfiles(void)
Check all coastline-normal profiles and modify the profiles if they intersect, then mark valid profil...
int nInitGridAndCalcStillWaterLevel(void)
At the beginning of each timestep: clear vector coasts, profiles, and polygons, initialize the raster...
Definition init_grid.cpp:50
vector< string > m_VstrGDALICCDriverDesc
double m_dStartIterSuspFineAllCells
string m_strOutFile
Name of main output file.
bool m_bSetupSurgeRunupFloodMaskSave
Are we saving the setup surge runup flood mask? TODO 007.
Definition simulation.h:427
static void CalcDeanProfile(vector< double > *, double const, double const, double const, bool const, int const, double const)
Calculates a Dean equilibrium profile h(y) = A * y^(2/3) where h(y) is the distance below the highest...
Definition utils.cpp:2528
double m_dThisIterDiffTotWaterLevel
TODO 007 Info needed.
Definition simulation.h:765
vector< bool > m_bConsChangedThisIter
string m_strGDALIHDataType
GDAL data type for the initial intervention height raster file.
ofstream FineSedSuspensionTSStream
Fine sediment in suspension time series file output stream.
ofstream FloodSetupSurgeRunupTSStream
Flood setup surge runup time series file output stream.
bool m_bWaveSetupSave
Are we saving the wave setup? TODO 007.
Definition simulation.h:415
int nDoPolygonSharedBoundaries(void)
For between-polygon potential sediment routing: find which are the adjacent polygons,...
void AnnounceReadTideData(void) const
Now reading tide data file.
Definition utils.cpp:624
static bool bIsWithinPolygon(CGeom2DPoint const *, vector< CGeom2DPoint > const *)
Determines whether a point is within a polygon: however if the point is exactly on the edge of the po...
vector< double > m_VdTSDeepWaterWaveStationHeight
Time series of wave heights at deep water wave station.
double m_dClkLast
Last value returned by clock()
Definition simulation.h:724
bool m_bShadowZoneCodesSave
Save wave shadow zones raster GIS files?
Definition simulation.h:245
long double m_ldGTotFineSedimentInput
All-simulation total of fine sediment input (m)
double m_dThisIterMeanSWL
Definition simulation.h:752
vector< string > m_VstrGDALIUCDataType
GDAL data type for the initial unconsolidated coarse sediment GIS data.
bool m_bCliffCollapseErosionTSSave
Save the cliff collapse erosion time series file?
Definition simulation.h:305
bool m_bPotentialPlatformErosionSave
Save potential shore platform erosion raster GIS files?
Definition simulation.h:142
static CGeom2DIPoint PtiPolygonCentroid(vector< CGeom2DIPoint > *)
Returns an integer point (grid CRS) which is the centroid of a polygon, given by a vector of grid CRS...
long double m_ldGTotPotentialPlatformErosion
All-simulation total of potential platform erosion (m), all size classes.
GDALDataType m_GDALWriteFloatDataType
Definition simulation.h:607
void InterpolateWaveHeightToCoastPoints(int const)
Linearly interpolates wave properties from profiles to the coastline cells between two profiles.
ofstream BeachErosionTSStream
Beach sediment erosion time series file output stream.
bool m_bGDALCanWriteFloat
Definition simulation.h:374
void AnnounceReadInitialCoarseUnconsSedGIS(int const) const
Tells the user that we are now reading the initial coarse unconsolidated sediment depth GIS file.
Definition utils.cpp:572
int nHandleCommandLineParams(int, char const *[])
Handles command-line parameters.
Definition utils.cpp:90
long double m_ldGTotCliffCollapseSand
All-simulation total of sand sediment from cliff collapse (m)
int FindAllInundatedCells(void)
Finds and flags all sea areas which have at least one cell at a grid edge (i.e. does not flag 'inland...
char ** m_papszGDALRasterOptions
Options for GDAL when handling raster files.
Definition simulation.h:456
ofstream OutStream
The main output file stream.
double m_dDurationUnitsMult
Multiplier for duration units, to convert to hours.
Definition simulation.h:667
bool m_bFloodSWLSetupSurgeRunupLine
Are we saving the flood still water level setup surge runup line? TODO 007.
Definition simulation.h:445
unsigned long m_ulTotTimestep
The target number of iterations.
Definition simulation.h:621
bool m_bOutputParallelProfileData
Output parallel profile data?
Definition simulation.h:340
int nLandformToGrid(int const, int const)
At the end of each timestep, this routine stores the attributes from a single coastal landform object...
double m_dKamphuis
Transport parameter for the Kamphuis equation.
Definition simulation.h:846
vector< double > m_VdTSDeepWaterWaveStationAngle
Time series of wave orientation at deep water wave station.
static vector< string > * VstrSplit(string const *, char const, vector< string > *)
From http://stackoverflow.com/questions/236129/split-a-string-in-c They implement (approximately) Pyt...
Definition utils.cpp:2429
bool m_bOutputErosionPotentialData
Output erosion potential data?
Definition simulation.h:343
int m_nLevel
TODO 007 Used in WAVESETUP + SURGE + RUNUP.
Definition simulation.h:597
bool m_bSedimentInputThisIter
Do we have a sediment input event this iteration?
Definition simulation.h:409
bool m_bCliffNotchSave
Save cliff notch incision depth vector GIS files?
Definition simulation.h:287
bool m_bVectorWaveFloodLineSave
Are we saving the vector wave flood line? TODO 007.
Definition simulation.h:433
vector< string > m_VstrGDALIUSDriverCode
GDAL driver code for the initial unconsolidated sand sediment GIS data.
bool m_bWaveAngleSave
Save wave angle raster GIS files?
Definition simulation.h:115
void AppendPolygon(CGeomCoastPolygon *)
Appends a pointer to a coast polygon to the coast polygon vector.
Definition utils.cpp:2946
static double dCalcWaveAngleToCoastNormal(double const, double const, int const)
Calculates the angle between the wave direction and a normal to the coastline tangent....
bool m_bOmitSearchEastEdge
Omit the east edge of the grid from coast-end searches?
Definition simulation.h:358
vector< int > m_VEdgeCellEdge
The grid edge that each edge cell belongs to.
int m_nCoastSmoothWindow
The size of the window used for coast smoothing. Must be an odd number.
Definition simulation.h:474
double m_dThisIterLeftGridUnconsFine
Definition simulation.h:922
bool m_bLocalSlopeSave
Save local slope raster GIS files?
Definition simulation.h:179
This file contains global definitions for CoastalME.
int const SAVEMAX
Definition cme.h:462
int const NUMBER_OF_RNGS
Definition cme.h:461
Contains CGeomILine definitions.
Contains CGeomLine definitions.