CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
assign_landforms.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 <iostream>
27using std::cout;
28using std::cerr;
29using std::endl;
30
31#ifdef _OPENMP
32 #include <omp.h>
33#endif
34
35#include "cme.h"
36#include "simulation.h"
37#include "coast.h"
38#include "cliff.h"
39#include "drift.h"
40#include "intervention.h"
41
42//===============================================================================================================================
44//===============================================================================================================================
46{
47 // For each coastline, put a coastal landform at every point along the coastline
48 for (int nCoast = 0; nCoast < static_cast<int>(m_VCoast.size()); nCoast++)
49 {
50 for (int j = 0; j < m_VCoast[nCoast].nGetCoastlineSize(); j++)
51 {
52 // Get the coords of the grid cell marked as coastline for the coastal landform object
53 int nX = m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(j)->nGetX();
54 int nY = m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(j)->nGetY();
55
56 // Store the coastline number and the number of the coastline point in the cell so we can get these quickly later
57 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCoast(nCoast);
58 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetPointOnCoast(j);
59
60 // OK, start assigning coastal landforms. First, is there an intervention here?
61 if (bIsInterventionCell(nX, nY) || m_pRasterGrid->m_Cell[nX][nY].dGetInterventionHeight() > 0)
62 {
63 // There is, so create an intervention object on the vector coastline with these attributes
64 CACoastLandform* pIntervention = new CRWIntervention(&m_VCoast[nCoast], nCoast, j);
65 m_VCoast[nCoast].AppendCoastLandform(pIntervention);
66
67// LogStream << j << " [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "} " << m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->nGetLFCategory() << " " << m_pRasterGrid->m_Cell[nX][nY].dGetInterventionHeight() << endl;
68
69 continue;
70 }
71
72 // OK this landform is something other than an intervention. So check what we have at SWL on this cell: is it unconsolidated or consolidated sediment? Note that layer 0 is the first layer above basement
73 int nLayer = m_pRasterGrid->m_Cell[nX][nY].nGetLayerAtElev(m_dThisIterSWL);
74
75 if (nLayer == ELEV_IN_BASEMENT)
76 {
77 // Should never happen
78 LogStream << m_ulIter << ": SWL (" << m_dThisIterSWL << ") is in basement on cell [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "}, cannot assign coastal landform for coastline " << nCoast << endl;
79
81 }
82
83 else if (nLayer == ELEV_ABOVE_SEDIMENT_TOP)
84 {
85 // Again, should never happen
86 LogStream << m_ulIter << ": SWL (" << m_dThisIterSWL << ") is above sediment-top elevation (" << m_pRasterGrid->m_Cell[nX][nY].dGetSedimentTopElev() << ") on cell [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "}, cannot assign coastal landform for coastline " << nCoast << endl;
87
89 }
90
91 double dConsSedTop = m_pRasterGrid->m_Cell[nX][nY].dGetConsSedTopForLayerAboveBasement(nLayer);
92 bool bConsSedAtSWL = false;
93
94 if (dConsSedTop >= m_dThisIterSWL)
95 bConsSedAtSWL = true;
96
97 double dNotchBaseElev = m_dThisIterMeanSWL - m_dNotchBaseBelowSWL;
98
99 if (m_ulIter == 1)
100 {
101 // The first timestep: no coastal landforms (other than interventions) already exist, so no grid cells are flagged with coastal landform attributes. So we must update the grid now using the initial values for the coastal landform object's attributes, ready for nLandformToGrid() at the end of the first timestep
102 if (bConsSedAtSWL)
103 {
104 // First timestep: we have consolidated sediment at SWL, so this is a cliff cell. Set some initial values for the cliff object's attributes
105 // LogStream << "*** AAA [" << nX << "][" << nY << "] dNotchBaseElev = " << dNotchBaseElev << endl;
106 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetLFSubCategory(LF_SUBCAT_CLIFF_ON_COASTLINE);
107 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffNotchBaseElev(dNotchBaseElev);
108 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffNotchDepth(0);
109 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffRemaining(m_dCellSide);
110
111 // Create a cliff object on the vector coastline with these attributes
112 CACoastLandform* pCliff = new CRWCliff(&m_VCoast[nCoast], nCoast, j, m_dCellSide, 0, dNotchBaseElev, 0);
113 m_VCoast[nCoast].AppendCoastLandform(pCliff);
114
115// LogStream << m_ulIter << ": CLIFF CREATED [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "}" << endl;
116 }
117
118 else
119 {
120 // First timestep: we have unconsolidated sediment at SWL, so this is a drift cell: create a drift object on the vector coastline with these attributes
121 CACoastLandform* pDrift = new CRWDrift(&m_VCoast[nCoast], nCoast, j);
122 m_VCoast[nCoast].AppendCoastLandform(pDrift);
123
124 // Safety check
125 if (m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->nGetLFCategory() != LF_CAT_DRIFT)
126 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetLFSubCategory(LF_SUBCAT_DRIFT_MIXED);
127
128// LogStream << m_ulIter << ": DRIFT CREATED [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "}" << endl;
129 }
130 }
131
132 else
133 {
134 // This not the first timestep
135 if (bConsSedAtSWL)
136 {
137 // We have consolidated sediment at SWL, so this is a cliff cell. Set some default values
138 double dAccumWaveEnergy = 0;
139 double dNotchDepth = 0;
140 double dRemaining = m_dCellSide;
141
142 // Get the existing landform category of this cell
143 if (m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->nGetLFCategory() == LF_CAT_CLIFF)
144 {
145 // This cell was a cliff in a previous timestep, so get the data stored in the cell, this will be stored in the cliff object on the vector coastline
146 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetLFSubCategory(LF_SUBCAT_CLIFF_ON_COASTLINE);
147 dAccumWaveEnergy = m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->dGetAccumWaveEnergy();
148 dNotchDepth = m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->dGetCliffNotchDepth();
149 dNotchBaseElev = m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->dGetCliffNotchBaseElev();
150 // LogStream << "*** BBB [" << nX << "][" << nY << "] dNotchBaseElev = " << dNotchBaseElev << endl;
151 // dRemaining = m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->dGetCliffRemaining();
152
153// LogStream << m_ulIter << ": CLIFF RE-CREATED [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "}" << endl;
154 }
155
156 else
157 {
158 // This cell was not a cliff object in a previous timestep. Mark it as one now and set the cell with the default values for the cliff object's attributes
159 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetLFSubCategory(LF_SUBCAT_CLIFF_ON_COASTLINE);
160 dAccumWaveEnergy = m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->dGetAccumWaveEnergy();
161 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffNotchDepth(dNotchDepth);
162 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffNotchBaseElev(dNotchBaseElev);
163 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffRemaining(dRemaining);
164
165// LogStream << m_ulIter << ": CLIFF CREATED [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "}" << endl;
166 }
167
168 // Create a cliff object on the vector coastline with these attributes
169 CACoastLandform* pCliff = new CRWCliff(&m_VCoast[nCoast], nCoast, j, m_dCellSide, dNotchDepth, dNotchBaseElev, dAccumWaveEnergy);
170 m_VCoast[nCoast].AppendCoastLandform(pCliff);
171 }
172
173 else
174 {
175 // We have unconsolidated sediment at SWL, so this is a drift cell: create a drift object on the vector coastline with these attributes
176 CACoastLandform* pDrift = new CRWDrift(&m_VCoast[nCoast], nCoast, j);
177 m_VCoast[nCoast].AppendCoastLandform(pDrift);
178
179 // Safety check
180 if (m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->nGetLFCategory() != LF_CAT_DRIFT)
181 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetLFSubCategory(LF_SUBCAT_DRIFT_MIXED);
182
183// LogStream << m_ulIter << ": DRIFT CREATED [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "}" << endl;
184 }
185 }
186 }
187 }
188
189// // DEBUG CODE ============================================================================================================================================
190// for (int i = 0; i < static_cast<int>(m_VCoast.size()); i++)
191// {
192// for (int j = 0; j < m_VCoast[i].nGetCoastlineSize(); j++)
193// {
194// int
195// nX = m_VCoast[i].pPtiGetCellMarkedAsCoastline(j)->nGetX(),
196// nY = m_VCoast[i].pPtiGetCellMarkedAsCoastline(j)->nGetY();
197//
198// LogStream << m_ulIter << ": coast cell " << j << " at [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "} has landform category = ";
199//
200// int
201// nCat = m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->nGetLFCategory(),
202// nSubCat = m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->nGetLFSubCategory();
203//
204// switch (nCat)
205// {
206// case LF_CAT_HINTERLAND:
207// LogStream << "hinterland";
208// break;
209//
210// case LF_CAT_SEA:
211// LogStream << "sea";
212// break;
213//
214// case LF_CAT_CLIFF:
215// LogStream << "cliff";
216// break;
217//
218// case LF_CAT_DRIFT:
219// LogStream << "drift";
220// break;
221//
222// case LF_CAT_INTERVENTION:
223// LogStream << "intervention";
224// break;
225//
226// case LF_NONE:
227// LogStream << "none";
228// break;
229//
230// default:
231// LogStream << "NONE";
232// break;
233// }
234//
235// LogStream << " and landform subcategory = ";
236//
237// switch (nSubCat)
238// {
239// case LF_SUBCAT_CLIFF_ON_COASTLINE:
240// LogStream << "cliff on coastline";
241// break;
242//
243// case LF_SUBCAT_CLIFF_INLAND:
244// LogStream << "cliff inland";
245// break;
246//
247// case LF_SUBCAT_DRIFT_MIXED:
248// LogStream << "mixed drift";
249// break;
250//
251// case LF_SUBCAT_DRIFT_TALUS:
252// LogStream << "talus";
253// break;
254//
255// case LF_SUBCAT_DRIFT_BEACH:
256// LogStream << "beach";
257// break;
258//
259// case LF_SUBCAT_DRIFT_DUNES:
260// LogStream << "dunes";
261// break;
262//
263// case LF_SUBCAT_INTERVENTION_STRUCT:
264// LogStream << "structural intervention";
265// break;
266//
267// case LF_SUBCAT_INTERVENTION_NON_STRUCT:
268// LogStream << "non-structural intervention";
269// break;
270//
271// case LF_NONE:
272// LogStream << "none";
273// break;
274//
275// default:
276// LogStream << "NONE";
277// break;
278// }
279// LogStream << endl;
280// }
281// }
282// // DEBUG CODE ============================================================================================================================================
283
284 return RTN_OK;
285}
286
287//===============================================================================================================================
289//===============================================================================================================================
290int CSimulation::nLandformToGrid(int const nCoast, int const nPoint)
291{
292 // What is the coastal landform here?
293 CACoastLandform* pCoastLandform = m_VCoast[nCoast].pGetCoastLandform(nPoint);
294 int nCategory = pCoastLandform->nGetLandFormCategory();
295
296 if (nCategory == LF_CAT_CLIFF)
297 {
298 // It's a cliff
299 CRWCliff const* pCliff = reinterpret_cast<CRWCliff*>(pCoastLandform);
300
301 int nX = m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(nPoint)->nGetX();
302 int nY = m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(nPoint)->nGetY();
303
304 if (! pCliff->bHasCollapsed())
305 {
306 // The cliff has not collapsed. Get attribute values from the cliff object
307 double dNotchBaseElev = pCliff->dGetNotchBaseElev();
308 double dNotchDepth = pCliff->dGetNotchDepth();
309 double dRemaining = pCliff->dGetRemaining();
310
311 // LogStream << "*** CCC [" << nX << "][" << nY << "] dNotchBaseElev = " << dNotchBaseElev << endl;
312
313 // And store some attribute values in the cliff cell
314 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetLFSubCategory(LF_SUBCAT_CLIFF_ON_COASTLINE);
315 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffNotchBaseElev(dNotchBaseElev);
316 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffNotchDepth(dNotchDepth);
317 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetCliffRemaining(dRemaining);
318 }
319
320 else
321 {
322 // The cliff has collapsed: all sediment above the base of the erosional notch is gone from this cliff object via cliff collapse, so this cell is no longer a cliff
323 m_pRasterGrid->m_Cell[nX][nY].SetInContiguousSea();
324
325 // Check the x-y extremities of the contiguous sea for the bounding box (used later in wave propagation)
326 if (nX < m_nXMinBoundingBox)
328
329 if (nX > m_nXMaxBoundingBox)
331
332 if (nY < m_nYMinBoundingBox)
334
335 if (nY > m_nYMaxBoundingBox)
337
338// LogStream << m_ulIter << ": CLIFF REMOVED [" << nX << "][" << nY << "] = {" << dGridCentroidXToExtCRSX(nX) << ", " << dGridCentroidYToExtCRSY(nY) << "} is no longer a cliff landform" << endl;
339
340 int nTopLayer = m_pRasterGrid->m_Cell[nX][nY].nGetTopLayerAboveBasement();
341
342 // Safety check
343 if (nTopLayer == INT_NODATA)
345
346 // Update the cell's layer elevations
347 m_pRasterGrid->m_Cell[nX][nY].CalcAllLayerElevsAndD50();
348
349 // And update the cell's sea depth
350 m_pRasterGrid->m_Cell[nX][nY].SetSeaDepth();
351 }
352
353 // Always accumulate wave energy
354 m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->SetAccumWaveEnergy(pCliff->dGetTotAccumWaveEnergy());
355 }
356
357 else if (nCategory == LF_CAT_DRIFT)
358 {
359 // It's drift, so calculate D50 TODO 002 Why might we need this?
360
361 }
362
363 return RTN_OK;
364}
365
366//===============================================================================================================================
368//===============================================================================================================================
370{
371 // First pass: collect information about cells that need to be changed. This avoids race conditions from reading neighbour cells while writing to current cells
372 vector<vector<int>> vCellUpdates(m_nXGridSize, vector<int>(m_nYGridSize, -1));
373
374 // Read-only phase: determine what changes need to be made
375#ifdef _OPENMP
376 #pragma omp parallel for collapse(2)
377#endif
378
379 for (int nX = 0; nX < m_nXGridSize; nX++)
380 {
381 for (int nY = 0; nY < m_nYGridSize; nY++)
382 {
383 // Get this cell's landform category
384 CRWCellLandform* pLandform = m_pRasterGrid->m_Cell[nX][nY].pGetLandform();
385 int nCat = pLandform->nGetLFCategory();
386
387 // Store what action to take (to avoid writing during read phase)
388 int nAction = -1; // -1 = no change, others defined below
389
390 if (m_pRasterGrid->m_Cell[nX][nY].bBasementElevIsMissingValue())
391 {
392 nAction = 0; // Set to unknown landform
393 }
394
396 {
397 if (m_pRasterGrid->m_Cell[nX][nY].bIsInundated())
398 {
399 nAction = 1; // Set to submerged sediment input
400 }
401
402 else
403 {
404 nAction = 2; // Set to not submerged sediment input
405 }
406 }
407
408 else if (nCat == LF_CAT_SEA)
409 {
410 // This is a sea cell. Is it surrounded by drift cells, or drift and cliff?
411 if (bSurroundedByDriftCells(nX, nY))
412 {
413 nAction = 3; // Set to beach
414 }
415
416 else if (m_pRasterGrid->m_Cell[nX][nY].dGetSedimentTopElev() > m_dThisIterSWL)
417 {
418 nAction = 4; // Set to island
419 }
420
421 // else keep as sea (no action needed)
422 }
423
424 else if (! m_pRasterGrid->m_Cell[nX][nY].bIsCoastline())
425 {
426 // Is not coastline
427 if (nCat == LF_CAT_CLIFF)
428 {
429 nAction = 5; // Set to former cliff
430 }
431
432 else if ((nCat != LF_CAT_DRIFT) && (nCat != LF_CAT_INTERVENTION) &&
435 {
436 nAction = 6; // Set to hinterland
437 }
438 }
439
440 vCellUpdates[nX][nY] = nAction;
441 }
442 }
443
444 // Write phase: apply the changes
445 for (int nX = 0; nX < m_nXGridSize; nX++)
446 {
447 for (int nY = 0; nY < m_nYGridSize; nY++)
448 {
449 int nAction = vCellUpdates[nX][nY];
450
451 if (nAction == -1)
452 continue; // No change
453
454 CRWCellLandform* pLandform = m_pRasterGrid->m_Cell[nX][nY].pGetLandform();
455
456 switch (nAction)
457 {
458 case 0: // Set to unknown landform
459 pLandform->SetLFCategory(LF_NONE);
460 break;
461
462 case 1: // Set to submerged sediment input
464 m_pRasterGrid->m_Cell[nX][nY].SetInContiguousSea();
465 break;
466
467 case 2: // Set to not submerged sediment input
469 break;
470
471 case 3: // Set to beach
473 break;
474
475 case 4: // Set to island
476 pLandform->SetLFCategory(LF_CAT_ISLAND);
477 break;
478
479 case 5: // Set to former cliff
481 break;
482
483 case 6: // Set to hinterland
485 break;
486 }
487 }
488 }
489
490 return RTN_OK;
491}
492//===============================================================================================================================
494//===============================================================================================================================
495bool CSimulation::bSurroundedByDriftCells(int const nX, int const nY)
496{
497 int nXTmp;
498 int nYTmp;
499 int nAdjacent = 0;
500
501 // North
502 nXTmp = nX;
503 nYTmp = nY - 1;
504
505 if (bIsWithinValidGrid(nXTmp, nYTmp))
506 {
507 CRWCellLandform const* pLandform = m_pRasterGrid->m_Cell[nXTmp][nYTmp].pGetLandform();
508 int nCat = pLandform->nGetLFCategory();
509
510 if ((nCat == LF_CAT_DRIFT) || (nCat == LF_CAT_CLIFF))
511 nAdjacent++;
512 }
513
514 // East
515 nXTmp = nX + 1;
516 nYTmp = nY;
517
518 if (bIsWithinValidGrid(nXTmp, nYTmp))
519 {
520 CRWCellLandform const* pLandform = m_pRasterGrid->m_Cell[nXTmp][nYTmp].pGetLandform();
521 int nCat = pLandform->nGetLFCategory();
522
523 if ((nCat == LF_CAT_DRIFT) || (nCat == LF_CAT_CLIFF))
524 nAdjacent++;
525 }
526
527 // South
528 nXTmp = nX;
529 nYTmp = nY + 1;
530
531 if (bIsWithinValidGrid(nXTmp, nYTmp))
532 {
533 CRWCellLandform const* pLandform = m_pRasterGrid->m_Cell[nXTmp][nYTmp].pGetLandform();
534 int nCat = pLandform->nGetLFCategory();
535
536 if ((nCat == LF_CAT_DRIFT) || (nCat == LF_CAT_CLIFF))
537 nAdjacent++;
538 }
539
540 // West
541 nXTmp = nX - 1;
542 nYTmp = nY;
543
544 if (bIsWithinValidGrid(nXTmp, nYTmp))
545 {
546 CRWCellLandform const* pLandform = m_pRasterGrid->m_Cell[nXTmp][nYTmp].pGetLandform();
547 int nCat = pLandform->nGetLFCategory();
548
549 if ((nCat == LF_CAT_DRIFT) || (nCat == LF_CAT_CLIFF))
550 nAdjacent++;
551 }
552
553 if (nAdjacent == 4)
554 {
555 // This cell has four LF_CAT_DRIFT neighbours
556 return true;
557 }
558
559 return false;
560}
Abstract class, used as a base class for landform objects on the coastline.
double dGetTotAccumWaveEnergy(void) const
Get total accumulated wave energy.
int nGetLandFormCategory(void) const
Get the landform category.
Real-world class used to represent the landform of a cell.
int nGetLFCategory(void) const
Get the landform category.
void SetLFCategory(int const)
Set the landform category.
void SetLFSubCategory(int const)
Set the both the landform sub-category, and the landform category.
Real-world class used to represent the 'cliff' category of coastal landform object.
Definition cliff.h:33
bool bHasCollapsed(void) const
Returns the value of the cliff collapse switch.
Definition cliff.cpp:58
double dGetNotchBaseElev(void) const
Returns the elevation of the base of the erosional notch.
Definition cliff.cpp:70
double dGetNotchDepth(void) const
Returns the horizontal depth of the cliff's erosional notch (the 'overhang')
Definition cliff.cpp:94
double dGetRemaining(void) const
Returns the length (in external CRS units) of the cliff's remaining sediment 'behind' the erosional n...
Definition cliff.cpp:82
Real-world class used to represent the 'drift' category of coastal landform object.
Definition drift.h:33
Real-world class used to represent the 'intervention' category of coastal landform objects.
int m_nYMinBoundingBox
The minimum y value of the bounding box.
Definition simulation.h:558
double m_dThisIterSWL
Definition simulation.h:748
CGeomRasterGrid * m_pRasterGrid
Pointer to the raster grid object.
int m_nXGridSize
The size of the grid in the x direction.
Definition simulation.h:462
int nAssignLandformsForAllCoasts(void)
Each timestep, classify coastal landforms and assign a coastal landform object to every point on ever...
ofstream LogStream
vector< CRWCoast > m_VCoast
The coastline objects.
int m_nYGridSize
The size of the grid in the y direction.
Definition simulation.h:465
int m_nXMaxBoundingBox
The maximum x value of the bounding box.
Definition simulation.h:555
double m_dNotchBaseBelowSWL
Notch base below SWL (m)
Definition simulation.h:976
double dGridCentroidYToExtCRSY(int const) const
Given the integer Y-axis ordinate of a cell in the raster grid CRS, returns the external CRS Y-axis o...
Definition gis_utils.cpp:70
int nAssignLandformsForAllCells(void)
Each timestep, classify landforms for cells that are not on the coastline.
bool bSurroundedByDriftCells(int const, int const)
Returns true if this cell has four drift cells surrounding it.
int m_nYMaxBoundingBox
The maximum y value of the bounding box.
Definition simulation.h:561
int m_nXMinBoundingBox
The minimum x value of the bounding box.
Definition simulation.h:552
bool bIsWithinValidGrid(int const, int const) const
Checks whether the supplied point (an x-y pair, in the grid CRS) is within the raster grid,...
unsigned long m_ulIter
The number of the current iteration (time step)
Definition simulation.h:618
double dGridCentroidXToExtCRSX(int const) const
Given the integer X-axis ordinate of a cell in the raster grid CRS, returns the external CRS X-axis o...
Definition gis_utils.cpp:62
double m_dCellSide
Length of a cell side (in external CRS units)
Definition simulation.h:689
bool bIsInterventionCell(int const, int const) const
Returns true if the cell is an intervention.
Definition utils.cpp:2918
double m_dThisIterMeanSWL
Definition simulation.h:752
int nLandformToGrid(int const, int const)
At the end of each timestep, this routine stores the attributes from a single coastal landform object...
Contains CRWCliff definitions.
This file contains global definitions for CoastalME.
int const LF_SUBCAT_DRIFT_BEACH
Definition cme.h:552
int const INT_NODATA
Definition cme.h:474
int const RTN_ERR_NO_TOP_LAYER
Definition cme.h:738
int const LF_CAT_SEA
Definition cme.h:534
int const LF_SUBCAT_CLIFF_ON_COASTLINE
Definition cme.h:546
int const ELEV_ABOVE_SEDIMENT_TOP
Definition cme.h:766
int const LF_CAT_SEDIMENT_INPUT
Definition cme.h:536
int const LF_CAT_SEDIMENT_INPUT_SUBMERGED
Definition cme.h:537
int const LF_CAT_DRIFT
Definition cme.h:542
int const LF_SUBCAT_CLIFF_INLAND
Definition cme.h:547
int const RTN_OK
Definition cme.h:692
int const LF_SUBCAT_DRIFT_MIXED
Definition cme.h:550
int const LF_CAT_SEDIMENT_INPUT_NOT_SUBMERGED
Definition cme.h:538
int const LF_NONE
Definition cme.h:530
int const RTN_ERR_CANNOT_ASSIGN_COASTAL_LANDFORM
Definition cme.h:742
int const ELEV_IN_BASEMENT
Definition cme.h:765
int const LF_CAT_CLIFF
Definition cme.h:541
int const LF_CAT_ISLAND
Definition cme.h:535
int const LF_CAT_HINTERLAND
Definition cme.h:533
int const LF_CAT_INTERVENTION
Definition cme.h:543
Contains CRWCoast definitions.
Contains CRWDrift definitions.
Contains CRWIntervention definitions.
Contains CSimulation definitions.