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++)
113 pProfile =
m_VCoast[nCoast].pGetProfileWithDownCoastSeq(nn);
115 pProfile =
m_VCoast[nCoast].pGetProfileWithUpCoastSeq(nn);
123 for (
int nn = 0; nn < nNumProfiles - 1; nn++)
139 bDownCoast = ! bDownCoast;
152 if (
m_pRasterGrid->m_Cell[nX][nY].bPotentialPlatformErosion())
182 double dDepthOfBreaking =
m_VCoast[nCoast].dGetDepthOfBreaking(nCoastPoint);
199 double const dBreakingWaveHeight =
m_VCoast[nCoast].dGetBreakingWaveHeight(nCoastPoint);
203 double dProfileLenXY = 0;
204 for (
int nSeg = 0; nSeg < nSegments; nSeg++)
212 double const dSegLen = hypot(dSegStartX - dSegEndX, dSegStartY - dSegEndY);
213 dProfileLenXY += dSegLen;
217 double const dSpacingXY = dProfileLenXY / (nProfSize - 1);
221 vector<double> VdProfileZ(nProfSize, 0);
222 vector<double> VdProfileDistXY(nProfSize, 0);
223 vector<double> dVConsProfileZ(nProfSize, 0);
224 vector<double> dVConsZDiff(nProfSize, 0);
225 vector<double> dVConsSlope(nProfSize, 0);
227 for (
int i = 0; i < nProfSize; i++)
233 int const nTopLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
244 dVConsProfileZ[i] =
m_pRasterGrid->m_Cell[nX][nY].dGetConsSedTopForLayerAboveBasement(nTopLayer);
247 VdProfileZ[i] =
m_pRasterGrid->m_Cell[nX][nY].dGetSedimentTopElev();
250 VdProfileDistXY[i] = i * dSpacingXY;
253 for (
int i = 0; i < nProfSize - 1; i++)
256 dVConsZDiff[i] = dVConsProfileZ[i] - dVConsProfileZ[i + 1];
259 dVConsSlope[i] = dVConsZDiff[i] / dSpacingXY;
263 dVConsSlope[nProfSize - 1] = dVConsSlope[nProfSize - 2];
271 vector<double> dVProfileDepthOverDB(nProfSize, 0);
272 vector<double> dVProfileErosionPotential(nProfSize, 0);
275 double dTotalErosionPotential = 0;
276 for (
int i = 0; i < nProfSize; i++)
280 dVProfileDepthOverDB[i] /= dDepthOfBreaking;
283 dVProfileDepthOverDB[i] =
tMax(dVProfileDepthOverDB[i], 0.0);
291 dVProfileErosionPotential[i] = 0;
294 dTotalErosionPotential += dVProfileErosionPotential[i];
298 for (
int i = 0; i < nProfSize; i++)
300 if (dTotalErosionPotential < 0)
301 dVProfileErosionPotential[i] /= (-dTotalErosionPotential);
304 vector<double> dVRecessionXY(nProfSize, 0);
305 vector<double> dVSCAPEXY(nProfSize, 0);
308 for (
int i = 0; i < nProfSize; i++)
325 dVRecessionXY[i] =
tMin(
m_VCoast[nCoast].dGetWaveEnergyAtBreaking(nCoastPoint) * dVProfileErosionPotential[i] * dVConsSlope[i] /
m_dR, 0.0);
326 dVSCAPEXY[i] = VdProfileDistXY[i] - dVRecessionXY[i];
329 vector<double> dVChangeElevZ(nProfSize, 0);
332 for (
int i = 1; i < nProfSize - 1; i++)
335 double dSCAPEHorizDist = dVSCAPEXY[i + 1] - dVSCAPEXY[i];
336 double dSCAPEVertDist = dVConsProfileZ[i] - dVConsProfileZ[i + 1];
337 double dSCAPESlope = dSCAPEVertDist / dSCAPEHorizDist;
338 double dDeltaZ = dVRecessionXY[i] * dSCAPESlope;
349 m_pRasterGrid->m_Cell[nX][nY].SetLocalConsSlope(dVConsSlope[i]);
355 double dPrevPotentialErosion = -
m_pRasterGrid->m_Cell[nX][nY].dGetPotentialPlatformErosion();
356 if (dPrevPotentialErosion < 0)
360 dDeltaZ = ((dDeltaZ + dPrevPotentialErosion) / 2);
364 dDeltaZ =
tMax(dDeltaZ, -dVConsZDiff[i]);
365 dDeltaZ =
tMin(dDeltaZ, 0.0);
366 dVChangeElevZ[i] = dDeltaZ;
369 m_pRasterGrid->m_Cell[nX][nY].SetPotentialPlatformErosion(-dDeltaZ);
384 m_pRasterGrid->m_Cell[nX][nY].SetBeachProtectionFactor(dBeachProtectionFactor);
390 int nRet =
nSaveProfile(nCoast, pProfile, nProfSize, &VdProfileDistXY, &dVConsProfileZ, &dVProfileDepthOverDB, &dVProfileErosionPotential, &dVConsSlope, &dVRecessionXY, &dVChangeElevZ, pProfile->
pPtiVGetCellsInProfile(), &dVSCAPEXY);
411 int const nCoastMax =
m_VCoast[nCoast].nGetCoastlineSize();
412 int nDistFromProfile = 0;
413 int nParCoastXLast = nProfileStartX;
414 int nParCoastYLast = nProfileStartY;
423 int nThisPointOnCoast = nCoastProfileStart;
425 nThisPointOnCoast += nDistFromProfile;
427 nThisPointOnCoast -= nDistFromProfile;
447 double dDepthOfBreaking =
m_VCoast[nCoast].dGetDepthOfBreaking(nThisPointOnCoast);
460 int const nParCoastX =
m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(nThisPointOnCoast)->nGetX();
461 int const nParCoastY =
m_VCoast[nCoast].pPtiGetCellMarkedAsCoastline(nThisPointOnCoast)->nGetY();
463 if ((nParCoastX == nParCoastXLast) && (nParCoastY == nParCoastYLast))
467 LogStream <<
WARN <<
m_ulIter <<
": rounding problem on coast " << nCoast <<
" profile " << pProfile->
nGetCoastID() <<
" at [" << nParCoastX <<
"][" << nParCoastY <<
"]" << endl;
474 if (
m_pRasterGrid->m_Cell[nParCoastX][nParCoastY].bIsProfile())
481 double const dBreakingWaveHeight =
m_VCoast[nCoast].dGetBreakingWaveHeight(nThisPointOnCoast);
484 vector<CGeom2DIPoint> PtiVGridParProfile;
485 vector<CGeom2DPoint> PtVExtCRSParProfile;
489 int const nParProfSize =
static_cast<int>(PtiVGridParProfile.size());
491 if (nParProfSize < 3)
494 nParCoastXLast = nParCoastX;
495 nParCoastYLast = nParCoastY;
501 double const dParProfileLenXY =
dGetDistanceBetween(&PtVExtCRSParProfile[0], &PtVExtCRSParProfile[nParProfSize - 1]);
504 double dParSpacingXY = dParProfileLenXY / (nParProfSize - 1);
511 vector<double> dVParProfileZ(nParProfSize, 0);
512 vector<double> dVParProfileDistXY(nParProfSize, 0);
513 vector<double> dVParConsProfileZ(nParProfSize, 0);
514 vector<double> dVParConsZDiff(nParProfSize, 0);
515 vector<double> dVParConsSlope(nParProfSize, 0);
517 for (
int i = 0; i < nParProfSize; i++)
519 int const nXPar = PtiVGridParProfile[i].nGetX();
520 int const nYPar = PtiVGridParProfile[i].nGetY();
531 int nPolyID =
m_pRasterGrid->m_Cell[nXPar][nYPar].nGetPolygonID();
540 int const nTopLayer =
m_pRasterGrid->m_Cell[nXPar][nYPar].nGetTopNonZeroLayerAboveBasement();
551 dVParConsProfileZ[i] =
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetConsSedTopForLayerAboveBasement(nTopLayer);
554 dVParProfileZ[i] =
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetSedimentTopElev();
557 dVParProfileDistXY[i] = i * dParSpacingXY;
560 for (
int i = 0; i < nParProfSize - 1; i++)
563 dVParConsZDiff[i] = dVParConsProfileZ[i] - dVParConsProfileZ[i + 1];
566 dVParConsSlope[i] = dVParConsZDiff[i] / dParSpacingXY;
570 dVParConsSlope[nParProfSize - 1] = dVParConsSlope[nParProfSize - 2];
579 vector<double> dVParProfileDepthOverDB(nParProfSize, 0);
580 vector<double> dVParProfileErosionPotential(nParProfSize, 0);
583 double dTotalErosionPotential = 0;
586 if (dDepthOfBreaking <= 0.0)
587 dDepthOfBreaking = 1e-10;
589 for (
int i = 0; i < nParProfSize; i++)
593 dVParProfileDepthOverDB[i] /= dDepthOfBreaking;
596 dVParProfileDepthOverDB[i] =
tMax(dVParProfileDepthOverDB[i], 0.0);
604 dVParProfileErosionPotential[i] = 0;
607 dTotalErosionPotential += dVParProfileErosionPotential[i];
611 for (
int i = 0; i < nParProfSize; i++)
613 if (dTotalErosionPotential < 0)
614 dVParProfileErosionPotential[i] /= (-dTotalErosionPotential);
617 vector<double> dVParRecessionXY(nParProfSize, 0);
618 vector<double> dVParSCAPEXY(nParProfSize, 0);
621 for (
int i = 0; i < nParProfSize; i++)
639 dVParRecessionXY[i] =
tMin(
m_VCoast[nCoast].dGetWaveEnergyAtBreaking(nThisPointOnCoast) * dVParProfileErosionPotential[i] * dVParConsSlope[i] /
m_dR, 0.0);
640 dVParSCAPEXY[i] = dVParProfileDistXY[i] - dVParRecessionXY[i];
645 vector<double> dVParDeltaZ(nParProfSize, 0);
648 for (
int i = 1; i < nParProfSize - 1; i++)
651 double dSCAPEHorizDist = dVParSCAPEXY[i + 1] - dVParSCAPEXY[i];
657 double dSCAPEVertDist = dVParConsProfileZ[i] - dVParConsProfileZ[i + 1];
658 double dSCAPESlope = dSCAPEVertDist / dSCAPEHorizDist;
659 double dDeltaZ = dVParRecessionXY[i] * dSCAPESlope;
666 int const nXPar = PtiVGridParProfile[i].nGetX();
667 int const nYPar = PtiVGridParProfile[i].nGetY();
670 m_pRasterGrid->m_Cell[nXPar][nYPar].SetLocalConsSlope(dVParConsSlope[i]);
676 if (
m_pRasterGrid->m_Cell[nXPar][nYPar].bPotentialPlatformErosion())
679 double const dPrevPotentialErosion = -
m_pRasterGrid->m_Cell[nXPar][nYPar].dGetPotentialPlatformErosion();
684 dDeltaZ =
tMin(dPrevPotentialErosion, dDeltaZ);
698 dDeltaZ =
tMax(dDeltaZ, -dVParConsZDiff[i]);
699 dDeltaZ =
tMin(dDeltaZ, 0.0);
700 dVParDeltaZ[i] = dDeltaZ;
703 m_pRasterGrid->m_Cell[nXPar][nYPar].SetPotentialPlatformErosion(-dDeltaZ);
719 m_pRasterGrid->m_Cell[nXPar][nYPar].SetBeachProtectionFactor(dBeachProtectionFactor);
725 int const nRet =
nSaveParProfile(nCoast, pProfile, nParProfSize, nDirection, nDistFromProfile, &dVParProfileDistXY, &dVParConsProfileZ, &dVParProfileDepthOverDB, &dVParProfileErosionPotential, &dVParConsSlope, &dVParRecessionXY, &dVParDeltaZ, pProfile->
pPtiVGetCellsInProfile(), &dVParSCAPEXY);
731 nParCoastXLast = nParCoastX;
732 nParCoastYLast = nParCoastY;
746 double const dBeachProtectionFactor =
m_pRasterGrid->m_Cell[nX][nY].dGetBeachProtectionFactor();
752 double dThisPotentialErosion =
m_pRasterGrid->m_Cell[nX][nY].dGetPotentialPlatformErosion() * dBeachProtectionFactor;
755 int nThisLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
760 cerr <<
ERR <<
"no sediment layer in DoActualPlatformErosionOnCell()" << endl;
769 double dExistingAvailableFine =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetFineDepth();
770 double dExistingAvailableSand =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetSandDepth();
771 double dExistingAvailableCoarse =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->dGetCoarseDepth();
774 int nFineWeight = (dExistingAvailableFine > 0 ? 1 : 0);
775 int nSandWeight = (dExistingAvailableSand > 0 ? 1 : 0);
776 int nCoarseWeight = (dExistingAvailableCoarse > 0 ? 1 : 0);
779 double dTotActualErosion = 0;
780 double dSandEroded = 0;
781 double dCoarseEroded = 0;
789 double dFineEroded =
tMin(dExistingAvailableFine, dFineLowering);
790 double dRemaining = dExistingAvailableFine - dFineEroded;
792 dTotActualErosion += dFineEroded;
795 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetFineDepth(dRemaining);
811 dSandEroded =
tMin(dExistingAvailableSand, dSandLowering);
812 double dRemaining = dExistingAvailableSand - dSandEroded;
814 dTotActualErosion += dSandEroded;
817 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetSandDepth(dRemaining);
820 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetUnconsolidatedSediment()->AddSandDepth(dSandEroded);
835 dCoarseEroded =
tMin(dExistingAvailableCoarse, dCoarseLowering);
836 double dRemaining = dExistingAvailableCoarse - dCoarseEroded;
838 dTotActualErosion += dCoarseEroded;
841 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetConsolidatedSediment()->SetCoarseDepth(dRemaining);
844 m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->pGetUnconsolidatedSediment()->AddCoarseDepth(dCoarseEroded);
854 if (dTotActualErosion > 0)
857 m_pRasterGrid->m_Cell[nX][nY].SetActualPlatformErosion(dTotActualErosion);
874 shuffle(nDirection.begin(), nDirection.end(),
m_Rand[0]);
876 for (
int n = 0; n < 8; n++)
881 if (nDirection[n] ==
NORTH)
887 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
898 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
903 else if (nDirection[n] ==
EAST)
909 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
920 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
925 else if (nDirection[n] ==
SOUTH)
931 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
942 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
947 else if (nDirection[n] ==
WEST)
953 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
962 if ((nXAdj >= 0) && (nYAdj >= 0))
964 nPolyID =
m_pRasterGrid->m_Cell[nXAdj][nYAdj].nGetPolygonID();
997 vector<double> VdDepthOverDB;
998 double dTempDOverDB = 0;
1000 while (dTempDOverDB <= 1.1)
1002 VdDepthOverDB.push_back(dTempDOverDB);
1008 int nSize =
static_cast<int>(VdDepthOverDB.size());
1009 vector<double> VdDeriv(nSize, 0);
1010 vector<double> VdDeriv2(nSize, 0.);
1011 vector<double> VdDeriv3(nSize, 0.);
1014 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]));
1019 for (
int n = 1; n < nSize - 1; n++)
1054 return dErosionPotential;
1067 int nThisLayer =
m_pRasterGrid->m_Cell[nX][nY].nGetTopNonZeroLayerAboveBasement();
1072 cerr <<
ERR <<
"no sediment layer in dCalcBeachProtectionFactor()" << endl;
1081 double dBeachDepth =
m_pRasterGrid->m_Cell[nX][nY].pGetLayerAboveBasement(nThisLayer)->dGetUnconsolidatedThickness();
1085 if (dMaxPenetrationDepth > 0)
1086 dFactor =
tMax(1 - (dBeachDepth / dMaxPenetrationDepth), 0.0);
1108 double dBeachProtection = 0;
1116 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1125 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1134 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1143 dBeachProtection +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetBeachProtectionFactor();
1149 m_pRasterGrid->m_Cell[nX][nY].SetBeachProtectionFactor(dBeachProtection / 4);
1171 double dPotentialPlatformErosion = 0;
1179 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1188 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1197 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1206 dPotentialPlatformErosion +=
m_pRasterGrid->m_Cell[nXTmp][nYTmp].dGetPotentialPlatformErosion();
1212 double dThisPotentialPlatformErosion = dPotentialPlatformErosion / 4;
1214 m_pRasterGrid->m_Cell[nX][nY].SetPotentialPlatformErosion(dThisPotentialPlatformErosion);
1233void 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)
1236 int nXOffset = nParCoastX - nProfileStartX;
1237 int nYOffset = nParCoastY - nProfileStartY;
1240 for (
int nProfileStartPoint = 0; nProfileStartPoint < nProfSize; nProfileStartPoint++)
1243 int nXProf = pPtViGridProfile->at(nProfileStartPoint).nGetX();
1244 int nYProf = pPtViGridProfile->at(nProfileStartPoint).nGetY();
1247 int nXPar = nXProf + nXOffset;
1248 int nYPar = nYProf + nYOffset;
1265 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.
int m_nLogFileDetail
The level of detail in the log file output. Can be LOG_FILE_LOW_DETAIL, LOG_FILE_MIDDLE_DETAIL,...
double dLookUpErosionPotential(double const) const
The erosion potential lookup: it returns a value for erosion potential given a value of Depth Over DB...
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.
default_random_engine m_Rand[NRNG]
The c++11 random number generators.
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.
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
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...
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...
unsigned long m_ulThisIterNumPotentialPlatformErosionCells
The number of grid cells on which potential platform erosion occurs, for this iteration.
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 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
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?
vector< CGeomCoastPolygon * > m_pVCoastPolygon
Pointers to coast polygon objects, in down-coast sequence TODO 044 Will need to use global polygon ID...
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.