// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic;
using Deltares.DamEngine.Calculators.KernelWrappers.Common;
using Deltares.DamEngine.Data.General.Results;
using Deltares.DamEngine.Data.Standard.Logging;
namespace Deltares.DamEngine.Calculators.KernelWrappers.Interfaces
{
///
/// Result of the Prepare method
/// Successful : the input data was created susccesfully
/// Failed : the input data could not be created
/// NotRelevant: the DamKernelInput contains data that is not a relevant input for this mechanism
///
public enum PrepareResult
{
Successful,
Failed,
NotRelevant
};
///
/// Interface to implement external failure mechanisms
///
public interface IKernelWrapper
{
///
/// Prepares the failure mechanism input based on general dam kernel input.
///
/// The dam kernel input.
/// The number of the current iteration
/// The kernel data input.
/// The kernel data output.
///
/// Result of the prepare
///
PrepareResult Prepare(DamKernelInput damKernelInput, int iterationIndex, out IKernelDataInput kernelDataInput, out IKernelDataOutput kernelDataOutput);
///
/// Validates the kernel data input.
///
/// The kernel data input.
/// The kernel data output.
/// The messages.
///
/// Number of errors that prevent a calculation
///
int Validate(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages);
///
/// Performs a failure mechanism calculation based on the input.
///
/// The kernel data input.
/// The kernel data output.
/// The messages.
void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages);
///
/// Fills the dam result based on the kernel output.
///
/// The dam kernel input.
/// The kernel data output.
/// The result message.
/// The design results
void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults);
}
}