35using std::setiosflags;
101 static bool bDownCoast =
true;
104 for (
int nCoast = 0; nCoast < static_cast<int>(
m_VCoast.size()); nCoast++)
106 int const nNumProfiles =
m_VCoast[nCoast].nGetNumProfiles();
109 for (
int nn = 0; nn < nNumProfiles; nn++)
114 pProfile =
m_VCoast[nCoast].pGetProfileWithDownCoastSeq(nn);
117 pProfile =
m_VCoast[nCoast].pGetProfileWithUpCoastSeq(nn);
126 for (
int nn = 0; nn < nNumProfiles - 1; nn++)
144 bDownCoast = ! bDownCoast;
157 if (
m_pRasterGrid->m_Cell[nX][nY].bPotentialPlatformErosion())
187 double dDepthOfBreaking =
m_VCoast[nCoast].dGetDepthOfBreaking(nCoastPoint);
205 double const dBreakingWaveHeight =
m_VCoast[nCoast].dGetBreakingWaveHeight(nCoastPoint);
209 double dProfileLenXY = 0;
211 for (
int nSeg = 0; nSeg < nSegments; nSeg++)
219 double const dSegLen = hypot(dSegStartX - dSegEndX, dSegStartY - dSegEndY);
220 dProfileLenXY += dSegLen;
224 double const dSpacingXY = dProfileLenXY / (nProfSize - 1);
228 vector<double> VdProfileZ(nProfSize, 0);
229 vector<double> VdProfileDistXY(nProfSize, 0);
230 vector<double> dVConsProfileZ(nProfSize, 0);
231 vector<double> dVConsZDiff(nProfSize, 0);
232 vector<double> dVConsSlope(nProfSize, 0);
234 for (
int i = 0; i < nProfSize; i++)
240 int const nTopLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
251 dVConsProfileZ[i] =
m_pRasterGrid->m_Cell[nX][nY].dGetConsSedTopForLayerAboveBasement(nTopLayer);
254 VdProfileZ[i] =
m_pRasterGrid->m_Cell[nX][nY].dGetSedimentTopElev();
257 VdProfileDistXY[i] = i * dSpacingXY;
260 for (
int i = 0; i < nProfSize - 1; i++)
263 dVConsZDiff[i] = dVConsProfileZ[i] - dVConsProfileZ[i + 1];
266 dVConsSlope[i] = dVConsZDiff[i] / dSpacingXY;
270 dVConsSlope[nProfSize - 1] = dVConsSlope[nProfSize - 2];
278 vector<double> dVProfileDepthOverDB(nProfSize, 0);
279 vector<double> dVProfileErosionPotential(nProfSize, 0);
282 double dTotalErosionPotential = 0;
284 for (
int i = 0; i < nProfSize; i++)
288 dVProfileDepthOverDB[i] /= dDepthOfBreaking;
291 dVProfileDepthOverDB[i] =
tMax(dVProfileDepthOverDB[i], 0.0);
299 dVProfileErosionPotential[i] = 0;
302 dTotalErosionPotential += dVProfileErosionPotential[i];
306 for (
int i = 0; i < nProfSize; i++)
308 if (dTotalErosionPotential < 0)
309 dVProfileErosionPotential[i] /= (-dTotalErosionPotential);
312 vector<double> dVRecessionXY(nProfSize, 0);
313 vector<double> dVSCAPEXY(nProfSize, 0);
316 for (
int i = 0; i < nProfSize; i++)
332 dVRecessionXY[i] =
tMin(
m_VCoast[nCoast].dGetWaveEnergyAtBreaking(nCoastPoint) * dVProfileErosionPotential[i] * dVConsSlope[i] /
m_dR, 0.0);
333 dVSCAPEXY[i] = VdProfileDistXY[i] - dVRecessionXY[i];
336 vector<double> dVChangeElevZ(nProfSize, 0);
339 for (
int i = 1; i < nProfSize - 1; i++)
342 double dSCAPEHorizDist = dVSCAPEXY[i + 1] - dVSCAPEXY[i];
343 double dSCAPEVertDist = dVConsProfileZ[i] - dVConsProfileZ[i + 1];
344 double dSCAPESlope = dSCAPEVertDist / dSCAPEHorizDist;
345 double dDeltaZ = dVRecessionXY[i] * dSCAPESlope;
357 m_pRasterGrid->m_Cell[nX][nY].SetLocalConsSlope(dVConsSlope[i]);
363 double dPrevPotentialErosion = -
m_pRasterGrid->m_Cell[nX][nY].dGetPotentialPlatformErosion();
365 if (dPrevPotentialErosion < 0)
369 dDeltaZ = ((dDeltaZ + dPrevPotentialErosion) / 2);
373 dDeltaZ =
tMax(dDeltaZ, -dVConsZDiff[i]);
374 dDeltaZ =
tMin(dDeltaZ, 0.0);
375 dVChangeElevZ[i] = dDeltaZ;
378 m_pRasterGrid->m_Cell[nX][nY].SetPotentialPlatformErosion(-dDeltaZ);
393 m_pRasterGrid->m_Cell[nX][nY].SetBeachProtectionFactor(dBeachProtectionFactor);
399 int nRet =
nSaveProfile(nCoast, pProfile, nProfSize, &VdProfileDistXY, &dVConsProfileZ, &dVProfileDepthOverDB, &dVProfileErosionPotential, &dVConsSlope, &dVRecessionXY, &dVChangeElevZ, pProfile->
pPtiVGetCellsInProfile(), &dVSCAPEXY);
421 int const nCoastMax =
m_VCoast[nCoast].nGetCoastlineSize();
422 int nDistFromProfile = 0;
423 int nParCoastXLast = nProfileStartX;
424 int nParCoastYLast = nProfileStartY;
433 int nThisPointOnCoast = nCoastProfileStart;
436 nThisPointOnCoast += nDistFromProfile;
439 nThisPointOnCoast -= nDistFromProfile;
459 double dDepthOfBreaking =
m_VCoast[nCoast].dGetDepthOfBreaking(nThisPointOnCoast);
473 int const nParCoastX =
m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(nThisPointOnCoast)->nGetX();
474 int const nParCoastY =
m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(nThisPointOnCoast)->nGetY();
476 if ((nParCoastX == nParCoastXLast) && (nParCoastY == nParCoastYLast))
480 LogStream <<
WARN <<
m_ulIter <<
": rounding problem on coast " << nCoast <<
" profile " << pProfile->
nGetCoastID() <<
" at [" << nParCoastX <<
"][" << nParCoastY <<
"]" << endl;
487 if (
m_pRasterGrid->m_Cell[nParCoastX][nParCoastY].bIsProfile())
494 double const dBreakingWaveHeight =
m_VCoast[nCoast].dGetBreakingWaveHeight(nThisPointOnCoast);
497 vector<CGeom2DIPoint> PtiVGridParProfile;
498 vector<CGeom2DPoint> PtVExtCRSParProfile;
502 int const nParProfSize =
static_cast<int>(PtiVGridParProfile.size());
505 if (nParProfSize < 3)
508 nParCoastXLast = nParCoastX;
509 nParCoastYLast = nParCoastY;
515 double const dParProfileLenXY =
dGetDistanceBetween(&PtVExtCRSParProfile[0], &PtVExtCRSParProfile[nParProfSize - 1]);
518 double dParSpacingXY = dParProfileLenXY / (nParProfSize - 1);
526 vector<double> dVParProfileZ(nParProfSize, 0);
527 vector<double> dVParProfileDistXY(nParProfSize, 0);
528 vector<double> dVParConsProfileZ(nParProfSize, 0);
529 vector<double> dVParConsZDiff(nParProfSize, 0);
530 vector<double> dVParConsSlope(nParProfSize, 0);
532 for (
int i = 0; i < nParProfSize; i++)
534 int const nXPar = PtiVGridParProfile[i].nGetX();
535 int const nYPar = PtiVGridParProfile[i].nGetY();
546 int nPolyID =
m_pRasterGrid->m_Cell[nXPar][nYPar].nGetPolygonID();
556 int const nTopLayer =
m_pRasterGrid->m_Cell[nXPar][nYPar].nGetTopNonZeroLayerAboveBasement();
567 dVParConsProfileZ[i] =
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetConsSedTopForLayerAboveBasement(nTopLayer);
570 dVParProfileZ[i] =
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetSedimentTopElev();
573 dVParProfileDistXY[i] = i * dParSpacingXY;
576 for (
int i = 0; i < nParProfSize - 1; i++)
579 dVParConsZDiff[i] = dVParConsProfileZ[i] - dVParConsProfileZ[i + 1];
582 dVParConsSlope[i] = dVParConsZDiff[i] / dParSpacingXY;
586 dVParConsSlope[nParProfSize - 1] = dVParConsSlope[nParProfSize - 2];
595 vector<double> dVParProfileDepthOverDB(nParProfSize, 0);
596 vector<double> dVParProfileErosionPotential(nParProfSize, 0);
599 double dTotalErosionPotential = 0;
602 if (dDepthOfBreaking <= 0.0)
603 dDepthOfBreaking = 1e-10;
605 for (
int i = 0; i < nParProfSize; i++)
609 dVParProfileDepthOverDB[i] /= dDepthOfBreaking;
612 dVParProfileDepthOverDB[i] =
tMax(dVParProfileDepthOverDB[i], 0.0);
620 dVParProfileErosionPotential[i] = 0;
623 dTotalErosionPotential += dVParProfileErosionPotential[i];
627 for (
int i = 0; i < nParProfSize; i++)
629 if (dTotalErosionPotential < 0)
630 dVParProfileErosionPotential[i] /= (-dTotalErosionPotential);
633 vector<double> dVParRecessionXY(nParProfSize, 0);
634 vector<double> dVParSCAPEXY(nParProfSize, 0);
637 for (
int i = 0; i < nParProfSize; i++)
655 dVParRecessionXY[i] =
tMin(
m_VCoast[nCoast].dGetWaveEnergyAtBreaking(nThisPointOnCoast) * dVParProfileErosionPotential[i] * dVParConsSlope[i] /
m_dR, 0.0);
656 dVParSCAPEXY[i] = dVParProfileDistXY[i] - dVParRecessionXY[i];
661 vector<double> dVParDeltaZ(nParProfSize, 0);
664 for (
int i = 1; i < nParProfSize - 1; i++)
667 double dSCAPEHorizDist = dVParSCAPEXY[i + 1] - dVParSCAPEXY[i];
673 double dSCAPEVertDist = dVParConsProfileZ[i] - dVParConsProfileZ[i + 1];
674 double dSCAPESlope = dSCAPEVertDist / dSCAPEHorizDist;
675 double dDeltaZ = dVParRecessionXY[i] * dSCAPESlope;
683 int const nXPar = PtiVGridParProfile[i].nGetX();
684 int const nYPar = PtiVGridParProfile[i].nGetY();
687 m_pRasterGrid->m_Cell[nXPar][nYPar].SetLocalConsSlope(dVParConsSlope[i]);
693 if (
m_pRasterGrid->m_Cell[nXPar][nYPar].bPotentialPlatformErosion())
696 double const dPrevPotentialErosion = -
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetPotentialPlatformErosion();
701 dDeltaZ =
tMin(dPrevPotentialErosion, dDeltaZ);
715 dDeltaZ =
tMax(dDeltaZ, -dVParConsZDiff[i]);
716 dDeltaZ =
tMin(dDeltaZ, 0.0);
717 dVParDeltaZ[i] = dDeltaZ;
720 m_pRasterGrid->m_Cell[nXPar][nYPar].SetPotentialPlatformErosion(-dDeltaZ);
736 m_pRasterGrid->m_Cell[nXPar][nYPar].SetBeachProtectionFactor(dBeachProtectionFactor);
742 int const nRet =
nSaveParProfile(nCoast, pProfile, nParProfSize, nDirection, nDistFromProfile, &dVParProfileDistXY, &dVParConsProfileZ, &dVParProfileDepthOverDB, &dVParProfileErosionPotential, &dVParConsSlope, &dVParRecessionXY, &dVParDeltaZ, pProfile->
pPtiVGetCellsInProfile(), &dVParSCAPEXY);
749 nParCoastXLast = nParCoastX;
750 nParCoastYLast = nParCoastY;
764 double const dBeachProtectionFactor =
m_pRasterGrid->m_Cell[nX][nY].dGetBeachProtectionFactor();
771 double dThisPotentialErosion =
m_pRasterGrid->m_Cell[nX][nY].dGetPotentialPlatformErosion() * dBeachProtectionFactor;
774 int nThisLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
779 cerr <<
ERR <<
"no sediment layer in DoActualPlatformErosionOnCell()" << endl;
788 double dExistingAvailableFine =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetFineDepth();
789 double dExistingAvailableSand =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetSandDepth();
790 double dExistingAvailableCoarse =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetCoarseDepth();
793 int nFineWeight = (dExistingAvailableFine > 0 ? 1 : 0);
794 int nSandWeight = (dExistingAvailableSand > 0 ? 1 : 0);
795 int nCoarseWeight = (dExistingAvailableCoarse > 0 ? 1 : 0);
798 double dTotActualErosion = 0;
799 double dSandEroded = 0;
800 double dCoarseEroded = 0;
808 double dFineEroded =
tMin(dExistingAvailableFine, dFineLowering);
809 double dRemaining = dExistingAvailableFine - dFineEroded;
811 dTotActualErosion += dFineEroded;
814 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetFineDepth(dRemaining);
830 dSandEroded =
tMin(dExistingAvailableSand, dSandLowering);
831 double dRemaining = dExistingAvailableSand - dSandEroded;
833 dTotActualErosion += dSandEroded;
836 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetSandDepth(dRemaining);
839 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetUnconsolidatedSediment()->AddSandDepth(dSandEroded);
854 dCoarseEroded =
tMin(dExistingAvailableCoarse, dCoarseLowering);
855 double dRemaining = dExistingAvailableCoarse - dCoarseEroded;
857 dTotActualErosion += dCoarseEroded;
860 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetCoarseDepth(dRemaining);
863 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetUnconsolidatedSediment()->AddCoarseDepth(dCoarseEroded);
873 if (dTotActualErosion > 0)
876 m_pRasterGrid->m_Cell[nX][nY].SetActualPlatformErosion(dTotActualErosion);
894 shuffle(nDirection.begin(), nDirection.end(),
m_Rand[0]);
896 for (
int n = 0; n < 8; n++)
901 if (nDirection[n] ==
NORTH)
908 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
922 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
929 else if (nDirection[n] ==
EAST)
936 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
950 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
957 else if (nDirection[n] ==
SOUTH)
964 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
978 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
985 else if (nDirection[n] ==
WEST)
992 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
1004 if ((nXAdj >= 0) && (nYAdj >= 0))
1006 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
1016 assert(nPolyID <
m_VCoast[0].nGetNumPolygons());
1044 vector<double> VdDepthOverDB;
1045 double dTempDOverDB = 0;
1047 while (dTempDOverDB <= 1.1)
1049 VdDepthOverDB.push_back(dTempDOverDB);
1055 int nSize =
static_cast<int>(VdDepthOverDB.size());
1056 vector<double> VdDeriv(nSize, 0);
1057 vector<double> VdDeriv2(nSize, 0.);
1058 vector<double> VdDeriv3(nSize, 0.);
1061 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]));
1066 for (
int n = 1; n < nSize - 1; n++)
1101 return dErosionPotential;
1114 int nThisLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
1119 cerr <<
ERR <<
"no sediment layer in dCalcBeachProtectionFactor()" << endl;
1128 double dBeachDepth =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->dGetUnconsolidatedThickness();
1132 if (dMaxPenetrationDepth > 0)
1133 dFactor =
tMax(1 - (dBeachDepth / dMaxPenetrationDepth), 0.0);
1155 double dBeachProtection = 0;
1164 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1174 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1184 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1194 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1200 m_pRasterGrid->m_Cell[nX][nY].SetBeachProtectionFactor(dBeachProtection / 4);
1222 double dPotentialPlatformErosion = 0;
1231 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1241 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1251 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1261 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1267 double dThisPotentialPlatformErosion = dPotentialPlatformErosion / 4;
1269 m_pRasterGrid->m_Cell[nX][nY].SetPotentialPlatformErosion(dThisPotentialPlatformErosion);
1288void 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)
1291 int nXOffset = nParCoastX - nProfileStartX;
1292 int nYOffset = nParCoastY - nProfileStartY;
1295 for (
int nProfileStartPoint = 0; nProfileStartPoint < nProfSize; nProfileStartPoint++)
1298 int nXProf = pPtViGridProfile->at(nProfileStartPoint).nGetX();
1299 int nYProf = pPtViGridProfile->at(nProfileStartPoint).nGetY();
1302 int nXPar = nXProf + nXOffset;
1303 int nYPar = nYProf + nYOffset;
1320 pPtiVGridParProfile->push_back(
CGeom2DIPoint(nXPar, nYPar));
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 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 in 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 nGetCoastID(void) const
Returns the profile's coast ID.
int nGetProfileSize(void) const
Returns the number of points in the profile.
vector< CGeom2DIPoint > * pPtiVGetCellsInProfile(void)
Returns all cells in the profile.
double dLookUpErosionPotential(double const) const
The erosion potential lookup: it returns a value for erosion potential given a value of Depth Over DB...
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
vector< CGeomCoastPolygon * > m_pVCoastPolygon
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.
void FillInBeachProtectionHoles(void)
Fills in 'holes' in the beach protection i.e. orphan cells which get omitted because of rounding prob...
double m_dTotPotentialPlatformErosionBetweenProfiles
Total potential platform erosion between profiles.
double m_dDepositionCoarseDiff
unsigned long m_ulThisIterNumActualPlatformErosionCells
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
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
vector< double > dVSmoothProfileSlope(vector< double > *) const
Does running-mean smoothing of the slope of a coastline-normal profile.
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
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...
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
void FillPotentialPlatformErosionHoles(void)
Fills in 'holes' in the potential platform erosion i.e. orphan cells which get omitted because of rou...
unsigned long m_ulThisIterNumPotentialPlatformErosionCells
default_random_engine m_Rand[NUMBER_OF_RNGS]
The c++11 random number generators.
unsigned long m_ulTotPotentialPlatformErosionOnProfiles
double m_dCellArea
Area of a cell (in external CRS units)
unsigned long m_ulTotPotentialPlatformErosionBetweenProfiles
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 dCalcBeachProtectionFactor(int const, int const, double const)
Calculates the (inverse) beach protection factor as in SCAPE: 0 is fully protected,...
bool m_bOutputProfileData
Output profile data?
bool bCreateErosionPotentialLookUp(vector< double > *, vector< double > *, vector< double > *)
Creates a look-up table for erosion potential, given depth over DB.
double m_dThisIterActualPlatformErosionFineCons
int m_nProfileSmoothWindow
vector< bool > m_bConsChangedThisIter
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
double const SEDIMENT_ELEV_TOLERANCE
int const DIRECTION_UPCOAST
double const BEACH_PROTECTION_HB_RATIO
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.
double dGetInterpolatedValue(vector< double > const *pVdXdata, vector< double > const *pVdYdata, double dX, bool bExtrapolate)
Definitions of routines which return interpolated value at x from parallel arrays.
Contains CSimulation definitions.