// Copyright (C) Stichting Deltares 2019. All rights reserved.
//
// This file is part of the Dam Engine.
//
// The Dam Engine is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero 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 System;
using System.Collections.Generic;
using Deltares.DamEngine.Data.General;
using Deltares.MacroStability.Data;
using Deltares.MacroStability.Geometry;
using Deltares.MacroStability.Kernel;
using Deltares.MacroStability.Preprocessing;
using Deltares.MacroStability.WaternetCreator;
using Location = Deltares.MacroStability.WaternetCreator.Location;
namespace Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityCommon.MacroStabilityIo
{
public class FillWtiFromDamEngine
{
/// Creates the kernel model from dam project data.
/// The DamProjectData object filled with Wti data
/// The KernelModel filled with the Dam Project Data
public static KernelModel CreateKernelModelFromDamProjectData(DamProjectData damProjectData)
{
KernelModel kernelModel = new KernelModel();
kernelModel.StabilityModel = new StabilityModel();
kernelModel.PreprocessingModel = new PreprocessingModel();
TransferWtiStabilityModel(damProjectData, kernelModel.StabilityModel);
TransferVersionInfo();
TransferSoilModel(damProjectData, kernelModel.StabilityModel.SoilModel.Soils);
kernelModel.StabilityModel.SoilProfile = new SoilProfile2D();
TransferSoilProfile(damProjectData, kernelModel.StabilityModel.SoilProfile);
TransferSurfaceLine();
TransferLocation(damProjectData, kernelModel.PreprocessingModel.LastStage.Locations);
TransferPreconsolidationStresses();
TransferUniformLoads();
TransferConsolidationValues();
TransferMultiplicationFactorsCPhiForUplift();
TransferWaternets();
TransferSpencerSlipPlanes();
TransferUpliftVanCalculationGrid();
TransferSlipPlaneConstraints();
TransferLevenbergMarquardtOptions();
return kernelModel;
}
private static void TransferSoilProfile(DamProjectData damProjectData, SoilProfile2D soilProfile2D)
{
soilProfile2D.Geometry = new GeometryData();
soilProfile2D.Geometry.Points.Add(new Point2D());
soilProfile2D.Geometry.Curves.Add(new GeometryCurve());
}
private static void TransferWtiStabilityModel(DamProjectData damProjectData, StabilityModel stabilityModel)
{
stabilityModel.MoveGrid = true; // is not in DamEngine datamodel
stabilityModel.MaximumSliceWidth = 1.0; // is not in DamEngine datamodel
stabilityModel.SearchAlgorithm = ConversionHelper.ConvertToMacroStabilitySearchMethod(
damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismParametersMStab.MStabParameters.SearchMethod);
stabilityModel.ModelOption = ConversionHelper.ConvertToModelOptions(
damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismParametersMStab.MStabParameters.Model);
stabilityModel.GridOrientation = ConversionHelper.ConvertToGridOrientation(
damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismParametersMStab.MStabParameters.GridPosition);
}
private static void TransferVersionInfo()
{
}
private static void TransferSoilModel(DamProjectData damProjectData, IList soils)
{
soils.Add(new Soil());
}
private static void TransferSurfaceLine()
{
}
private static void TransferLocation(DamProjectData damProjectData, IList locations)
{
locations.Add(new Location());
}
private static void TransferPreconsolidationStresses()
{
}
private static void TransferUniformLoads()
{
}
private static void TransferConsolidationValues()
{
}
private static void TransferMultiplicationFactorsCPhiForUplift()
{
}
private static void TransferWaternets()
{
}
private static void TransferSpencerSlipPlanes()
{
}
private static void TransferUpliftVanCalculationGrid()
{
}
private static void TransferSlipPlaneConstraints()
{
}
private static void TransferLevenbergMarquardtOptions()
{
}
}
}