1 // -*- C++ -*- 2 /** 3 * @brief FORMResult implements the First Order Reliability Method 4 * 5 * Copyright 2005-2021 Airbus-EDF-IMACS-ONERA-Phimeca 6 * 7 * This library is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU Lesser General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public License 18 * along with this library. If not, see <http://www.gnu.org/licenses/>. 19 * 20 */ 21 #ifndef OPENTURNS_FORMRESULT_HXX 22 #define OPENTURNS_FORMRESULT_HXX 23 24 #include "openturns/AnalyticalResult.hxx" 25 26 BEGIN_NAMESPACE_OPENTURNS 27 28 29 30 /** 31 * @class FORMResult 32 * FORMResult stores the FORM result 33 */ 34 class OT_API FORMResult: 35 public AnalyticalResult 36 { 37 CLASSNAME 38 public: 39 40 41 /** Standard constructor */ 42 FORMResult(const Point & standardSpaceDesignPoint, 43 const RandomVector & limitStateVariable, 44 const Bool isStandardPointOriginInFailureSpace); 45 46 /* Default constructor */ 47 FORMResult(); 48 49 /** Virtual constructor */ 50 FORMResult * clone() const override; 51 52 /** EventProbability accessor */ 53 Scalar getEventProbability() const; 54 55 /** GeneralisedReliabilityIndex accessor */ 56 Scalar getGeneralisedReliabilityIndex() const; 57 58 /** EventProbabilitySensitivity accessor */ 59 Sensitivity getEventProbabilitySensitivity() const; 60 61 /** HasoferReliabilityIndexSensitivitygraph */ 62 GraphCollection drawEventProbabilitySensitivity(Scalar width = ResourceMap::GetAsScalar("AnalyticalResult-DefaultWidth")) const; 63 64 /** String converter */ 65 String __repr__() const override; 66 67 /** Method save() stores the object through the StorageManager */ 68 void save(Advocate & adv) const override; 69 70 /** Method load() reloads the object from the StorageManager */ 71 void load(Advocate & adv) override; 72 73 private: 74 75 /** The function that actually evaluates the event probability with FORM approximation */ 76 void computeEventProbability() const; 77 78 /** The function that actually evaluates the generalised reliability index with FORM approximation */ 79 void computeGeneralisedReliabilityIndex() const; 80 81 /** The function that actually evaluates the event probability sensitivity with FORM approximation */ 82 void computeEventProbabilitySensitivity() const; 83 84 /** EventProbability accessor */ 85 void setEventProbability(const Scalar & eventProbability); 86 87 /** GeneralisedReliabilityIndex accessor */ 88 void setGeneralisedReliabilityIndex(const Scalar & generalisedReliabilityIndex); 89 90 /** EventProbabilitySensitivity accessor */ 91 void setEventProbabilitySensitivity(const Sensitivity & eventProbabilitySensitivity); 92 93 mutable Scalar eventProbability_; 94 mutable Scalar generalisedReliabilityIndex_; 95 mutable Sensitivity eventProbabilitySensitivity_; 96 mutable Bool isAlreadyComputedEventProbabilitySensitivity_; 97 98 }; // class FORMResult 99 100 END_NAMESPACE_OPENTURNS 101 102 #endif /* OPENTURNS_FORMRESULT_HXX */ 103 104 105 106