93 static bool bDownCoast =
true;
96 for (
int nCoast = 0; nCoast < static_cast<int>(
m_VCoast.size()); nCoast++)
98 int const nNumProfiles =
m_VCoast[nCoast].nGetNumProfiles();
101 for (
int nn = 0; nn < nNumProfiles; nn++)
106 pProfile =
m_VCoast[nCoast].pGetProfileWithDownCoastSeq(nn);
108 pProfile =
m_VCoast[nCoast].pGetProfileWithUpCoastSeq(nn);
116 for (
int nn = 0; nn < nNumProfiles - 1; nn++)
132 bDownCoast = ! bDownCoast;
145 if (
m_pRasterGrid->m_Cell[nX][nY].bPotentialPlatformErosion())
175 double const dDepthOfBreaking =
m_VCoast[nCoast].dGetDepthOfBreaking(nCoastPoint);
193 double const dBreakingWaveHeight =
m_VCoast[nCoast].dGetBreakingWaveHeight(nCoastPoint);
197 double dProfileLenXY = 0;
199 for (
int nSeg = 0; nSeg < nSegments; nSeg++)
207 double const dSegLen = hypot(dSegStartX - dSegEndX, dSegStartY - dSegEndY);
208 dProfileLenXY += dSegLen;
212 double const dSpacingXY = dProfileLenXY / (nProfSize - 1);
215 vector<double> VdProfileZ(nProfSize, 0);
216 vector<double> VdProfileDistXY(nProfSize, 0);
217 vector<double> dVConsProfileZ(nProfSize, 0);
218 vector<double> dVConsZDiff(nProfSize, 0);
219 vector<double> dVConsSlope(nProfSize, 0);
221 for (
int i = 0; i < nProfSize; i++)
227 int const nTopLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
238 dVConsProfileZ[i] =
m_pRasterGrid->m_Cell[nX][nY].dGetConsSedTopElevForLayerAboveBasement(nTopLayer);
241 VdProfileZ[i] =
m_pRasterGrid->m_Cell[nX][nY].dGetAllSedTopElevOmitTalus();
244 VdProfileDistXY[i] = i * dSpacingXY;
247 for (
int i = 0; i < nProfSize - 1; i++)
250 dVConsZDiff[i] = dVConsProfileZ[i] - dVConsProfileZ[i + 1];
253 dVConsSlope[i] = dVConsZDiff[i] / dSpacingXY;
257 dVConsSlope[nProfSize - 1] = dVConsSlope[nProfSize - 2];
265 vector<double> dVProfileDepthOverDB(nProfSize, 0);
266 vector<double> dVProfileErosionPotential(nProfSize, 0);
269 double dTotalErosionPotential = 0;
271 for (
int i = 0; i < nProfSize; i++)
275 dVProfileDepthOverDB[i] /= dDepthOfBreaking;
278 dVProfileDepthOverDB[i] =
tMax(dVProfileDepthOverDB[i], 0.0);
286 dVProfileErosionPotential[i] = 0;
289 dTotalErosionPotential += dVProfileErosionPotential[i];
293 for (
int i = 0; i < nProfSize; i++)
295 if (dTotalErosionPotential < 0)
296 dVProfileErosionPotential[i] /= (-dTotalErosionPotential);
299 vector<double> dVRecessionXY(nProfSize, 0);
300 vector<double> dVSCAPEXY(nProfSize, 0);
303 for (
int i = 0; i < nProfSize; i++)
319 dVRecessionXY[i] =
tMin(
m_VCoast[nCoast].dGetWaveEnergyAtBreaking(nCoastPoint) * dVProfileErosionPotential[i] * dVConsSlope[i] /
m_dR, 0.0);
320 dVSCAPEXY[i] = VdProfileDistXY[i] - dVRecessionXY[i];
323 vector<double> dVChangeElevZ(nProfSize, 0);
326 for (
int i = 1; i < nProfSize - 1; i++)
329 double const dSCAPEHorizDist = dVSCAPEXY[i + 1] - dVSCAPEXY[i];
330 double const dSCAPEVertDist = dVConsProfileZ[i] - dVConsProfileZ[i + 1];
331 double const dSCAPESlope = dSCAPEVertDist / dSCAPEHorizDist;
332 double dDeltaZ = dVRecessionXY[i] * dSCAPESlope;
342 m_pRasterGrid->m_Cell[nX][nY].SetLocalConsSlope(dVConsSlope[i]);
348 double const dPrevPotentialErosion = -
m_pRasterGrid->m_Cell[nX][nY].dGetPotentialPlatformErosion();
350 if (dPrevPotentialErosion < 0)
354 dDeltaZ = ((dDeltaZ + dPrevPotentialErosion) / 2);
358 dDeltaZ =
tMax(dDeltaZ, -dVConsZDiff[i]);
359 dDeltaZ =
tMin(dDeltaZ, 0.0);
360 dVChangeElevZ[i] = dDeltaZ;
363 m_pRasterGrid->m_Cell[nX][nY].SetPotentialPlatformErosion(-dDeltaZ);
376 m_pRasterGrid->m_Cell[nX][nY].SetBeachProtectionFactor(dBeachProtectionFactor);
382 int const nRet =
nSaveProfile(nCoast, pProfile, nProfSize, &VdProfileDistXY, &dVConsProfileZ, &dVProfileDepthOverDB, &dVProfileErosionPotential, &dVConsSlope, &dVRecessionXY, &dVChangeElevZ, pProfile->
pPtiVGetCellsInProfile(), &dVSCAPEXY);
403 int const nCoastMax =
m_VCoast[nCoast].nGetCoastlineSize();
404 int nDistFromProfile = 0;
405 int nParCoastXLast = nProfileStartX;
406 int nParCoastYLast = nProfileStartY;
415 int nThisPointOnCoast = nCoastProfileStart;
418 nThisPointOnCoast += nDistFromProfile;
420 nThisPointOnCoast -= nDistFromProfile;
438 double dDepthOfBreaking =
m_VCoast[nCoast].dGetDepthOfBreaking(nThisPointOnCoast);
451 int const nParCoastX =
m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(nThisPointOnCoast)->nGetX();
452 int const nParCoastY =
m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(nThisPointOnCoast)->nGetY();
454 if ((nParCoastX == nParCoastXLast) && (nParCoastY == nParCoastYLast))
465 if (
m_pRasterGrid->m_Cell[nParCoastX][nParCoastY].bIsProfile())
472 double const dBreakingWaveHeight =
m_VCoast[nCoast].dGetBreakingWaveHeight(nThisPointOnCoast);
475 vector<CGeom2DIPoint> PtiVGridParProfile;
476 vector<CGeom2DPoint> PtVExtCRSParProfile;
480 int const nParProfSize =
static_cast<int>(PtiVGridParProfile.size());
483 if (nParProfSize < 3)
486 nParCoastXLast = nParCoastX;
487 nParCoastYLast = nParCoastY;
493 double const dParProfileLenXY =
dGetDistanceBetween(&PtVExtCRSParProfile[0], &PtVExtCRSParProfile[nParProfSize - 1]);
496 double dParSpacingXY = dParProfileLenXY / (nParProfSize - 1);
504 vector<double> dVParProfileZ(nParProfSize, 0);
505 vector<double> dVParProfileDistXY(nParProfSize, 0);
506 vector<double> dVParConsProfileZ(nParProfSize, 0);
507 vector<double> dVParConsZDiff(nParProfSize, 0);
508 vector<double> dVParConsSlope(nParProfSize, 0);
510 for (
int i = 0; i < nParProfSize; i++)
512 int const nXPar = PtiVGridParProfile[i].nGetX();
513 int const nYPar = PtiVGridParProfile[i].nGetY();
524 int const nPolyID =
m_pRasterGrid->m_Cell[nXPar][nYPar].nGetPolygonID();
534 int const nTopLayer =
m_pRasterGrid->m_Cell[nXPar][nYPar].nGetTopNonZeroLayerAboveBasement();
545 dVParConsProfileZ[i] =
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetConsSedTopElevForLayerAboveBasement(nTopLayer);
548 dVParProfileZ[i] =
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetAllSedTopElevOmitTalus();
551 dVParProfileDistXY[i] = i * dParSpacingXY;
554 for (
int i = 0; i < nParProfSize - 1; i++)
557 dVParConsZDiff[i] = dVParConsProfileZ[i] - dVParConsProfileZ[i + 1];
560 dVParConsSlope[i] = dVParConsZDiff[i] / dParSpacingXY;
564 dVParConsSlope[nParProfSize - 1] = dVParConsSlope[nParProfSize - 2];
573 vector<double> dVParProfileDepthOverDB(nParProfSize, 0);
574 vector<double> dVParProfileErosionPotential(nParProfSize, 0);
577 double dTotalErosionPotential = 0;
580 if (dDepthOfBreaking <= 0.0)
581 dDepthOfBreaking = 1e-10;
583 for (
int i = 0; i < nParProfSize; i++)
587 dVParProfileDepthOverDB[i] /= dDepthOfBreaking;
590 dVParProfileDepthOverDB[i] =
tMax(dVParProfileDepthOverDB[i], 0.0);
598 dVParProfileErosionPotential[i] = 0;
601 dTotalErosionPotential += dVParProfileErosionPotential[i];
605 for (
int i = 0; i < nParProfSize; i++)
607 if (dTotalErosionPotential < 0)
608 dVParProfileErosionPotential[i] /= (-dTotalErosionPotential);
611 vector<double> dVParRecessionXY(nParProfSize, 0);
612 vector<double> dVParSCAPEXY(nParProfSize, 0);
615 for (
int i = 0; i < nParProfSize; i++)
633 dVParRecessionXY[i] =
tMin(
m_VCoast[nCoast].dGetWaveEnergyAtBreaking(nThisPointOnCoast) * dVParProfileErosionPotential[i] * dVParConsSlope[i] /
m_dR, 0.0);
634 dVParSCAPEXY[i] = dVParProfileDistXY[i] - dVParRecessionXY[i];
639 vector<double> dVParDeltaZ(nParProfSize, 0);
642 for (
int i = 1; i < nParProfSize - 1; i++)
645 double const dSCAPEHorizDist = dVParSCAPEXY[i + 1] - dVParSCAPEXY[i];
651 double const dSCAPEVertDist = dVParConsProfileZ[i] - dVParConsProfileZ[i + 1];
652 double const dSCAPESlope = dSCAPEVertDist / dSCAPEHorizDist;
653 double dDeltaZ = dVParRecessionXY[i] * dSCAPESlope;
659 int const nXPar = PtiVGridParProfile[i].nGetX();
660 int const nYPar = PtiVGridParProfile[i].nGetY();
663 m_pRasterGrid->m_Cell[nXPar][nYPar].SetLocalConsSlope(dVParConsSlope[i]);
669 if (
m_pRasterGrid->m_Cell[nXPar][nYPar].bPotentialPlatformErosion())
672 double const dPrevPotentialErosion = -
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetPotentialPlatformErosion();
677 dDeltaZ =
tMin(dPrevPotentialErosion, dDeltaZ);
691 dDeltaZ =
tMax(dDeltaZ, -dVParConsZDiff[i]);
692 dDeltaZ =
tMin(dDeltaZ, 0.0);
693 dVParDeltaZ[i] = dDeltaZ;
696 m_pRasterGrid->m_Cell[nXPar][nYPar].SetPotentialPlatformErosion(-dDeltaZ);
712 m_pRasterGrid->m_Cell[nXPar][nYPar].SetBeachProtectionFactor(dBeachProtectionFactor);
718 int const nRet =
nSaveParProfile(nCoast, pProfile, nParProfSize, nDirection, nDistFromProfile, &dVParProfileDistXY, &dVParConsProfileZ, &dVParProfileDepthOverDB, &dVParProfileErosionPotential, &dVParConsSlope, &dVParRecessionXY, &dVParDeltaZ, pProfile->
pPtiVGetCellsInProfile(), &dVParSCAPEXY);
725 nParCoastXLast = nParCoastX;
726 nParCoastYLast = nParCoastY;
740 double const dBeachProtectionFactor =
m_pRasterGrid->m_Cell[nX][nY].dGetBeachProtectionFactor();
747 double const dThisPotentialErosion =
m_pRasterGrid->m_Cell[nX][nY].dGetPotentialPlatformErosion() * dBeachProtectionFactor;
750 int const nThisLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
755 cerr <<
ERR <<
"no sediment layer in DoActualPlatformErosionOnCell()" << endl;
764 double const dExistingAvailableFine =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetFineDepth();
765 double const dExistingAvailableSand =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetSandDepth();
766 double const dExistingAvailableCoarse =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetCoarseDepth();
769 int const nFineWeight = (dExistingAvailableFine > 0 ? 1 : 0);
770 int const nSandWeight = (dExistingAvailableSand > 0 ? 1 : 0);
771 int const nCoarseWeight = (dExistingAvailableCoarse > 0 ? 1 : 0);
774 double dTotActualErosion = 0;
775 double dSandEroded = 0;
776 double dCoarseEroded = 0;
784 double const dFineEroded =
tMin(dExistingAvailableFine, dFineLowering);
785 double const dRemaining = dExistingAvailableFine - dFineEroded;
787 dTotActualErosion += dFineEroded;
790 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetFineDepth(dRemaining);
806 dSandEroded =
tMin(dExistingAvailableSand, dSandLowering);
807 double const dRemaining = dExistingAvailableSand - dSandEroded;
809 dTotActualErosion += dSandEroded;
812 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetSandDepth(dRemaining);
815 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetUnconsolidatedSediment()->AddSandDepth(dSandEroded);
830 dCoarseEroded =
tMin(dExistingAvailableCoarse, dCoarseLowering);
831 double const dRemaining = dExistingAvailableCoarse - dCoarseEroded;
833 dTotActualErosion += dCoarseEroded;
836 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetCoarseDepth(dRemaining);
839 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetUnconsolidatedSediment()->AddCoarseDepth(dCoarseEroded);
849 if (dTotActualErosion > 0)
852 m_pRasterGrid->m_Cell[nX][nY].SetActualPlatformErosion(dTotActualErosion);
865 int nPolyCoastID =
m_pRasterGrid->m_Cell[nX][nY].nGetPolygonCoastID();
871 shuffle(nDirection.begin(), nDirection.end(),
m_Rand[0]);
873 for (
int n = 0; n < 8; n++)
878 if (nDirection[n] ==
NORTH)
885 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
889 nPolyCoastID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonCoastID();
901 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
905 nPolyCoastID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonCoastID();
910 else if (nDirection[n] ==
EAST)
917 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
921 nPolyCoastID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonCoastID();
933 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
937 nPolyCoastID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonCoastID();
942 else if (nDirection[n] ==
SOUTH)
949 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
953 nPolyCoastID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonCoastID();
965 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
969 nPolyCoastID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonCoastID();
974 else if (nDirection[n] ==
WEST)
981 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
985 nPolyCoastID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonCoastID();
995 if ((nXAdj >= 0) && (nYAdj >= 0))
997 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
1001 nPolyCoastID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonCoastID();
1026 m_VCoast[nPolyCoastID].pGetPolygon(nPolyID)->AddPlatformErosionUnconsSand(dSandEroded);
1027 m_VCoast[nPolyCoastID].pGetPolygon(nPolyID)->AddPlatformErosionUnconsCoarse(dCoarseEroded);
1037 vector<double> VdDepthOverDB;
1038 double dTempDOverDB = 0;
1040 while (dTempDOverDB <= 1.1)
1042 VdDepthOverDB.push_back(dTempDOverDB);
1048 int const nSize =
static_cast<int>(VdDepthOverDB.size());
1049 vector<double> VdDeriv(nSize, 0);
1050 vector<double> VdDeriv2(nSize, 0.);
1051 vector<double> VdDeriv3(nSize, 0.);
1054 hermite_cubic_spline_value(
static_cast<int>(VdDepthOverDBIn->size()), &(VdDepthOverDBIn->at(0)), &(VdErosionPotentialIn->at(0)), &(VdErosionPotentialFirstDerivIn->at(0)), nSize, &(VdDepthOverDB[0]), &(
m_VdErosionPotential[0]), &(VdDeriv[0]), &(VdDeriv2[0]), &(VdDeriv3[0]));
1059 for (
int n = 1; n < nSize - 1; n++)
1096 return dErosionPotential;
1109 int const nThisLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
1114 cerr <<
ERR <<
"no sediment layer in dCalcBeachProtectionFactor()" << endl;
1123 double const dBeachDepth =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->dGetAllUnconsDepth();
1127 if (dMaxPenetrationDepth > 0)
1128 dFactor =
tMax(1 - (dBeachDepth / dMaxPenetrationDepth), 0.0);
1145 double const dNotchApexElev =
m_pRasterGrid->m_Cell[nX][nY].pGetLandform()->dGetCliffNotchApexElev();
1149 double const dSedTopElevNoTalus =
m_pRasterGrid->m_Cell[nX][nY].dGetAllSedTopElevOmitTalus();
1150 if (dNotchApexElev >= dSedTopElevNoTalus)
1157 int const nTopLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
1185 double dBeachProtection = 0;
1194 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1204 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1214 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1224 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1230 m_pRasterGrid->m_Cell[nX][nY].SetBeachProtectionFactor(dBeachProtection / 4);
1252 double dPotentialPlatformErosion = 0;
1261 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1271 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1281 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1291 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1297 double const dThisPotentialPlatformErosion = dPotentialPlatformErosion / 4;
1299 m_pRasterGrid->m_Cell[nX][nY].SetPotentialPlatformErosion(dThisPotentialPlatformErosion);
1318void CSimulation::ConstructParallelProfile(
int const nProfileStartX,
int const nProfileStartY,
int const nParCoastX,
int const nParCoastY,
int const nProfSize, vector<CGeom2DIPoint> *
const pPtViGridProfile, vector<CGeom2DIPoint> *pPtiVGridParProfile, vector<CGeom2DPoint> *pPtVExtCRSParProfile)
1321 int const nXOffset = nParCoastX - nProfileStartX;
1322 int const nYOffset = nParCoastY - nProfileStartY;
1325 for (
int nProfileStartPoint = 0; nProfileStartPoint < nProfSize; nProfileStartPoint++)
1328 int const nXProf = pPtViGridProfile->at(nProfileStartPoint).nGetX();
1329 int const nYProf = pPtViGridProfile->at(nProfileStartPoint).nGetY();
1332 int const nXPar = nXProf + nXOffset;
1333 int const nYPar = nYProf + nYOffset;
1350 pPtiVGridParProfile->push_back(
CGeom2DIPoint(nXPar, nYPar));
Contains CGeom2DIPoint definitions.
Geometry class used to represent 2D point objects with integer coordinates.
Geometry class used to represent 2D point objects with floating-point coordinates.
double dGetY(void) const
Returns the CGeom2DPoint object's double Y coordinate.
double dGetX(void) const
Returns the CGeom2DPoint object's double X coordinate.
Geometry class used to represent coast profile objects.
int nGetProfileID(void) const
Returns the profile's this-coast ID.
int nGetCoastPoint(void) const
Returns the coast point at which the profile starts.
int nGetNumCellsInProfile(void) const
Returns the number of cells in the profile.
CGeom2DPoint * pPtGetPointInProfile(int const)
Returns a single point (external CRS) from the profile.
bool bOKIncStartAndEndOfCoast(void) const
Returns true if this is a problem-free profile (however it could be a start-of-coast or an end-of-coa...
int nGetProfileSize(void) const
Returns the number of external CRS points in the profile (only two, initally; and always just two for...
vector< CGeom2DIPoint > * pPtiVGetCellsInProfile(void)
Returns all cells (grid CRS) in the profile.
Real-world class used to represent the sediment layers associated with a cell object.
bool bHasTalus(void)
Returns true if the layer has talus, false otherwise.
bool bHasUncons(void)
Return true if the layer has unconsolidated sediment, false otherwise.
int m_nLogFileDetail
The level of detail in the log file output. Can be LOG_FILE_LOW_DETAIL, LOG_FILE_MIDDLE_DETAIL,...
double m_dThisIterSWL
The still water level for this timestep (this includes tidal changes and any long-term SWL change)
CGeomRasterGrid * m_pRasterGrid
Pointer to the raster grid object.
int m_nXGridSize
The size of the grid in the x direction.
vector< CRWCoast > m_VCoast
The coastline objects.
double m_dFineErodibilityNormalized
Relative erodibility of fine unconsolidated beach sediment, normalized.
double m_dThisIterActualPlatformErosionCoarseCons
Total actual platform erosion (coarse consolidated sediment) for this iteration (depth in m)
int nDoAllShorePlatFormErosion(void)
Does platform erosion on all coastlines by first calculating platform erosion on coastline-normal pro...
int m_nYGridSize
The size of the grid in the y direction.
vector< double > m_VdErosionPotential
For erosion potential lookup.
void ConstructParallelProfile(int const, int const, int const, int const, int const, vector< CGeom2DIPoint > *const, vector< CGeom2DIPoint > *, vector< CGeom2DPoint > *)
Constructs a parallel coastline-normal profile.
int nSaveParProfile(int const, CGeomProfile const *, int const, int const, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Save a coastline-normal parallel profile.
static double dGetDistanceBetween(CGeom2DPoint const *, CGeom2DPoint const *)
Returns the distance (in external CRS) between two points.
double m_dCoarseErodibilityNormalized
Relative erodibility of coarse unconsolidated beach sediment, normalized.
vector< double > m_VdDepthOverDB
For erosion potential lookup.
double m_dTotPotentialPlatformErosionBetweenProfiles
Total potential platform erosion between profiles.
double m_dDepositionCoarseDiff
Error term: if we are unable to deposit enough unconslidated coarse on polygon(s),...
unsigned long m_ulThisIterNumActualPlatformErosionCells
The number of grid cells on which actual platform erosion occurs, for this iteration.
int nCalcPotentialPlatformErosionBetweenProfiles(int const, CGeomProfile *, int const)
Calculates potential platform erosion on cells to one side of a given coastline-normal profile,...
double m_dDepositionSandDiff
Error term: if we are unable to deposit enough unconslidated sand on polygon(s), this is held over to...
int nSaveProfile(int const, CGeomProfile const *, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Save a coastline-normal profile.
double m_dThisIterPotentialPlatformErosion
Total potential platform erosion (all size classes of consolidated sediment) for this iteration (dept...
vector< double > dVSmoothProfileSlope(vector< double > *) const
Does running-mean smoothing of the slope of a coastline-normal profile.
double m_dDepthOverDBMax
Maximum value of deoth over DB, is used in erosion potential look-up function.
double m_dSandErodibilityNormalized
Relative erodibility of sand unconsolidated beach sediment, normalized.
double m_dR
Coast platform resistance to erosion R, see Walkden & Hall, 2011.
double m_dThisIterActualPlatformErosionSandCons
Total actual platform erosion (sand consolidated sediment) for this iteration (depth in m)
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...
void FillInBeachProtectionHolesAndRemoveLegacyCliffs(void)
Fills in 'holes' in the beach protection i.e. orphan cells which get omitted because of rounding prob...
double m_dTotPotentialPlatformErosionOnProfiles
Total potential platform erosion on profiles.
int nCalcPotentialPlatformErosionOnProfile(int const, CGeomProfile *)
Calculates potential (i.e. unconstrained by available sediment) erosional lowering of the shore platf...
void DoActualPlatformErosionOnCell(int const, int const)
Calculates actual (constrained by available sediment) erosion of the consolidated shore platform on a...
double m_dThisIterFineSedimentToSuspension
Total fine unconsolidated sediment in suspension for this iteration (depth in m)
void FillPotentialPlatformErosionHoles(void)
Fills in 'holes' in the potential platform erosion i.e. orphan cells which get omitted because of rou...
double dLookUpErosionPotential(double const)
The erosion potential lookup: it returns a value for erosion potential given a value of Depth Over DB...
unsigned long m_ulThisIterNumPotentialPlatformErosionCells
The number of grid cells on which potential platform erosion occurs, for this iteration.
default_random_engine m_Rand[NUMBER_OF_RNGS]
The c++11 random number generators.
unsigned long m_ulTotPotentialPlatformErosionOnProfiles
The number of cells on which on-profile average potential shore platform erosion occurs.
double m_dCellArea
Area of a cell (in external CRS units)
unsigned long m_ulTotPotentialPlatformErosionBetweenProfiles
The number of cells on which between-profile average potential shore platform erosion occurs.
bool m_bOutputConsolidatedProfileData
Output profile data?
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)
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...
double dGetInterpolatedValue(vector< double > const *, vector< double > const *, double, bool)
double dCalcBeachProtectionFactor(int const, int const, double const)
Calculates the (inverse) beach protection factor as in SCAPE: 0 is fully protected,...
bool bCreateErosionPotentialLookUp(vector< double > *, vector< double > *, vector< double > *)
Creates a look-up table for erosion potential, given depth over DB.
double m_dThisIterActualPlatformErosionFineCons
Total actual platform erosion (fine consolidated sediment) for this iteration (depth in m)
int m_nProfileSmoothWindow
The size of the window used for running-mean coast-normal profile smoothing (must be odd)
vector< bool > m_bConsChangedThisIter
One element per layer: has the consolidated sediment of this layer been changed during this iteration...
bool m_bOutputParallelProfileData
Output parallel profile data?
This file contains global definitions for CoastalME.
int const NO_NONZERO_THICKNESS_LAYERS
int const RTN_ERR_NO_TOP_LAYER
int const DIRECTION_DOWNCOAST
double const DEPTH_OVER_DB_INCREMENT
int const LOG_FILE_MIDDLE_DETAIL
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
int const LOG_FILE_HIGH_DETAIL
int const DIRECTION_UPCOAST
double const BEACH_PROTECTION_HB_RATIO
double const SED_ELEV_TOLERANCE
Contains CRWCoast definitions.
void hermite_cubic_spline_value(int const nn, double *const xn, double *const fn, double *const dn, int const n, double *const x, double *f, double *d, double *s, double *t)
This is part of a C++ library from http://people.sc.fsu.edu/~jburkardt/cpp_src/hermite_cubic/hermite_...
Definitions of some routines from the hermite_cubic library.
Contains CSimulation definitions.