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 <cstdio>
27
28#include <vector>
29using std::vector;
30
31#include "cme.h"
32#include "simulation.h"
33#include "coast.h"
34#include "raster_grid.h"
35#include "2d_point.h"
36#include "2di_point.h"
37#include "line.h"
38#include "i_line.h"
39
52
55{
56 for (unsigned int i = 0; i < m_pVProfile.size(); i++)
57 delete m_pVProfile[i];
58
59 for (unsigned int i = 0; i < m_pVLandform.size(); i++)
60 delete m_pVLandform[i];
61}
62
65{
66 return m_pSim;
67}
68
70void CRWCoast::SetSeaHandedness(int const nNewHandedness)
71{
72 m_nSeaHandedness = nNewHandedness;
73}
74
77{
78 return m_nSeaHandedness;
79}
80
82void CRWCoast::SetStartEdge(int const nEdge)
83{
84 m_nStartEdge = nEdge;
85}
86
89{
90 return m_nStartEdge;
91}
92
94void CRWCoast::SetEndEdge(int const nEdge)
95{
96 m_nEndEdge = nEdge;
97}
98
101{
102 return m_nEndEdge;
103}
104
107{
108 m_LCoastlineExtCRS = *pLCoast;
109
110 int const nLen = m_LCoastlineExtCRS.nGetSize();
111
112 m_VnPolygonNode = vector<int>(nLen, INT_NODATA);
113 m_VnBreakingDistance = vector<int>(nLen, INT_NODATA);
114
115 m_VdCurvatureDetailed = vector<double>(nLen, DBL_NODATA);
116 m_VdCurvatureSmooth = vector<double>(nLen, DBL_NODATA);
117 m_VdDeepWaterWaveHeight = vector<double>(nLen, DBL_NODATA);
118 m_VdDeepWaterWaveAngle = vector<double>(nLen, DBL_NODATA);
119 m_VdDeepWaterWavePeriod = vector<double>(nLen, DBL_NODATA);
120 m_VdBreakingWaveHeight = vector<double>(nLen, DBL_NODATA);
121 m_VdWaveSetupSurge = vector<double>(nLen, 0); // it is better to initiate with DBL_NODATA but some values are outside of range in the interpolation
122 // m_VdStormSurge = vector<double>(nLen, DBL_NODATA);
123 m_VdRunUp = vector<double>(nLen, 0);
124 m_VdCoastWaveHeight = vector<double>(nLen, DBL_NODATA);
125 m_VdBreakingWaveAngle = vector<double>(nLen, DBL_NODATA);
126 m_VdDepthOfBreaking = vector<double>(nLen, DBL_NODATA);
127 m_VdFluxOrientation = vector<double>(nLen, DBL_NODATA);
128 m_VdWaveEnergyAtBreaking = vector<double>(nLen, 0);
129}
130
131// void CRWCoast::SetFloodWaveSetupPointExtCRS(CGeomLine const* pLCoast)
132// {
133// m_LFloodWaveSetupExtCRS = *pLCoast;
134
135// // int nLen = m_LFloodWaveSetupLineExtCRS.nGetSize();
136// }
137
138// void CRWCoast::SetFloodWaveSetupSurgePointExtCRS(CGeomLine const* pLCoast)
139// {
140// m_LFloodWaveSetupSurgeExtCRS = *pLCoast;
141
142// // int nLen = m_LFloodWaveSetupSurgeLineExtCRS.nGetSize();
143// }
144
145// void CRWCoast::SetFloodWaveSetupSurgeRunupPointExtCRS(CGeomLine const* pLCoast)
146// {
147// m_LFloodWaveSetupSurgeRunupExtCRS = *pLCoast;
148
149// // int nLen = m_LFloodWaveSetupSurgeRunupLineExtCRS.nGetSize();
150// }
151
157
160{
161 // Point is in external CRS TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
162 return &m_LCoastlineExtCRS[n];
163}
164
165// CGeomLine*CRWCoast::pLGetFloodWaveSetupExtCRS(void)
166// {
167// return &m_LFloodWaveSetupExtCRS;
168// }
169
170// CGeom2DPoint*CRWCoast::pPtGetFloodWaveSetupPointExtCRS(int const n)
171// {
172// // Point is in external CRS TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
173// return &m_LFloodWaveSetupExtCRS[n];
174// }
175
176// CGeom2DPoint*CRWCoast::pPtGetFloodWaveSetupSurgePointExtCRS(int const n)
177// {
178// // Point is in external CRS TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
179// return &m_LFloodWaveSetupSurgeExtCRS[n];
180// }
181
182// CGeom2DPoint*CRWCoast::pPtGetFloodWaveSetupSurgeRunupPointExtCRS(int const n)
183// {
184// // Point is in external CRS TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
185// return &m_LFloodWaveSetupSurgeRunupExtCRS[n];
186// }
187
190{
191 return m_LCoastlineExtCRS.nGetSize();
192}
193
194// void CRWCoast::DisplayCoastline(void)
195// {
196// m_LCoastlineExtCRS.Display();
197// }
198
201{
202 m_ILCellsMarkedAsCoastline = *pILCoastCells;
203}
204
205// void CRWCoast::AppendCellMarkedAsCoastline(CGeom2DIPoint const* pPti)
206// {
207// m_ILCellsMarkedAsCoastline.Append(*pPti);
208// }
209//
210// void CRWCoast::AppendCellMarkedAsCoastline(int const nX, int const nY)
211// {
212// m_ILCellsMarkedAsCoastline.Append(CGeom2DIPoint(nX, nY));
213// }
214
217{
218 // TODO 055 No check to see if n < size()
220}
221
222// int CRWCoast::nGetNCellsMarkedAsCoastline(void) const
223// {
224// return m_ILCellsMarkedAsCoastline.size();
225// }
226
227// double CRWCoast::dGetCoastlineSegmentLength(int const m, int const n)
228// {
229// // TODO 055 No check to see that m is < m_LCoastlineExtCRS.Size(), same for n
230// if (m == n)
231// return 0;
232//
233// return hypot(m_LCoastlineExtCRS[n].dGetX() - m_LCoastlineExtCRS[m].dGetX(), m_LCoastlineExtCRS[n].dGetY() - m_LCoastlineExtCRS[m].dGetY());
234// }
235
236// double CRWCoast::dGetCoastlineLengthSoFar(int const n)
237// {
238// // TODO 055 No check to see that n is < m_LCoastlineExtCRS.Size()
239// double dLen = 0;
240// for (int m = 0; m < n; m++)
241// dLen += dGetCoastlineSegmentLength(m, m+1);
242// return dLen;
243// }
244
247{
248 for (int nCoastPoint = 0; nCoastPoint < m_ILCellsMarkedAsCoastline.nGetSize(); nCoastPoint++)
249 {
250 if (m_ILCellsMarkedAsCoastline[nCoastPoint] == pPtiCell)
251 {
252 return nCoastPoint;
253 }
254 }
255
256 // This cell is not under a coastline, so try the adjacent cells
257 int n = -1;
258 int const nX = pPtiCell->nGetX();
259 int const nY = pPtiCell->nGetY();
260 int nXAdj = 0;
261 int nYAdj = 0;
262
263 while (n <= 7)
264 {
265 switch (++n)
266 {
267 case 0:
268 nXAdj = nX;
269 nYAdj = nY - 1;
270 break;
271
272 case 1:
273 nXAdj = nX + 1;
274 nYAdj = nY - 1;
275 break;
276
277 case 2:
278 nXAdj = nX + 1;
279 nYAdj = nY;
280 break;
281
282 case 3:
283 nXAdj = nX + 1;
284 nYAdj = nY + 1;
285 break;
286
287 case 4:
288 nXAdj = nX;
289 nYAdj = nY + 1;
290 break;
291
292 case 5:
293 nXAdj = nX - 1;
294 nYAdj = nY + 1;
295 break;
296
297 case 6:
298 nXAdj = nX - 1;
299 nYAdj = nY;
300 break;
301
302 case 7:
303 nXAdj = nX - 1;
304 nYAdj = nY - 1;
305 break;
306 }
307
308 CGeom2DIPoint const PtiTmp(nXAdj, nYAdj);
309
310 for (int nCoastPoint = 0; nCoastPoint < m_ILCellsMarkedAsCoastline.nGetSize(); nCoastPoint++)
311 {
312 if (m_ILCellsMarkedAsCoastline[nCoastPoint] == &PtiTmp)
313 {
314 *pPtiCell = PtiTmp;
315 return nCoastPoint;
316 }
317 }
318 }
319
320 return INT_NODATA;
321}
322
324double CRWCoast::dGetDetailedCurvature(int const nCoastPoint) const
325{
326 // TODO 055 No sanity check for nCoastPoint < m_VdCurvatureDetailed.Size()
327 return m_VdCurvatureDetailed[nCoastPoint];
328}
329
331void CRWCoast::SetDetailedCurvature(int const nCoastPoint, double const dCurvature)
332{
333 // TODO 055 No check to see if nCoastPoint < m_VdCurvatureDetailed.size()
334 m_VdCurvatureDetailed[nCoastPoint] = dCurvature;
335}
336
339{
340 return &m_VdCurvatureDetailed;
341}
342
344double CRWCoast::dGetSmoothCurvature(int const nCoastPoint) const
345{
346 // TODO 055 No sanity check for nCoastPoint < m_VdCurvatureSmooth.Size()
347 return m_VdCurvatureSmooth[nCoastPoint];
348}
349
351void CRWCoast::SetSmoothCurvature(int const nCoastPoint, double const dCurvature)
352{
353 // TODO 055 No check to see if nCoastPoint < m_VdCurvatureSmooth.size()
354 m_VdCurvatureSmooth[nCoastPoint] = dCurvature;
355}
356
359{
360 return &m_VdCurvatureSmooth;
361}
362
365{
367}
368
369// //! Gets the mean of the coast's detailed curvature
370// double CRWCoast::dGetDetailedCurvatureMean(void) const
371// {
372// return m_dCurvatureDetailedMean;
373// }
374
377{
379}
380
381// //! Gets the standard deviation of the coast's detailed curvature
382// double CRWCoast::dGetDetailedCurvatureSTD(void) const
383// {
384// return m_dCurvatureDetailedSTD;
385// }
386
388void CRWCoast::SetSmoothCurvatureMean(double const dMean)
389{
391}
392
395{
397}
398
400void CRWCoast::SetSmoothCurvatureSTD(double const dSTD)
401{
403}
404
407{
409}
410
413{
414 // TODO 055 Maybe add a safety check? that nProfile < m_pVProfile.size()
415 return m_pVProfile[nProfile];
416}
417
420{
421 // TODO 055 Maybe add a safety check? that nProfile < m_pVProfile.size()
422 return m_pVProfile.back();
423}
424
427{
428 m_pVProfile.push_back(pProfile);
429}
430
431// void CRWCoast::ReplaceProfile(int const nProfile, vector<CGeom2DPoint> const* pPtVProfileNew)
432// {
433// // TODO 055 Maybe add a safety check? that nProfile < m_pVProfile.size()
434// m_pVProfile[nProfile].SetPointsInProfile(pPtVProfileNew);
435// }
436
439{
440 return static_cast<int>(m_pVProfile.size());
441}
442
445{
446 for (int n = 0; n < static_cast<int>(m_pVNormalProfileDownAllCoastpointSeq.size()); n++)
447 {
450 }
451}
452
455{
456 // Note no check whether n < size()
457 return m_pVProfileDownCoastSeq[nProf];
458}
459
462{
463 // Note no check whether n < size()
464 int const nSize = static_cast<int>(m_pVProfileDownCoastSeq.size());
465 return m_pVProfileDownCoastSeq[nSize - (nProf + 1)];
466}
467
473
476{
477 CGeomProfile* pDownCoastProfile = pProfile->pGetDownCoastAdjacentProfile();
478
479 if ((pDownCoastProfile != NULL) && (pDownCoastProfile->bEndOfCoast()))
480 return NULL;
481
482 return pDownCoastProfile;
483}
484
487{
488 return pProfile->pGetUpCoastAdjacentProfile();
489}
490
492void CRWCoast::SetCoastDeepWaterWaveHeight(int const nCoastPoint, double const dHeight)
493{
494 // TODO 055 No check to see if nCoastPoint < m_VdDeepWaterWaveHeight.size()
495 m_VdDeepWaterWaveHeight[nCoastPoint] = dHeight;
496}
497
498// //! Gets the deep water wave height for this coast point
499// double CRWCoast::dGetCoastDeepWaterWaveHeight(int const nCoastPoint) const
500// {
501// // TODO 055 No check to see if nCoastPoint < m_VdDeepWaterWaveHeight.size()
502// return m_VdDeepWaterWaveHeight[nCoastPoint];
503// }
504
506void CRWCoast::SetCoastDeepWaterWaveAngle(int const nCoastPoint, double const dOrientation)
507{
508 // TODO 055 No check to see if nCoastPoint < m_VdDeepWaterWaveAngle.size()
509 m_VdDeepWaterWaveAngle[nCoastPoint] = dOrientation;
510}
511
513double CRWCoast::dGetCoastDeepWaterWaveAngle(int const nCoastPoint) const
514{
515 // TODO 055 No check to see if nCoastPoint < m_VdDeepWaterWaveAngle.size()
516 return m_VdDeepWaterWaveAngle[nCoastPoint];
517}
518
520void CRWCoast::SetCoastDeepWaterWavePeriod(int const nCoastPoint, double const dPeriod)
521{
522 m_VdDeepWaterWavePeriod[nCoastPoint] = dPeriod;
523}
524
526double CRWCoast::dGetCoastDeepWaterWavePeriod(int const nCoastPoint) const
527{
528 return m_VdDeepWaterWavePeriod[nCoastPoint];
529}
530
532void CRWCoast::SetBreakingWaveHeight(int const nCoastPoint, double const dHeight)
533{
534 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveHeight.size()
535 m_VdBreakingWaveHeight[nCoastPoint] = dHeight;
536}
537
539double CRWCoast::dGetBreakingWaveHeight(int const nCoastPoint) const
540{
541 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveHeight.size()
542 return m_VdBreakingWaveHeight[nCoastPoint];
543}
544
546void CRWCoast::SetWaveSetupSurge(int const nCoastPoint, double const dWaveSetup)
547{
548 m_VdWaveSetupSurge[nCoastPoint] = dWaveSetup;
549}
550
552double CRWCoast::dGetWaveSetupSurge(int const nCoastPoint) const
553{
554 return m_VdWaveSetupSurge[nCoastPoint];
555}
556
557// void CRWCoast::SetStormSurge(int const nCoastPoint, double const dStormSurge)
558// {
559// m_VdStormSurge[nCoastPoint] = dStormSurge;
560// }
561
562// double CRWCoast::dGetStormSurge(int const nCoastPoint) const
563// {
564// return m_VdStormSurge[nCoastPoint];
565// }
566
568void CRWCoast::SetRunUp(int const nCoastPoint, double const dRunUp)
569{
570 m_VdRunUp[nCoastPoint] = dRunUp;
571}
572
574double CRWCoast::dGetRunUp(int const nCoastPoint) const
575{
576 return m_VdRunUp[nCoastPoint];
577}
578
580double CRWCoast::dGetLevel(int const nCoastPoint, int const level) const
581{
582 switch (level)
583 {
584 case 0: // WAVESETUPSURGE:
585 return m_VdWaveSetupSurge[nCoastPoint];
586 break;
587
588 case 1: // WAVESETUPSURGE + RUNUP:
589 return m_VdWaveSetupSurge[nCoastPoint] + m_VdRunUp[nCoastPoint];
590 break;
591
592 default:
593 return 0;
594 }
595}
596
598void CRWCoast::SetCoastWaveHeight(int const nCoastPoint, double const dHeight)
599{
600 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveHeight.size()
601 m_VdCoastWaveHeight[nCoastPoint] = dHeight;
602}
603
605double CRWCoast::dGetCoastWaveHeight(int const nCoastPoint) const
606{
607 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveHeight.size()
608 return m_VdCoastWaveHeight[nCoastPoint];
609}
610
612void CRWCoast::SetBreakingWaveAngle(int const nCoastPoint, double const dOrientation)
613{
614 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveAngle.size()
615 m_VdBreakingWaveAngle[nCoastPoint] = dOrientation;
616}
617
619double CRWCoast::dGetBreakingWaveAngle(int const nCoastPoint) const
620{
621 // TODO 055 No check to see if nCoastPoint < m_VdBreakingWaveAngle.size()
622 return m_VdBreakingWaveAngle[nCoastPoint];
623}
624
626void CRWCoast::SetDepthOfBreaking(int const nCoastPoint, double const dDepth)
627{
628 // TODO 055 No check to see if nCoastPoint < m_VdDepthOfBreaking.size()
629 m_VdDepthOfBreaking[nCoastPoint] = dDepth;
630}
631
633double CRWCoast::dGetDepthOfBreaking(int const nCoastPoint) const
634{
635 // TODO 055 No check to see if nCoastPoint < m_VdDepthOfBreaking.size()
636 return m_VdDepthOfBreaking[nCoastPoint];
637}
638
640void CRWCoast::SetBreakingDistance(int const nCoastPoint, int const nDist)
641{
642 // TODO 055 No check to see if nCoastPoint < m_VnBreakingDistance.size()
643 m_VnBreakingDistance[nCoastPoint] = nDist;
644}
645
647int CRWCoast::nGetBreakingDistance(int const nCoastPoint) const
648{
649 // TODO 055 No check to see if nCoastPoint < m_VnBreakingDistance.size()
650 return m_VnBreakingDistance[nCoastPoint];
651}
652
654void CRWCoast::SetFluxOrientation(int const nCoastPoint, double const dOrientation)
655{
656 // TODO 055 No check to see if nCoastPoint < m_VdFluxOrientation.size()
657 m_VdFluxOrientation[nCoastPoint] = dOrientation;
658}
659
661double CRWCoast::dGetFluxOrientation(int const nCoastPoint) const
662{
663 // TODO 055 No check to see if nCoastPoint < m_VdFluxOrientation.size()
664 return m_VdFluxOrientation[nCoastPoint];
665}
666
668void CRWCoast::SetWaveEnergyAtBreaking(int const nCoastPoint, double const dEnergy)
669{
670 // TODO 055 No check to see if nCoastPoint < m_VdWaveEnergyAtBreaking.size()
671 // assert(isfinite(dEnergy));
672 m_VdWaveEnergyAtBreaking[nCoastPoint] = dEnergy;
673}
674
676double CRWCoast::dGetWaveEnergyAtBreaking(int const nCoastPoint) const
677{
678 // TODO 055 No check to see if nCoastPoint < m_VdWaveEnergyAtBreaking.size()
679 // assert(isfinite(m_VdWaveEnergyAtBreaking[nCoastPoint]));
680 return m_VdWaveEnergyAtBreaking[nCoastPoint];
681}
682
688
691{
692 for (int n = 0; n < static_cast<int>(m_pVProfile.size()); n++)
693 {
694 int const nCoastPoint = m_pVProfile[n]->nGetCoastPoint();
695
696 // Note no check to see whether nCoastPoint < m_pVNormalProfileDownAllCoastpointSeq.size()
698 }
699}
700
702void CRWCoast::SetProfileAtCoastPoint(int const nCoastPoint, CGeomProfile* const pProfile)
703{
704 // Note no check to see whether nCoastPoint < m_pVNormalProfileDownAllCoastpointSeq.size()
705 m_pVNormalProfileDownAllCoastpointSeq.at(nCoastPoint) = pProfile;
706}
707
709bool CRWCoast::bIsProfileAtCoastPoint(int const nCoastPoint) const
710{
711 if (m_pVNormalProfileDownAllCoastpointSeq.at(nCoastPoint) == NULL)
712 return false;
713
714 return true;
715}
716
719{
720 return m_pVNormalProfileDownAllCoastpointSeq[nCoastPoint];
721}
722
725{
726 m_pVLandform.push_back(pCoastLandform);
727}
728
731{
732 if (nCoastPoint < static_cast<int>(m_pVLandform.size()))
733 return m_pVLandform[nCoastPoint];
734
735 return NULL;
736}
737
739void CRWCoast::SetPolygonNode(int const nPoint, int const nNode)
740{
741 // TODO 055 No check to see if nPoint < m_VnPolygonNode.size()
742 m_VnPolygonNode[nPoint] = nNode;
743}
744
746int CRWCoast::nGetPolygonNode(int const nPoint) const
747{
748 // TODO 055 No check to see if nPoint < m_VnPolygonNode.size()
749 return m_VnPolygonNode[nPoint];
750}
751
753CGeomCoastPolygon* CRWCoast::pPolyCreatePolygon(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)
754{
755 CGeomCoastPolygon* pPolygon = new CGeomCoastPolygon(nCoastID, nCoastPoint, nProfileUpCoast, nProfileDownCoast, pVIn, nNumPointsUpCoastProfile, nNumPointsDownCoastProfile, pPtiNode, pPtiAntiNode, bStartCoast, bEndCoast);
756
757 return pPolygon;
758}
759
762{
763 return pGetSim()->nGetCoastPolygonSize();
764}
765
768{
769 // TODO 055 No check to see if nPoint < m_VnPolygon.size()
770 return pGetSim()->pGetPolygon(nPoly);
771}
772
773// //! Appends to coast polygon length
774// void CRWCoast::AppendPolygonLength(const double dLength)
775// {
776// m_VdPolygonLength.push_back(dLength);
777// }
778//
779// //! Gets coast polygon length
780// double CRWCoast::dGetPolygonLength(int const nIndex) const
781// {
782// // TODO 055 No check to see if nIndex < m_VdPolygonLength.size()
783// return m_VdPolygonLength[nIndex];
784// }
785
788{
789 return static_cast<int>(m_LShadowBoundary.size());
790}
791
794{
795 m_LShadowBoundary.push_back(*pLBoundary);
796}
797
800{
801 // TODO 055 No check to see if n < m_LShadowBoundary.size()
802 return &m_LShadowBoundary[n];
803}
804
807{
808 return static_cast<int>(m_LShadowDowndriftBoundary.size());
809}
810
813{
814 m_LShadowDowndriftBoundary.push_back(*pLBoundary);
815}
816
819{
820 // TODO 055 No check to see if n < m_LShadowDowndriftBoundary.size()
822}
Contains CGeom2DPoint definitions.
Contains CGeom2DIPoint definitions.
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:55
int nGetX(void) const
Returns the CGeom2DIPoint object's integer X coordinate.
Definition 2di_point.cpp:49
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:32
Geometry class used to represent coast profile objects.
Definition profile.h:37
CGeomProfile * pGetUpCoastAdjacentProfile(void) const
Returns the up-coast adjacent profile, returns NULL if there is no up-coast adjacent profile.
Definition profile.cpp:479
CGeomProfile * pGetDownCoastAdjacentProfile(void) const
Returns the down-coast adjacent profile, returns NULL if there is no down-coast adjacent profile.
Definition profile.cpp:491
bool bEndOfCoast(void) const
Returns the switch to indicate whether this is an end-of-coast profile.
Definition profile.cpp:128
void SetStartEdge(int const)
Sets the coast's start edge.
Definition coast.cpp:82
double dGetBreakingWaveAngle(int const) const
Gets the breaking wave angle for this coast point.
Definition coast.cpp:619
void AppendShadowBoundary(CGeomLine const *)
Appends a shadow boundary to this coast.
Definition coast.cpp:793
vector< CGeomProfile * > m_pVProfile
Coast-normal profile objects, in sequence of creation (which is the same as nGetProfileID() sequence)
Definition coast.h:143
void SetCoastDeepWaterWavePeriod(int const, double const)
Sets the deep water wave period for this coast point.
Definition coast.cpp:520
void SetCoastDeepWaterWaveAngle(int const, double const)
Sets the deep water wave angle for this coast point.
Definition coast.cpp:506
int nGetNumShadowDowndriftBoundaries(void) const
Returns the number of shadow zone downdrift boundaries on this coast.
Definition coast.cpp:806
CGeom2DIPoint * pPtiGetCellMarkedAsCoastline(int const)
Returns the coordinates (grid CRS) of the cells marked as coastline.
Definition coast.cpp:216
vector< double > m_VdBreakingWaveHeight
The breaking wave height on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:108
void SetBreakingDistance(int const, int const)
Sets the breaking distance for this coast point.
Definition coast.cpp:640
vector< double > m_VdRunUp
The run-up on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:117
double dGetDetailedCurvature(int const) const
Returns the detailed curvature for a coast point.
Definition coast.cpp:324
double dGetSmoothCurvatureMean(void) const
Gets the mean of the coast's smoothed curvature.
Definition coast.cpp:394
CRWCoast(CSimulation *)
Constructor with initialization list.
Definition coast.cpp:41
bool bIsProfileAtCoastPoint(int const) const
Returns true if there is a coastline-normal profile at this coast point, false otherwise.
Definition coast.cpp:709
void SetSmoothCurvatureSTD(double const)
Sets the standard deviation of the coast's smoothed curvature.
Definition coast.cpp:400
vector< double > m_VdWaveSetupSurge
The wave setup on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:111
double dGetSmoothCurvatureSTD(void) const
Gets the standard deviation of the coast's smoothed curvature.
Definition coast.cpp:406
int nGetEndEdge(void) const
Gets the coast's end edge.
Definition coast.cpp:100
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:469
void SetDepthOfBreaking(int const, double const)
Sets the depth of breaking for this coast point.
Definition coast.cpp:626
void SetSmoothCurvatureMean(double const)
Sets the mean of the coast's smoothed curvature.
Definition coast.cpp:388
vector< int > m_VnBreakingDistance
Distance of breaking (in cells), at each point on m_LCoastlineExtCRS.
Definition coast.h:87
double dGetBreakingWaveHeight(int const) const
Gets the breaking wave height for this coast point.
Definition coast.cpp:539
CSimulation * pGetSim(void) const
Returns a pointer to the simulation object.
Definition coast.cpp:64
void SetFluxOrientation(int const, double const)
Sets the flux orientation for this coast point.
Definition coast.cpp:654
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:767
CGeomLine m_LCoastlineExtCRS
Smoothed line of points (external CRS) giving the plan view of the vector coast.
Definition coast.h:70
void AppendProfile(CGeomProfile *)
Appends a coastline-normal profile.
Definition coast.cpp:426
int m_nEndEdge
The edge at which the coast ends.
Definition coast.h:52
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:730
double m_dCurvatureSmoothSTD
The standard deviaton of the coast's smoothed curvature.
Definition coast.h:64
void SetWaveSetupSurge(int const, double const)
Sets the wave setup surge for this coast point.
Definition coast.cpp:546
vector< double > m_VdWaveEnergyAtBreaking
Wave energy at each point on m_LCoastlineExtCRS.
Definition coast.h:132
CGeomLine * pGetShadowDowndriftBoundary(int const)
Returns a pointer to a shadow zone downdrift boundary.
Definition coast.cpp:818
int m_nStartEdge
The edge from which the coast starts.
Definition coast.h:49
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:486
CGeomLine * pLGetCoastlineExtCRS(void)
Returns the coastline (external CRS)
Definition coast.cpp:153
vector< CACoastLandform * > m_pVLandform
Pointer to a coastal landform object, at each point on the coastline.
Definition coast.h:135
void SetCoastlineGridCRS(CGeomILine const *)
Sets the coordinates (grid CRS) of the cells marked as coastline.
Definition coast.cpp:200
double dGetWaveEnergyAtBreaking(int const) const
Gets the wave energy at breaking for this coast point.
Definition coast.cpp:676
double dGetDepthOfBreaking(int const) const
Gets the depth of breaking for this coast point.
Definition coast.cpp:633
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:246
int nGetNumShadowBoundaries(void) const
Returns the number of shadow boundaries on this coast.
Definition coast.cpp:787
int nGetSeaHandedness(void) const
Gers the handedness of the coast.
Definition coast.cpp:76
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:102
vector< CGeomLine > m_LShadowBoundary
Lines which comprise the edge of a shadow zone, ext CRS.
Definition coast.h:149
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:105
CSimulation * m_pSim
A pointer to the CSimulation object.
Definition coast.h:67
vector< CGeomProfile * > m_pVProfileDownCoastSeq
Pointers to coastline-normal objects, in along-coastline sequence.
Definition coast.h:146
int nGetNumProfiles(void) const
Returns the number of profiles on this coast.
Definition coast.cpp:438
double dGetRunUp(int const) const
Gets the wave runup for this coast point.
Definition coast.cpp:574
CGeomProfile * pGetProfile(int const)
Returns a pointer to a profile, in polygon-ID number sequence.
Definition coast.cpp:412
CGeomLine * pGetShadowBoundary(int const)
Returns a pointer to a shadow boundary.
Definition coast.cpp:799
int nGetCoastlineSize(void) const
Gets the size of the coastline.
Definition coast.cpp:189
~CRWCoast(void)
Destructor.
Definition coast.cpp:54
void SetCoastlineExtCRS(CGeomLine const *)
Given the vector line of a coast, this initializes coastline values (curvature, breaking wave height,...
Definition coast.cpp:106
void SetRunUp(int const, double const)
Sets the wave runup for this coast point.
Definition coast.cpp:568
vector< double > m_VdBreakingWaveAngle
The breaking wave orientation on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:123
CGeomProfile * pGetProfileWithUpCoastSeq(int const) const
Returns a pointer to a coastline-normal profile in up-coast sequence.
Definition coast.cpp:461
vector< double > m_VdCurvatureDetailed
Detailed curvature at each point on m_LCoastlineExtCRS.
Definition coast.h:93
void SetDetailedCurvatureMean(double const)
Sets the mean of the coast's detailed curvature.
Definition coast.cpp:364
void SetBreakingWaveHeight(int const, double const)
Sets the breaking wave height for this coast point.
Definition coast.cpp:532
CGeomCoastPolygon * pPolyCreatePolygon(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:753
int nGetStartEdge(void) const
Gets the coast's start edge.
Definition coast.cpp:88
void SetPolygonNode(int const, int const)
Sets a coast polygon node.
Definition coast.cpp:739
void SetDetailedCurvatureSTD(double const)
Sets the standard deviation of the coast's detailed curvature.
Definition coast.cpp:376
CGeom2DPoint * pPtGetCoastlinePointExtCRS(int const)
Returns a given coast point in external CRS.
Definition coast.cpp:159
int nGetPolygonNode(int const) const
Gets a coast polygon node.
Definition coast.cpp:746
double m_dCurvatureSmoothMean
The mean of the coast's smoothed curvature.
Definition coast.h:61
void SetBreakingWaveAngle(int const, double const)
Sets the breaking wave angle for this coast point.
Definition coast.cpp:612
vector< double > m_VdCoastWaveHeight
The wave height at coast point on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:120
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:99
void SetProfileAtCoastPoint(int const, CGeomProfile *const)
Sets a pointer to a coast-normal profile at a given coastline point.
Definition coast.cpp:702
int nGetBreakingDistance(int const) const
Gets the breaking distance for this coast point.
Definition coast.cpp:647
void SetSmoothCurvature(int const, double const)
Sets the smoothed curvature for a coast point.
Definition coast.cpp:351
vector< double > m_VdDepthOfBreaking
The depth of breaking on a normal drawn from each point on m_LCoastlineExtCRS.
Definition coast.h:126
void AppendCoastLandform(CACoastLandform *)
Appends a coastal landform to this coast.
Definition coast.cpp:724
double m_dCurvatureDetailedSTD
The standard deviation of the coast's detailed curvature.
Definition coast.h:58
vector< double > * pVGetSmoothCurvature(void)
Returns a pointer to a vector of smoothed curvature for all coast points.
Definition coast.cpp:358
void InsertProfilesInProfileCoastPointIndex(void)
Inserts profiles at coastline points in the profile-coastline-point index.
Definition coast.cpp:690
void AppendShadowDowndriftBoundary(CGeomLine const *)
Appends a shadow zone downdrift boundary.
Definition coast.cpp:812
double dGetFluxOrientation(int const) const
Gets the flux orientation for this coast point.
Definition coast.cpp:661
double dGetCoastDeepWaterWavePeriod(int const) const
Gets the deep water wave period for this coast point.
Definition coast.cpp:526
void SetCoastDeepWaterWaveHeight(int const, double const)
Sets the deep water wave height for this coast point.
Definition coast.cpp:492
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:138
void SetSeaHandedness(int const)
Sets the handedness of the coast.
Definition coast.cpp:70
vector< double > m_VdCurvatureSmooth
Smoothed curvature at each point on m_LCoastlineExtCRS.
Definition coast.h:96
int m_nSeaHandedness
Direction of the sea from the coastline, travelling down-coast (i.e. in direction of increasing coast...
Definition coast.h:46
CGeomProfile * pGetLastProfile(void)
Returns a pointer to the last profile, in polygon-ID number sequence.
Definition coast.cpp:419
double dGetSmoothCurvature(int const) const
Returns the smoothed curvature for a coast point.
Definition coast.cpp:344
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:84
vector< double > * pVGetDetailedCurvature(void)
Returns a pointer to a vector of detailed curvature for all coast points.
Definition coast.cpp:338
vector< int > m_VnPolygonNode
At every point on m_LCoastlineExtCRS: INT_NODATA if no nodepoint there, otherwise the node (point of ...
Definition coast.h:90
void SetWaveEnergyAtBreaking(int const, double const)
Sets the wave energy at breaking for this coast point.
Definition coast.cpp:668
double m_dCurvatureDetailedMean
The mean of the coast's detailed curvature.
Definition coast.h:55
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:454
double dGetCoastWaveHeight(int const) const
Gets the coast wave height for this coast point.
Definition coast.cpp:605
CGeomProfile * pGetProfileAtCoastPoint(int const) const
Returns a pointer to the coastline-normal profile at this coast point.
Definition coast.cpp:718
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:444
void CreateProfilesAtCoastPoints(void)
Creates a vector which holds, for each coastline point, a null pointer to a coastline-normal profile ...
Definition coast.cpp:684
void SetEndEdge(int const)
Sets the coast's end edge.
Definition coast.cpp:94
double dGetWaveSetupSurge(int const) const
Gets the wave setup surge for this coast point.
Definition coast.cpp:552
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:475
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:129
int nGetNumPolygons(void) const
Returns the number of coast polygons.
Definition coast.cpp:761
void SetCoastWaveHeight(int const, double const)
Sets the coast wave height for this coast point.
Definition coast.cpp:598
void SetDetailedCurvature(int const, double const)
Sets the detailed curvature for a coast point.
Definition coast.cpp:331
double dGetLevel(int const, int const) const
Sets the wave level for this coast point.
Definition coast.cpp:580
vector< CGeomLine > m_LShadowDowndriftBoundary
Lines which comprise the edge of a downdrift zone, ext CRS.
Definition coast.h:152
double dGetCoastDeepWaterWaveAngle(int const) const
Gets the deep water wave angle for this coast point.
Definition coast.cpp:513
This class runs CoastalME simulations.
Definition simulation.h:79
CGeomCoastPolygon * pGetPolygon(int const) const
Returns a pointer to a coast polygon, in down-coast sequence.
Definition utils.cpp:2973
int nGetCoastPolygonSize(void) const
Returns the size of the coast polygon vector.
Definition utils.cpp:2965
This file contains global definitions for CoastalME.
int const INT_NODATA
Definition cme.h:476
int const NULL_HANDED
Definition cme.h:510
double const DBL_NODATA
Definition cme.h:834
Contains CRWCoast definitions.
Contains CGeomILine definitions.
Contains CGeomLine definitions.
Contains CGeomRasterGrid definitions.
Contains CSimulation definitions.