CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
coast.cpp
Go to the documentation of this file.
1
12
13/* ===============================================================================================================================
14
15 This file is part of CoastalME, the Coastal Modelling Environment.
16
17 CoastalME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23===============================================================================================================================*/
24#include <assert.h>
25
26#include <vector>
27#include <algorithm>
28using std::sort;
29
30#include "cme.h"
31#include "simulation.h"
32#include "coast.h"
33#include "raster_grid.h"
34#include "line.h"
35#include "i_line.h"
36
49
52{
53 for (unsigned int i = 0; i < m_pVProfile.size(); i++)
54 delete m_pVProfile[i];
55
56 for (unsigned int i = 0; i < m_pVLandform.size(); i++)
57 delete m_pVLandform[i];
58}
59
62{
63 return m_pSim;
64}
65
67void CRWCoast::SetSeaHandedness(int const nNewHandedness)
68{
69 m_nSeaHandedness = nNewHandedness;
70}
71
74{
75 return m_nSeaHandedness;
76}
77
79void CRWCoast::SetStartEdge(int const nEdge)
80{
81 m_nStartEdge = nEdge;
82}
83
86{
87 return m_nStartEdge;
88}
89
91void CRWCoast::SetEndEdge(int const nEdge)
92{
93 m_nEndEdge = nEdge;
94}
95
97int CRWCoast::nGetEndEdge(void) const
98{
99 return m_nEndEdge;
100}
101
104{
105 m_LCoastlineExtCRS = * pLCoast;
106
107 int nLen = m_LCoastlineExtCRS.nGetSize();
108
109 m_VnPolygonNode = vector<int>(nLen, INT_NODATA);
110 m_VnBreakingDistance = vector<int>(nLen, INT_NODATA);
111
112 m_VdCurvatureDetailed = vector<double>(nLen, DBL_NODATA);
113 m_VdCurvatureSmooth = vector<double>(nLen, DBL_NODATA);
114 m_VdDeepWaterWaveHeight = vector<double>(nLen, DBL_NODATA);
115 m_VdDeepWaterWaveAngle = vector<double>(nLen, DBL_NODATA);
116 m_VdDeepWaterWavePeriod = vector<double>(nLen, DBL_NODATA);
117 m_VdBreakingWaveHeight = vector<double>(nLen, DBL_NODATA);
118 m_VdWaveSetupSurge = vector<double>(nLen, 0); // it is better to initiate with DBL_NODATA but some values are outside of range in the interpolation
119 // m_VdStormSurge = vector<double>(nLen, DBL_NODATA);
120 m_VdRunUp = vector<double>(nLen, 0);
121 m_VdCoastWaveHeight = vector<double>(nLen, DBL_NODATA);
122 m_VdBreakingWaveAngle = vector<double>(nLen, DBL_NODATA);
123 m_VdDepthOfBreaking = vector<double>(nLen, DBL_NODATA);
124 m_VdFluxOrientation = vector<double>(nLen, DBL_NODATA);
125 m_VdWaveEnergyAtBreaking = vector<double>(nLen, 0);
126}
127
128// void CRWCoast::SetFloodWaveSetupPointExtCRS(CGeomLine const* pLCoast)
129// {
130// m_LFloodWaveSetupExtCRS = *pLCoast;
131
132// // int nLen = m_LFloodWaveSetupLineExtCRS.nGetSize();
133// }
134
135// void CRWCoast::SetFloodWaveSetupSurgePointExtCRS(CGeomLine const* pLCoast)
136// {
137// m_LFloodWaveSetupSurgeExtCRS = *pLCoast;
138
139// // int nLen = m_LFloodWaveSetupSurgeLineExtCRS.nGetSize();
140// }
141
142// void CRWCoast::SetFloodWaveSetupSurgeRunupPointExtCRS(CGeomLine const* pLCoast)
143// {
144// m_LFloodWaveSetupSurgeRunupExtCRS = *pLCoast;
145
146// // int nLen = m_LFloodWaveSetupSurgeRunupLineExtCRS.nGetSize();
147// }
148
154
157{
158 // Point is in external CRS TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
159 return &m_LCoastlineExtCRS[n];
160}
161
162// CGeomLine*CRWCoast::pLGetFloodWaveSetupExtCRS(void)
163// {
164// return &m_LFloodWaveSetupExtCRS;
165// }
166
167// CGeom2DPoint*CRWCoast::pPtGetFloodWaveSetupPointExtCRS(int const n)
168// {
169// // Point is in external CRS TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
170// return &m_LFloodWaveSetupExtCRS[n];
171// }
172
173// CGeom2DPoint*CRWCoast::pPtGetFloodWaveSetupSurgePointExtCRS(int const n)
174// {
175// // Point is in external CRS TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
176// return &m_LFloodWaveSetupSurgeExtCRS[n];
177// }
178
179// CGeom2DPoint*CRWCoast::pPtGetFloodWaveSetupSurgeRunupPointExtCRS(int const n)
180// {
181// // Point is in external CRS TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
182// return &m_LFloodWaveSetupSurgeRunupExtCRS[n];
183// }
184
187{
188 return m_LCoastlineExtCRS.nGetSize();
189}
190
191// void CRWCoast::DisplayCoastline(void)
192// {
193// m_LCoastlineExtCRS.Display();
194// }
195
198{
199 m_ILCellsMarkedAsCoastline = * pILCoastCells;
200}
201
202// void CRWCoast::AppendCellMarkedAsCoastline(CGeom2DIPoint const* pPti)
203// {
204// m_ILCellsMarkedAsCoastline.Append(*pPti);
205// }
206//
207// void CRWCoast::AppendCellMarkedAsCoastline(int const nX, int const nY)
208// {
209// m_ILCellsMarkedAsCoastline.Append(CGeom2DIPoint(nX, nY));
210// }
211
214{
215 // TODO 055 No check to see if n < size()
217}
218
219// int CRWCoast::nGetNCellsMarkedAsCoastline(void) const
220// {
221// return m_ILCellsMarkedAsCoastline.size();
222// }
223
224// double CRWCoast::dGetCoastlineSegmentLength(int const m, int const n)
225// {
226// // TODO 055 No check to see that m is < m_LCoastlineExtCRS.Size(), same for n
227// if (m == n)
228// return 0;
229//
230// return hypot(m_LCoastlineExtCRS[n].dGetX() - m_LCoastlineExtCRS[m].dGetX(), m_LCoastlineExtCRS[n].dGetY() - m_LCoastlineExtCRS[m].dGetY());
231// }
232
233// double CRWCoast::dGetCoastlineLengthSoFar(int const n)
234// {
235// // TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
236// double dLen = 0;
237// for (int m = 0; m < n; m++)
238// dLen += dGetCoastlineSegmentLength(m, m+1);
239// return dLen;
240// }
241
244{
245 for (int nCoastPoint = 0; nCoastPoint < m_ILCellsMarkedAsCoastline.nGetSize(); nCoastPoint++)
246 {
247 if (m_ILCellsMarkedAsCoastline[nCoastPoint] == pPtiCell)
248 {
249 return nCoastPoint;
250 }
251 }
252
253 // This cell is not under a coastline, so try the adjacent cells
254 int n = -1;
255 int nX = pPtiCell->nGetX();
256 int nY = pPtiCell->nGetY();
257 int nXAdj = 0;
258 int nYAdj = 0;
259
260 while (n <= 7)
261 {
262 switch (++n)
263 {
264 case 0:
265 nXAdj = nX;
266 nYAdj = nY - 1;
267 break;
268
269 case 1:
270 nXAdj = nX + 1;
271 nYAdj = nY - 1;
272 break;
273
274 case 2:
275 nXAdj = nX + 1;
276 nYAdj = nY;
277 break;
278
279 case 3:
280 nXAdj = nX + 1;
281 nYAdj = nY + 1;
282 break;
283
284 case 4:
285 nXAdj = nX;
286 nYAdj = nY + 1;
287 break;
288
289 case 5:
290 nXAdj = nX - 1;
291 nYAdj = nY + 1;
292 break;
293
294 case 6:
295 nXAdj = nX - 1;
296 nYAdj = nY;
297 break;
298
299 case 7:
300 nXAdj = nX - 1;
301 nYAdj = nY - 1;
302 break;
303 }
304
305 CGeom2DIPoint PtiTmp(nXAdj, nYAdj);
306
307 for (int nCoastPoint = 0; nCoastPoint < m_ILCellsMarkedAsCoastline.nGetSize(); nCoastPoint++)
308 {
309 if (m_ILCellsMarkedAsCoastline[nCoastPoint] == &PtiTmp)
310 {
311 * pPtiCell = PtiTmp;
312 return nCoastPoint;
313 }
314 }
315 }
316
317 return INT_NODATA;
318}
319
321double CRWCoast::dGetDetailedCurvature(int const nCoastPoint) const
322{
323 // TODO 055 No sanity check for nCoastPoint < m_VdCurvatureDetailed.Size()
324 return m_VdCurvatureDetailed[nCoastPoint];
325}
326
328void CRWCoast::SetDetailedCurvature(int const nCoastPoint, double const dCurvature)
329{
330 // TODO 055 No check to see if nCoastPoint < m_VdCurvatureDetailed.size()
331 m_VdCurvatureDetailed[nCoastPoint] = dCurvature;
332}
333
336{
337 return &m_VdCurvatureDetailed;
338}
339
341double CRWCoast::dGetSmoothCurvature(int const nCoastPoint) const
342{
343 // TODO 055 No sanity check for nCoastPoint < m_VdCurvatureSmooth.Size()
344 return m_VdCurvatureSmooth[nCoastPoint];
345}
346
348void CRWCoast::SetSmoothCurvature(int const nCoastPoint, double const dCurvature)
349{
350 // TODO 055 No check to see if nCoastPoint < m_VdCurvatureSmooth.size()
351 m_VdCurvatureSmooth[nCoastPoint] = dCurvature;
352}
353
356{
357 return &m_VdCurvatureSmooth;
358}
359
362{
364}
365
366// //! Gets the mean of the coast's detailed curvature
367// double CRWCoast::dGetDetailedCurvatureMean(void) const
368// {
369// return m_dCurvatureDetailedMean;
370// }
371
374{
376}
377
378// //! Gets the standard deviation of the coast's detailed curvature
379// double CRWCoast::dGetDetailedCurvatureSTD(void) const
380// {
381// return m_dCurvatureDetailedSTD;
382// }
383
385void CRWCoast::SetSmoothCurvatureMean(double const dMean)
386{
388}
389
392{
394}
395
397void CRWCoast::SetSmoothCurvatureSTD(double const dSTD)
398{
400}
401
404{
406}
407
410{
411 // TODO 055 Maybe add a safety check? that nProfile < m_pVProfile.size()
412 return m_pVProfile[nProfile];
413}
414
417{
418 // TODO 055 Maybe add a safety check? that nProfile < m_pVProfile.size()
419 return m_pVProfile.back();
420}
421
424{
425 m_pVProfile.push_back(pProfile);
426}
427
428// void CRWCoast::ReplaceProfile(int const nProfile, vector<CGeom2DPoint> const* pPtVProfileNew)
429// {
430// // TODO 055 Maybe add a safety check? that nProfile < m_pVProfile.size()
431// m_pVProfile[nProfile].SetPointsInProfile(pPtVProfileNew);
432// }
433
436{
437 return static_cast<int>(m_pVProfile.size());
438}
439
442{
443 for (int n = 0; n < static_cast<int>(m_pVNormalProfileDownAllCoastpointSeq.size()); n++)
444 {
447 }
448}
449
452{
453 // Note no check whether n < size()
454 return m_pVProfileDownCoastSeq[nProf];
455}
456
459{
460 // Note no check whether n < size()
461 int nSize = static_cast<int>(m_pVProfileDownCoastSeq.size());
462 return m_pVProfileDownCoastSeq[nSize - (nProf + 1)];
463}
464
470
473{
474 CGeomProfile* pDownCoastProfile = pProfile->pGetDownCoastAdjacentProfile();
475
476 if ((pDownCoastProfile != NULL) && (pDownCoastProfile->bEndOfCoast()))
477 return NULL;
478
479 return pDownCoastProfile;
480}
481
484{
485 return pProfile->pGetUpCoastAdjacentProfile();
486}
487
489void CRWCoast::SetCoastDeepWaterWaveHeight(int const nCoastPoint, double const dHeight)
490{
491 // TODO 055 No check to see if nCoastPoint < m_VdDeepWaterWaveHeight.size()
492 m_VdDeepWaterWaveHeight[nCoastPoint] = dHeight;
493}
494
495// //! Gets the deep water wave height for this coast point
496// double CRWCoast::dGetCoastDeepWaterWaveHeight(int const nCoastPoint) const
497// {
498// // TODO 055 No check to see if nCoastPoint < m_VdDeepWaterWaveHeight.size()
499// return m_VdDeepWaterWaveHeight[nCoastPoint];
500// }
501
503void CRWCoast::SetCoastDeepWaterWaveAngle(int const nCoastPoint, double const dOrientation)
504{
505 // TODO 055 No check to see if nCoastPoint < m_VdDeepWaterWaveAngle.size()
506 m_VdDeepWaterWaveAngle[nCoastPoint] = dOrientation;
507}
508
510double CRWCoast::dGetCoastDeepWaterWaveAngle(int const nCoastPoint) const
511{
512 // TODO 055 No check to see if nCoastPoint < m_VdDeepWaterWaveAngle.size()
513 return m_VdDeepWaterWaveAngle[nCoastPoint];
514}
515
517void CRWCoast::SetCoastDeepWaterWavePeriod(int const nCoastPoint, double const dPeriod)
518{
519 m_VdDeepWaterWavePeriod[nCoastPoint] = dPeriod;
520}
521
523double CRWCoast::dGetCoastDeepWaterWavePeriod(int const nCoastPoint) const
524{
525 return m_VdDeepWaterWavePeriod[nCoastPoint];
526}
527
529void CRWCoast::SetBreakingWaveHeight(int const nCoastPoint, double const dHeight)
530{
531 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveHeight.size()
532 m_VdBreakingWaveHeight[nCoastPoint] = dHeight;
533}
534
536double CRWCoast::dGetBreakingWaveHeight(int const nCoastPoint) const
537{
538 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveHeight.size()
539 return m_VdBreakingWaveHeight[nCoastPoint];
540}
541
543void CRWCoast::SetWaveSetupSurge(int const nCoastPoint, double const dWaveSetup)
544{
545 m_VdWaveSetupSurge[nCoastPoint] = dWaveSetup;
546}
547
549double CRWCoast::dGetWaveSetupSurge(int const nCoastPoint) const
550{
551 return m_VdWaveSetupSurge[nCoastPoint];
552}
553
554// void CRWCoast::SetStormSurge(int const nCoastPoint, double const dStormSurge)
555// {
556// m_VdStormSurge[nCoastPoint] = dStormSurge;
557// }
558
559// double CRWCoast::dGetStormSurge(int const nCoastPoint) const
560// {
561// return m_VdStormSurge[nCoastPoint];
562// }
563
565void CRWCoast::SetRunUp(int const nCoastPoint, double const dRunUp)
566{
567 m_VdRunUp[nCoastPoint] = dRunUp;
568}
569
571double CRWCoast::dGetRunUp(int const nCoastPoint) const
572{
573 return m_VdRunUp[nCoastPoint];
574}
575
577double CRWCoast::dGetLevel(int const nCoastPoint, int const level) const
578{
579 switch (level)
580 {
581 case 0: // WAVESETUPSURGE:
582 return m_VdWaveSetupSurge[nCoastPoint];
583 break;
584
585 case 1: // WAVESETUPSURGE + RUNUP:
586 return m_VdWaveSetupSurge[nCoastPoint] + m_VdRunUp[nCoastPoint];
587 break;
588
589 default:
590 return 0;
591 }
592}
593
595void CRWCoast::SetCoastWaveHeight(int const nCoastPoint, double const dHeight)
596{
597 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveHeight.size()
598 m_VdCoastWaveHeight[nCoastPoint] = dHeight;
599}
600
602double CRWCoast::dGetCoastWaveHeight(int const nCoastPoint) const
603{
604 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveHeight.size()
605 return m_VdCoastWaveHeight[nCoastPoint];
606}
607
609void CRWCoast::SetBreakingWaveAngle(int const nCoastPoint, double const dOrientation)
610{
611 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveAngle.size()
612 m_VdBreakingWaveAngle[nCoastPoint] = dOrientation;
613}
614
616double CRWCoast::dGetBreakingWaveAngle(int const nCoastPoint) const
617{
618 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveAngle.size()
619 return m_VdBreakingWaveAngle[nCoastPoint];
620}
621
623void CRWCoast::SetDepthOfBreaking(int const nCoastPoint, double const dDepth)
624{
625 // TODO 055 No check to see if nCoastPoint < m_VdDepthOfBreaking.size()
626 m_VdDepthOfBreaking[nCoastPoint] = dDepth;
627}
628
630double CRWCoast::dGetDepthOfBreaking(int const nCoastPoint) const
631{
632 // TODO 055 No check to see if nCoastPoint < m_VdDepthOfBreaking.size()
633 return m_VdDepthOfBreaking[nCoastPoint];
634}
635
637void CRWCoast::SetBreakingDistance(int const nCoastPoint, int const nDist)
638{
639 // TODO 055 No check to see if nCoastPoint < m_VnBreakingDistance.size()
640 m_VnBreakingDistance[nCoastPoint] = nDist;
641}
642
644int CRWCoast::nGetBreakingDistance(int const nCoastPoint) const
645{
646 // TODO 055 No check to see if nCoastPoint < m_VnBreakingDistance.size()
647 return m_VnBreakingDistance[nCoastPoint];
648}
649
651void CRWCoast::SetFluxOrientation(int const nCoastPoint, double const dOrientation)
652{
653 // TODO 055 No check to see if nCoastPoint < m_VdFluxOrientation.size()
654 m_VdFluxOrientation[nCoastPoint] = dOrientation;
655}
656
658double CRWCoast::dGetFluxOrientation(int const nCoastPoint) const
659{
660 // TODO 055 No check to see if nCoastPoint < m_VdFluxOrientation.size()
661 return m_VdFluxOrientation[nCoastPoint];
662}
663
665void CRWCoast::SetWaveEnergyAtBreaking(int const nCoastPoint, double const dEnergy)
666{
667 // TODO 055 No check to see if nCoastPoint < m_VdWaveEnergyAtBreaking.size()
668 // assert(isfinite(dEnergy));
669 m_VdWaveEnergyAtBreaking[nCoastPoint] = dEnergy;
670}
671
673double CRWCoast::dGetWaveEnergyAtBreaking(int const nCoastPoint) const
674{
675 // TODO 055 No check to see if nCoastPoint < m_VdWaveEnergyAtBreaking.size()
676 // assert(isfinite(m_VdWaveEnergyAtBreaking[nCoastPoint]));
677 return m_VdWaveEnergyAtBreaking[nCoastPoint];
678}
679
685
688{
689 for (int n = 0; n < static_cast<int>(m_pVProfile.size()); n++)
690 {
691 int nCoastPoint = m_pVProfile[n]->nGetCoastPoint();
692
693 // Note no check to see whether nCoastPoint < m_pVNormalProfileDownAllCoastpointSeq.size()
695 }
696}
697
699void CRWCoast::SetProfileAtCoastPoint(int const nCoastPoint, CGeomProfile* const pProfile)
700{
701 // Note no check to see whether nCoastPoint < m_pVNormalProfileDownAllCoastpointSeq.size()
702 m_pVNormalProfileDownAllCoastpointSeq.at(nCoastPoint) = pProfile;
703}
704
706bool CRWCoast::bIsProfileAtCoastPoint(int const nCoastPoint) const
707{
708 if (m_pVNormalProfileDownAllCoastpointSeq.at(nCoastPoint) == NULL)
709 return false;
710
711 return true;
712}
713
716{
717 return m_pVNormalProfileDownAllCoastpointSeq[nCoastPoint];
718}
719
722{
723 m_pVLandform.push_back(pCoastLandform);
724}
725
728{
729 if (nCoastPoint < static_cast<int>(m_pVLandform.size()))
730 return m_pVLandform[nCoastPoint];
731
732 return NULL;
733}
734
736void CRWCoast::SetPolygonNode(int const nPoint, int const nNode)
737{
738 // TODO 055 No check to see if nPoint < m_VnPolygonNode.size()
739 m_VnPolygonNode[nPoint] = nNode;
740}
741
743int CRWCoast::nGetPolygonNode(int const nPoint) const
744{
745 // TODO 055 No check to see if nPoint < m_VnPolygonNode.size()
746 return m_VnPolygonNode[nPoint];
747}
748
750CGeomCoastPolygon* CRWCoast::pPolyCreatePolygon(int const nGlobalID, int const nCoastID, int const nCoastPoint, CGeom2DIPoint const* pPtiNode, CGeom2DIPoint const* pPtiAntiNode, int const nProfileUpCoast, int const nProfileDownCoast, vector<CGeom2DPoint> const* pVIn, int const nNumPointsUpCoastProfile, int const nNumPointsDownCoastProfile, bool const bStartCoast, bool const bEndCoast)
751{
752 CGeomCoastPolygon* pPolygon = new CGeomCoastPolygon(nGlobalID, nCoastID, nCoastPoint, nProfileUpCoast, nProfileDownCoast, pVIn, nNumPointsUpCoastProfile, nNumPointsDownCoastProfile, pPtiNode, pPtiAntiNode, bStartCoast, bEndCoast);
753
754 return pPolygon;
755}
756
759{
760 return pGetSim()->nGetCoastPolygonSize();
761}
762
765{
766 // TODO 055 No check to see if nPoint < m_VnPolygon.size()
767 return pGetSim()->pGetPolygon(nPoly);
768}
769
770// //! Appends to coast polygon length
771// void CRWCoast::AppendPolygonLength(const double dLength)
772// {
773// m_VdPolygonLength.push_back(dLength);
774// }
775//
776// //! Gets coast polygon length
777// double CRWCoast::dGetPolygonLength(int const nIndex) const
778// {
779// // TODO 055 No check to see if nIndex < m_VdPolygonLength.size()
780// return m_VdPolygonLength[nIndex];
781// }
782
785{
786 return static_cast<int>(m_LShadowBoundary.size());
787}
788
791{
792 m_LShadowBoundary.push_back(*pLBoundary);
793}
794
797{
798 // TODO 055 No check to see if n < m_LShadowBoundary.size()
799 return &m_LShadowBoundary[n];
800}
801
804{
805 return static_cast<int>(m_LShadowDowndriftBoundary.size());
806}
807
810{
811 m_LShadowDowndriftBoundary.push_back(*pLBoundary);
812}
813
816{
817 // TODO 055 No check to see if n < m_LShadowDowndriftBoundary.size()
819}
Abstract class, used as a base class for landform objects on the coastline.
Geometry class used to represent 2D point objects with integer coordinates.
Definition 2di_point.h:29
int nGetY(void) const
Returns the CGeom2DIPoint object's integer Y coordinate.
Definition 2di_point.cpp:48
int nGetX(void) const
Returns the CGeom2DIPoint object's integer X coordinate.
Definition 2di_point.cpp:42
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 integer line objects.
Definition i_line.h:31
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
CGeomProfile * pGetUpCoastAdjacentProfile(void) const
Definition profile.cpp:460
CGeomProfile * pGetDownCoastAdjacentProfile(void) const
Definition profile.cpp:470
bool bEndOfCoast(void) const
Returns the switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:121
void SetStartEdge(int const)
Sets the coast's start edge.
Definition coast.cpp:79
double dGetBreakingWaveAngle(int const) const
Gets the breaking wave angle for this coast point.
Definition coast.cpp:616
void AppendShadowBoundary(CGeomLine const *)
Appends a shadow boundary to this coast.
Definition coast.cpp:790
vector< CGeomProfile * > m_pVProfile
Coast-normal profile objects, in sequence of creation (which is the same as nGetCoastID() sequence)
Definition coast.h:140
void SetCoastDeepWaterWavePeriod(int const, double const)
Sets the deep water wave period for this coast point.
Definition coast.cpp:517
void SetCoastDeepWaterWaveAngle(int const, double const)
Sets the deep water wave angle for this coast point.
Definition coast.cpp:503
int nGetNumShadowDowndriftBoundaries(void) const
Returns the number of shadow zone downdrift boundaries on this coast.
Definition coast.cpp:803
CGeom2DIPoint * pPtiGetCellMarkedAsCoastline(int const)
Returns the coordinates (grid CRS) of the cells marked as coastline.
Definition coast.cpp:213
vector< double > m_VdBreakingWaveHeight
The breaking wave height on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:105
void SetBreakingDistance(int const, int const)
Sets the breaking distance for this coast point.
Definition coast.cpp:637
vector< double > m_VdRunUp
The run-up on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:114
double dGetDetailedCurvature(int const) const
Returns the detailed curvature for a coast point.
Definition coast.cpp:321
double dGetSmoothCurvatureMean(void) const
Gets the mean of the coast's smoothed curvature.
Definition coast.cpp:391
CRWCoast(CSimulation *)
Constructor with initialization list.
Definition coast.cpp:38
bool bIsProfileAtCoastPoint(int const) const
Returns true if there is a coastline-normal profile at this coast point, false otherwise.
Definition coast.cpp:706
void SetSmoothCurvatureSTD(double const)
Sets the standard deviation of the coast's smoothed curvature.
Definition coast.cpp:397
vector< double > m_VdWaveSetupSurge
The wave setup on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:108
CGeomCoastPolygon * pPolyCreatePolygon(int const, int const, int const, CGeom2DIPoint const *, CGeom2DIPoint const *, int const, int const, vector< CGeom2DPoint > const *, int const, int const, bool const, bool const)
Creates a coast polygon and returns a pointer to it.
Definition coast.cpp:750
double dGetSmoothCurvatureSTD(void) const
Gets the standard deviation of the coast's smoothed curvature.
Definition coast.cpp:403
int nGetEndEdge(void) const
Gets the coast's end edge.
Definition coast.cpp:97
CGeomProfile * pGetDownCoastProfile(CGeomProfile const *pProfile)
Returns a pointer to the profile which is adjacent to and down-coast from the given profile pointer....
Definition coast.cpp:466
void SetDepthOfBreaking(int const, double const)
Sets the depth of breaking for this coast point.
Definition coast.cpp:623
void SetSmoothCurvatureMean(double const)
Sets the mean of the coast's smoothed curvature.
Definition coast.cpp:385
vector< int > m_VnBreakingDistance
Distance of breaking (in cells), at each point on m_LCoastlineExtCRS.
Definition coast.h:84
double dGetBreakingWaveHeight(int const) const
Gets the breaking wave height for this coast point.
Definition coast.cpp:536
CSimulation * pGetSim(void) const
Returns a pointer to the simulation object.
Definition coast.cpp:61
void SetFluxOrientation(int const, double const)
Sets the flux orientation for this coast point.
Definition coast.cpp:651
CGeomCoastPolygon * pGetPolygon(int const) const
Returns a pointer to a coast polygon, specified by down-coast (i.e. along the coast in the direction ...
Definition coast.cpp:764
CGeomLine m_LCoastlineExtCRS
Smoothed line of points (external CRS) giving the plan view of the vector coast.
Definition coast.h:67
void AppendProfile(CGeomProfile *)
Appenda a coastline-normal profile.
Definition coast.cpp:423
int m_nEndEdge
The edge at which the coast ends.
Definition coast.h:49
CACoastLandform * pGetCoastLandform(int const)
Returns the coastal landform for a given coast point, or NULL if there is no coast landform here.
Definition coast.cpp:727
double m_dCurvatureSmoothSTD
The standard deviaton of the coast's smoothed curvature.
Definition coast.h:61
void SetWaveSetupSurge(int const, double const)
Sets the wave setup surge for this coast point.
Definition coast.cpp:543
vector< double > m_VdWaveEnergyAtBreaking
Wave energy at each point on m_LCoastlineExtCRS.
Definition coast.h:129
CGeomLine * pGetShadowDowndriftBoundary(int const)
Returns a pointer to a shadow zone downdrift boundary.
Definition coast.cpp:815
int m_nStartEdge
The edge from which the coast starts.
Definition coast.h:46
CGeomProfile * pGetUpCoastProfile(CGeomProfile const *pProfile)
Returns a pointer to the profile which is adjacent to and up-coast from the specified profile....
Definition coast.cpp:483
CGeomLine * pLGetCoastlineExtCRS(void)
Returns the coastline (external CRS)
Definition coast.cpp:150
vector< CACoastLandform * > m_pVLandform
Pointer to a coastal landform object, at each point on the coastline.
Definition coast.h:132
void SetCoastlineGridCRS(CGeomILine const *)
Sets the coordinates (grid CRS) of the cells marked as coastline.
Definition coast.cpp:197
double dGetWaveEnergyAtBreaking(int const) const
Gets the wave energy at breaking for this coast point.
Definition coast.cpp:673
double dGetDepthOfBreaking(int const) const
Gets the depth of breaking for this coast point.
Definition coast.cpp:630
int nGetCoastPointGivenCell(CGeom2DIPoint *)
Returns the coastline number given a cell, or INT_NODATA if neither this cell or any of its neighbour...
Definition coast.cpp:243
int nGetNumShadowBoundaries(void) const
Returns the number of shadow boundaries on this coast.
Definition coast.cpp:784
int nGetSeaHandedness(void) const
Gers the handedness of the coast.
Definition coast.cpp:73
vector< double > m_VdDeepWaterWaveAngle
The deep water wave orientation at the end of a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:99
vector< CGeomLine > m_LShadowBoundary
Lines which comprise the edge of a shadow zone, ext CRS.
Definition coast.h:146
vector< double > m_VdDeepWaterWavePeriod
The deep water wave period at the end of a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:102
CSimulation * m_pSim
A pointer to the CSimulation object.
Definition coast.h:64
vector< CGeomProfile * > m_pVProfileDownCoastSeq
Pointers to coastline-normal objects, in along-coastline sequence.
Definition coast.h:143
int nGetNumProfiles(void) const
Returns the number of profiles on this coast.
Definition coast.cpp:435
double dGetRunUp(int const) const
Gets the wave runup for this coast point.
Definition coast.cpp:571
CGeomProfile * pGetProfile(int const)
Returns a pointer to a profile, in polygon-ID number sequence.
Definition coast.cpp:409
CGeomLine * pGetShadowBoundary(int const)
Returns a pointer to a shadow boundary.
Definition coast.cpp:796
int nGetCoastlineSize(void) const
Gets the size of the coastline.
Definition coast.cpp:186
~CRWCoast(void)
Destructor.
Definition coast.cpp:51
void SetCoastlineExtCRS(CGeomLine const *)
Given the vector line of a coast, this initializes coastline values (curvature, breaking wave height,...
Definition coast.cpp:103
void SetRunUp(int const, double const)
Sets the wave runup for this coast point.
Definition coast.cpp:565
vector< double > m_VdBreakingWaveAngle
The breaking wave orientation on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:120
CGeomProfile * pGetProfileWithUpCoastSeq(int const) const
Returns a pointer to a coastline-normal profile in up-coast sequence.
Definition coast.cpp:458
vector< double > m_VdCurvatureDetailed
Detailed curvature at each point on m_LCoastlineExtCRS.
Definition coast.h:90
void SetDetailedCurvatureMean(double const)
Sets the mean of the coast's detailed curvature.
Definition coast.cpp:361
void SetBreakingWaveHeight(int const, double const)
Sets the breaking wave height for this coast point.
Definition coast.cpp:529
int nGetStartEdge(void) const
Gets the coast's start edge.
Definition coast.cpp:85
void SetPolygonNode(int const, int const)
Sets a coast polygon node.
Definition coast.cpp:736
void SetDetailedCurvatureSTD(double const)
Sets the standard deviation of the coast's detailed curvature.
Definition coast.cpp:373
CGeom2DPoint * pPtGetCoastlinePointExtCRS(int const)
Returns a given coast point in external CRS.
Definition coast.cpp:156
int nGetPolygonNode(int const) const
Gets a coast polygon node.
Definition coast.cpp:743
double m_dCurvatureSmoothMean
The mean of the coast's smoothed curvature.
Definition coast.h:58
void SetBreakingWaveAngle(int const, double const)
Sets the breaking wave angle for this coast point.
Definition coast.cpp:609
vector< double > m_VdCoastWaveHeight
The wave height at coast point on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:117
vector< double > m_VdDeepWaterWaveHeight
The deep water wave height at the end of a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:96
void SetProfileAtCoastPoint(int const, CGeomProfile *const)
Sets a pointer to a coast-normal profile at a given coastline point.
Definition coast.cpp:699
int nGetBreakingDistance(int const) const
Gets the breaking distance for this coast point.
Definition coast.cpp:644
void SetSmoothCurvature(int const, double const)
Sets the smoothed curvature for a coast point.
Definition coast.cpp:348
vector< double > m_VdDepthOfBreaking
The depth of breaking on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:123
void AppendCoastLandform(CACoastLandform *)
Appends a coastal landform to this coast.
Definition coast.cpp:721
double m_dCurvatureDetailedSTD
The standard deviation of the coast's detailed curvature.
Definition coast.h:55
vector< double > * pVGetSmoothCurvature(void)
Returns a pointer to a vector of smoothed curvature for all coast points.
Definition coast.cpp:355
void InsertProfilesInProfileCoastPointIndex(void)
Inserts profiles at coastline points in the profile-coastline-point index.
Definition coast.cpp:687
void AppendShadowDowndriftBoundary(CGeomLine const *)
Appends a shadow zone downdrift boundary.
Definition coast.cpp:809
double dGetFluxOrientation(int const) const
Gets the flux orientation for this coast point.
Definition coast.cpp:658
double dGetCoastDeepWaterWavePeriod(int const) const
Gets the deep water wave period for this coast point.
Definition coast.cpp:523
void SetCoastDeepWaterWaveHeight(int const, double const)
Sets the deep water wave height for this coast point.
Definition coast.cpp:489
vector< CGeomProfile * > m_pVNormalProfileDownAllCoastpointSeq
Pointers to coast-normal profile objects, one for each point on the coastline (is null for most coast...
Definition coast.h:135
void SetSeaHandedness(int const)
Sets the handedness of the coast.
Definition coast.cpp:67
vector< double > m_VdCurvatureSmooth
Smoothed curvature at each point on m_LCoastlineExtCRS.
Definition coast.h:93
int m_nSeaHandedness
Direction of the sea from the coastline, travelling down-coast (i.e. in direction of increasing coast...
Definition coast.h:43
CGeomProfile * pGetLastProfile(void)
Returns a pointer to the last profile, in polygon-ID number sequence.
Definition coast.cpp:416
double dGetSmoothCurvature(int const) const
Returns the smoothed curvature for a coast point.
Definition coast.cpp:341
CGeomILine m_ILCellsMarkedAsCoastline
Unsmoothed integer x-y coordinates (grid CRS) of the cell marked as coastline for each point on the v...
Definition coast.h:81
vector< double > * pVGetDetailedCurvature(void)
Returns a pointer to a vector of detailed curvature for all coast points.
Definition coast.cpp:335
vector< int > m_VnPolygonNode
At every point on m_LCoastlineExtCRS: INT_NODATA if no nodepoint there, otherwise the node (point of ...
Definition coast.h:87
void SetWaveEnergyAtBreaking(int const, double const)
Sets the wave energy at breaking for this coast point.
Definition coast.cpp:665
double m_dCurvatureDetailedMean
The mean of the coast's detailed curvature.
Definition coast.h:52
CGeomProfile * pGetProfileWithDownCoastSeq(int const) const
Returns a pointer to a coastline-normal profile in down-coast (i.e. along the coast in the direction ...
Definition coast.cpp:451
double dGetCoastWaveHeight(int const) const
Gets the coast wave height for this coast point.
Definition coast.cpp:602
CGeomProfile * pGetProfileAtCoastPoint(int const) const
Returns a pointer to the coastline-normal profile at this coast point.
Definition coast.cpp:715
void CreateProfileDownCoastIndex(void)
Creates an index to profiles in down-coast (i.e. along the coast in the direction of increasing coast...
Definition coast.cpp:441
void CreateProfilesAtCoastPoints(void)
Creates a vector which holds, for each coastline point, a null pointer to a coastline-normal profile ...
Definition coast.cpp:681
void SetEndEdge(int const)
Sets the coast's end edge.
Definition coast.cpp:91
double dGetWaveSetupSurge(int const) const
Gets the wave setup surge for this coast point.
Definition coast.cpp:549
CGeomProfile * pGetDownCoastProfileNotIncLastProfile(CGeomProfile const *pProfile)
Returns a pointer to the profile which is adjacent to and down-coast from the specified profile; howe...
Definition coast.cpp:472
vector< double > m_VdFluxOrientation
As in the COVE model, this is the orientation alongshore energy/sediment movement; a +ve flux is in d...
Definition coast.h:126
int nGetNumPolygons(void) const
Returns the number of coast polygons.
Definition coast.cpp:758
void SetCoastWaveHeight(int const, double const)
Sets the coast wave height for this coast point.
Definition coast.cpp:595
void SetDetailedCurvature(int const, double const)
Sets the detailed curvature for a coast point.
Definition coast.cpp:328
double dGetLevel(int const, int const) const
Sets the wave level for this coast point.
Definition coast.cpp:577
vector< CGeomLine > m_LShadowDowndriftBoundary
Lines which comprise the edge of a downdrift zone, ext CRS.
Definition coast.h:149
double dGetCoastDeepWaterWaveAngle(int const) const
Gets the deep water wave angle for this coast point.
Definition coast.cpp:510
This class runs CoastalME simulations.
Definition simulation.h:73
CGeomCoastPolygon * pGetPolygon(int const) const
Returns a pointer to a coast polygon, in down-coast sequence.
Definition utils.cpp:2937
int nGetCoastPolygonSize(void) const
Returns the size of the coast polygon vector.
Definition utils.cpp:2929
This file contains global definitions for CoastalME.
int const INT_NODATA
Definition cme.h:474
int const NULL_HANDED
Definition cme.h:508
double const DBL_NODATA
Definition cme.h:822
Contains CRWCoast definitions.
Contains CGeomILine definitions.
Contains CGeomLine definitions.
Contains CGeomRasterGrid definitions.
Contains CSimulation definitions.