// Copyright (C) Stichting Deltares 2017. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets 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.
//
// 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.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
//
// All names, logos, and references to "Deltares" are registered trademarks of
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
using Ringtoets.Common.Data.Structures;
using Ringtoets.Common.Service;
using Ringtoets.Common.Service.Structures;
using Ringtoets.HeightStructures.Data;
using Ringtoets.HydraRing.Calculation.Data.Input.Structures;
namespace Ringtoets.HeightStructures.Service
{
///
/// Service that provides methods for performing Hydra-Ring calculations for height structures.
///
public class HeightStructuresCalculationService : StructuresCalculationServiceBase
{
///
/// Creates a new instance of .
///
public HeightStructuresCalculationService() : base(new HeightStructuresCalculationMessageProvider()) {}
protected override StructuresOvertoppingCalculationInput CreateInput(StructuresCalculation calculation,
GeneralHeightStructuresInput generalInput,
string hydraulicBoundaryDatabaseFilePath)
{
var structuresOvertoppingCalculationInput = new StructuresOvertoppingCalculationInput(
calculation.InputParameters.HydraulicBoundaryLocation.Id,
calculation.InputParameters.StructureNormalOrientation,
HydraRingInputParser.ParseForeshore(calculation.InputParameters),
HydraRingInputParser.ParseBreakWater(calculation.InputParameters),
generalInput.GravitationalAcceleration,
generalInput.ModelFactorOvertoppingFlow.Mean, generalInput.ModelFactorOvertoppingFlow.StandardDeviation,
calculation.InputParameters.LevelCrestStructure.Mean, calculation.InputParameters.LevelCrestStructure.StandardDeviation,
calculation.InputParameters.StructureNormalOrientation,
calculation.InputParameters.ModelFactorSuperCriticalFlow.Mean, calculation.InputParameters.ModelFactorSuperCriticalFlow.StandardDeviation,
calculation.InputParameters.AllowedLevelIncreaseStorage.Mean, calculation.InputParameters.AllowedLevelIncreaseStorage.StandardDeviation,
generalInput.ModelFactorStorageVolume.Mean, generalInput.ModelFactorStorageVolume.StandardDeviation,
calculation.InputParameters.StorageStructureArea.Mean, calculation.InputParameters.StorageStructureArea.CoefficientOfVariation,
generalInput.ModelFactorInflowVolume,
calculation.InputParameters.FlowWidthAtBottomProtection.Mean, calculation.InputParameters.FlowWidthAtBottomProtection.StandardDeviation,
calculation.InputParameters.CriticalOvertoppingDischarge.Mean, calculation.InputParameters.CriticalOvertoppingDischarge.CoefficientOfVariation,
calculation.InputParameters.FailureProbabilityStructureWithErosion,
calculation.InputParameters.WidthFlowApertures.Mean, calculation.InputParameters.WidthFlowApertures.StandardDeviation,
calculation.InputParameters.DeviationWaveDirection,
calculation.InputParameters.StormDuration.Mean, calculation.InputParameters.StormDuration.CoefficientOfVariation);
HydraRingSettingsDatabaseHelper.AssignSettingsFromDatabase(structuresOvertoppingCalculationInput, hydraulicBoundaryDatabaseFilePath);
return structuresOvertoppingCalculationInput;
}
}
}