Diana
0.8.3
|
00001 /* ----------------------------------------------------------------------------- 00002 * Diana process modelling, simulation and analysis software 00003 * Copyright (c) 2005, Michael Krasnyk 00004 * All rights reserved. 00005 * 00006 * This file is a part of Diana process modelling, simulation and analysis software 00007 * 00008 * Diana is free software; you can redistribute it and/or modify it 00009 * under the terms of the GNU General Public License as published 00010 * by the Free Software Foundation (see accompanying file LICENSE) 00011 * ----------------------------------------------------------------------------- 00012 * $Id: CapeESO.hpp 8180 2009-03-18 17:41:58Z miha $ 00013 * ----------------------------------------------------------------------------- 00014 * Description: 00015 */ 00016 00017 #ifndef CAPE_ESO_HPP 00018 #define CAPE_ESO_HPP 00019 00020 #include "CapeTypes.hpp" 00021 #include "CapeException.hpp" 00022 #include "CapeBasic.hpp" 00023 #include "CapeMatrix.hpp" 00024 #include "DianaSparseArray.hpp" 00025 00026 00027 namespace Numeric{ 00028 00029 namespace Solvers { 00030 00031 namespace Eso{ 00032 00061 class ICapeNumericESO : virtual public Common::Identification::ICapeIdentification, 00062 virtual public Common::Utilities::ICapeUtilities { 00063 #ifndef SWIG 00064 00065 friend std::ostream& operator<<(std::ostream& out_file, const ICapeNumericESO& eso); 00066 #endif 00067 public: 00069 virtual ~ICapeNumericESO(){} 00070 00072 virtual Common::Types::CapeLong GetNumVars() 00073 throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) = 0; 00074 00076 virtual Common::Types::CapeLong GetNumEqns() 00077 throw (Common::Error::ECapeUnknown) = 0; 00078 00083 virtual void SetFixedVariables(const Common::Types::CapeArrayLong& varIndices, 00084 const Common::Types::CapeArrayDouble& varValues) 00085 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00086 Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds, 00087 Common::Error::ECapeNoImpl) = 0; 00088 00091 virtual void SetAllVariables(const Common::Types::CapeArrayDouble& varValues) 00092 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00093 Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) = 0; 00094 00098 virtual void SetVariables(const Common::Types::CapeArrayLong& varIndices, 00099 const Common::Types::CapeArrayDouble& varValues) 00100 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00101 Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) = 0; 00102 00104 virtual const Common::Types::CapeArrayDouble& GetAllVariables() 00105 throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) = 0; 00106 00109 virtual Common::Types::CapeArrayDouble GetVariables(const Common::Types::CapeArrayLong& varIndices) 00110 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00111 Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) = 0; 00112 00114 virtual const Common::Types::CapeArrayDouble& GetAllResiduals() 00115 throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder, 00116 Common::Error::ECapeFailedInitialisation) = 0; 00117 00120 virtual Common::Types::CapeArrayDouble GetResiduals(const Common::Types::CapeArrayLong& eqnIndices) 00121 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00122 Common::Error::ECapeOutOfBounds, Common::Error::ECapeBadInvOrder, 00123 Common::Error::ECapeFailedInitialisation) = 0; 00124 00131 virtual const Diana::DianaSparseArray& GetJacobianStruct() 00132 throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) = 0; 00133 00140 virtual const Diana::DianaSparseArray& GetAllJacobianValues() 00141 throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) = 0; 00142 00148 virtual Common::Types::CapeArrayDouble GetJacobianValues(const Common::Types::CapeArrayLong& indices) 00149 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00150 Common::Error::ECapeNoImpl, Common::Error::ECapeOutOfBounds) = 0; 00151 00153 virtual void SetVariablesIndex(const Common::Types::CapeArrayLong& varIndexes) 00154 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00155 Common::Error::ECapeOutOfBounds, Common::Error::ECapeNoImpl) = 0; 00156 00158 virtual const Common::Types::CapeArrayDouble& GetLowerBounds() 00159 throw (Common::Error::ECapeUnknown) = 0; 00160 00162 virtual const Common::Types::CapeArrayDouble& GetUpperBounds() 00163 throw (Common::Error::ECapeUnknown) = 0; 00164 }; 00165 00170 class ICapeNumericLAESO : public ICapeNumericESO { 00171 #ifndef SWIG 00172 00173 friend std::ostream& operator<<(std::ostream& out_file, const ICapeNumericLAESO& eso); 00174 #endif 00175 public: 00177 virtual ~ICapeNumericLAESO(){} 00178 00184 virtual void SetLHS(const Diana::DianaSparseArray& values) 00185 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00186 Common::Error::ECapeOutOfBounds) = 0; 00187 00190 virtual void SetRHS(const Common::Types::CapeArrayDouble& values) 00191 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00192 Common::Error::ECapeOutOfBounds) = 0; 00193 00196 virtual const Diana::DianaSparseArray& GetLHS() 00197 throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) = 0; 00198 00203 virtual Common::Types::CapeArrayDouble GetRHS() 00204 throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) = 0; 00205 }; 00206 00211 class ICapeNumericNLAESO : public ICapeNumericESO { 00212 #ifndef SWIG 00213 00214 friend std::ostream& operator<<(std::ostream& out_file, const ICapeNumericNLAESO& eso); 00215 #endif 00216 public: 00218 virtual ~ICapeNumericNLAESO(){} 00219 }; 00220 00248 class ICapeNumericDAESO : public ICapeNumericESO { 00249 #ifndef SWIG 00250 00251 friend std::ostream& operator<<(std::ostream& out_file, const ICapeNumericDAESO& eso); 00252 #endif 00253 public: 00255 virtual ~ICapeNumericDAESO(){} 00256 00262 virtual void SetAllDerivatives(const Common::Types::CapeArrayDouble& varValues) 00263 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00264 Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) = 0; 00265 00271 virtual const Common::Types::CapeArrayDouble& GetAllDerivatives() 00272 throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) = 0; 00273 00277 virtual Common::Types::CapeArrayDouble GetDerivatives(const Common::Types::CapeArrayLong& varIndices) 00278 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00279 Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) = 0; 00280 00285 virtual void SetDerivatives(const Common::Types::CapeArrayLong& varIndices, 00286 const Common::Types::CapeArrayDouble& varValues) 00287 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00288 Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) = 0; 00289 00298 virtual const Diana::DianaSparseArray& GetDiffJacobianStruct() 00299 throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) = 0; 00300 00308 virtual const Diana::DianaSparseArray& GetAllDiffJacobianValues() 00309 throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) = 0; 00310 00315 virtual Common::Types::CapeArrayDouble GetDiffJacobianValues(const Common::Types::CapeArrayLong& indices) 00316 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, 00317 Common::Error::ECapeNoImpl, Common::Error::ECapeOutOfBounds) = 0; 00318 00321 virtual void SetIndependentVar(Common::Types::CapeDouble indVar) 00322 throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) = 0; 00323 00325 virtual Common::Types::CapeDouble GetIndependentVar() 00326 throw (Common::Error::ECapeUnknown) = 0; 00327 }; 00328 }; 00329 }; 00330 }; 00331 00332 #endif // CAPE_ESO_HPP