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