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