ReliabilityDomain.cpp

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 2001, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** Reliability module developed by:                                   **
00020 **   Terje Haukaas (haukaas@ce.berkeley.edu)                          **
00021 **   Armen Der Kiureghian (adk@ce.berkeley.edu)                       **
00022 **                                                                    **
00023 ** ****************************************************************** */
00024                                                                         
00025 // $Revision: 1.6 $
00026 // $Date: 2006/09/05 22:49:36 $
00027 // $Source: /usr/local/cvs/OpenSees/SRC/reliability/domain/components/ReliabilityDomain.cpp,v $
00028 
00029 
00030 //
00031 // Written by Terje Haukaas (haukaas@ce.berkeley.edu)
00032 //
00033 
00034 #include <ReliabilityDomain.h>
00035 
00036 #include <CorrelationCoefficient.h>
00037 #include <RandomVariable.h>
00038 #include <LimitStateFunction.h>
00039 #include <RandomVariablePositioner.h>
00040 #include <ParameterPositioner.h>
00041 #include <ArrayOfTaggedObjects.h>
00042 #include <ModulatingFunction.h>
00043 #include <Filter.h>
00044 #include <Spectrum.h>
00045 
00046 
00047 ReliabilityDomain::ReliabilityDomain()
00048 {
00049         theRandomVariablesPtr = new ArrayOfTaggedObjects (256);
00050         theCorrelationCoefficientsPtr = new ArrayOfTaggedObjects (256);
00051         theLimitStateFunctionsPtr = new ArrayOfTaggedObjects (256);
00052         theRandomVariablePositionersPtr = new ArrayOfTaggedObjects (256);
00053         theParameterPositionersPtr = new ArrayOfTaggedObjects (256);
00054         theModulatingFunctionsPtr = new ArrayOfTaggedObjects (256);
00055         theFiltersPtr = new ArrayOfTaggedObjects (256);
00056         theSpectraPtr = new ArrayOfTaggedObjects (256);
00057         tagOfActiveLimitStateFunction = 1;
00058 }
00059 
00060 ReliabilityDomain::~ReliabilityDomain()
00061 {
00062         if (!theRandomVariablesPtr)
00063                 delete theRandomVariablesPtr;
00064         if (!theCorrelationCoefficientsPtr)
00065                 delete theCorrelationCoefficientsPtr;
00066         if (!theLimitStateFunctionsPtr)
00067                 delete theLimitStateFunctionsPtr;
00068         if (!theRandomVariablePositionersPtr)
00069                 delete theRandomVariablePositionersPtr;
00070         if (!theParameterPositionersPtr)
00071                 delete theParameterPositionersPtr;
00072         if (!theModulatingFunctionsPtr)
00073                 delete theModulatingFunctionsPtr;
00074         if (!theSpectraPtr)
00075                 delete theSpectraPtr;
00076         if (!theFiltersPtr)
00077                 delete theFiltersPtr;
00078 }
00079 
00080 
00081 bool
00082 ReliabilityDomain::addRandomVariable(RandomVariable *theRandomVariable)
00083 {
00084         bool result = theRandomVariablesPtr->addComponent(theRandomVariable);
00085         return result;
00086 }
00087 
00088 bool
00089 ReliabilityDomain::addCorrelationCoefficient(CorrelationCoefficient *theCorrelationCoefficient)
00090 {
00091         bool result = theCorrelationCoefficientsPtr->addComponent(theCorrelationCoefficient);
00092         return result;
00093 }
00094 
00095 bool
00096 ReliabilityDomain::addLimitStateFunction(LimitStateFunction *theLimitStateFunction)
00097 {
00098         bool result = theLimitStateFunctionsPtr->addComponent(theLimitStateFunction);
00099         return result;
00100 }
00101 
00102 bool
00103 ReliabilityDomain::addRandomVariablePositioner(RandomVariablePositioner *theRandomVariablePositioner)
00104 {
00105         bool result = theRandomVariablePositionersPtr->addComponent(theRandomVariablePositioner);
00106         return result;
00107 }
00108 
00109 bool
00110 ReliabilityDomain::addParameterPositioner(ParameterPositioner *theParameterPositioner)
00111 {
00112         bool result = theParameterPositionersPtr->addComponent(theParameterPositioner);
00113         return result;
00114 }
00115 
00116 bool
00117 ReliabilityDomain::addModulatingFunction(ModulatingFunction *theModulatingFunction)
00118 {
00119         bool result = theModulatingFunctionsPtr->addComponent(theModulatingFunction);
00120         return result;
00121 }
00122 
00123 bool
00124 ReliabilityDomain::addSpectrum(Spectrum *theSpectrum)
00125 {
00126         bool result = theSpectraPtr->addComponent(theSpectrum);
00127         return result;
00128 }
00129 
00130 bool
00131 ReliabilityDomain::addFilter(Filter *theFilter)
00132 {
00133         bool result = theFiltersPtr->addComponent(theFilter);
00134         return result;
00135 }
00136 
00137 
00138 
00139 
00140 RandomVariable *
00141 ReliabilityDomain::getRandomVariablePtr(int tag)
00142 {
00143         TaggedObject *theComponent = theRandomVariablesPtr->getComponentPtr(tag);
00144 //      if ( *theComponent == 0 )
00145 //              return 0;
00146         RandomVariable *result = (RandomVariable *) theComponent;
00147         return result;
00148 }
00149 
00150 
00151 CorrelationCoefficient * 
00152 ReliabilityDomain::getCorrelationCoefficientPtr(int tag)
00153 {
00154         TaggedObject *theComponent = theCorrelationCoefficientsPtr->getComponentPtr(tag);
00155 //      if ( *theComponent == 0 )
00156 //              return 0;
00157         CorrelationCoefficient *result = (CorrelationCoefficient *) theComponent;
00158         return result;
00159 }
00160 
00161 
00162 LimitStateFunction *
00163 ReliabilityDomain::getLimitStateFunctionPtr(int tag)
00164 {
00165         TaggedObject *theComponent = theLimitStateFunctionsPtr->getComponentPtr(tag);
00166 //      if ( *theComponent == 0 )
00167 //              return 0;
00168         LimitStateFunction *result = (LimitStateFunction *) theComponent;
00169         return result;
00170 }
00171 
00172 
00173 RandomVariablePositioner *
00174 ReliabilityDomain::getRandomVariablePositionerPtr(int tag)
00175 {
00176         TaggedObject *theComponent = theRandomVariablePositionersPtr->getComponentPtr(tag);
00177 //      if ( *theComponent == 0 )
00178 //              return 0;
00179         RandomVariablePositioner *result = (RandomVariablePositioner *) theComponent;
00180         return result;
00181 }
00182 
00183 ParameterPositioner *
00184 ReliabilityDomain::getParameterPositionerPtr(int tag)
00185 {
00186         TaggedObject *theComponent = theParameterPositionersPtr->getComponentPtr(tag);
00187 //      if ( *theComponent == 0 )
00188 //              return 0;
00189         ParameterPositioner *result = (ParameterPositioner *) theComponent;
00190         return result;
00191 }
00192 
00193 
00194 ModulatingFunction *
00195 ReliabilityDomain::getModulatingFunction(int tag)
00196 {
00197         TaggedObject *theComponent = theModulatingFunctionsPtr->getComponentPtr(tag);
00198 //      if ( *theComponent == 0 )
00199 //              return 0;
00200         ModulatingFunction *result = (ModulatingFunction *) theComponent;
00201         return result;
00202 }
00203 
00204 
00205 Spectrum *
00206 ReliabilityDomain::getSpectrum(int tag)
00207 {
00208         TaggedObject *theComponent = theSpectraPtr->getComponentPtr(tag);
00209 //      if ( *theComponent == 0 )
00210 //              return 0;
00211         Spectrum *result = (Spectrum *) theComponent;
00212         return result;
00213 }
00214 
00215 
00216 Filter *
00217 ReliabilityDomain::getFilter(int tag)
00218 {
00219         TaggedObject *theComponent = theFiltersPtr->getComponentPtr(tag);
00220 //      if ( *theComponent == 0 )
00221 //              return 0;
00222         Filter *result = (Filter *) theComponent;
00223         return result;
00224 }
00225 
00226 
00227 int
00228 ReliabilityDomain::removeRandomVariablePositioner(int tag)
00229 {
00230         theRandomVariablePositionersPtr->removeComponent(tag);
00231 
00232         return 0;
00233 }
00234 
00235 int
00236 ReliabilityDomain::removeParameterPositioner(int tag)
00237 {
00238         theParameterPositionersPtr->removeComponent(tag);
00239 
00240         return 0;
00241 }
00242 
00243 int
00244 ReliabilityDomain::removeRandomVariable(int tag)
00245 {
00246         theRandomVariablesPtr->removeComponent(tag);
00247 
00248         return 0;
00249 }
00250 
00251 
00252 int
00253 ReliabilityDomain::removeCorrelationCoefficient(int tag)
00254 {
00255         theCorrelationCoefficientsPtr->removeComponent(tag);
00256 
00257         return 0;
00258 }
00259 
00260 int
00261 ReliabilityDomain::removePerformanceFunction(int tag)
00262 {
00263         theLimitStateFunctionsPtr->removeComponent(tag);
00264 
00265         return 0;
00266 }
00267 
00268 
00269 int
00270 ReliabilityDomain::getNumberOfRandomVariables()
00271 {
00272         return theRandomVariablesPtr->getNumComponents();
00273 }
00274 int
00275 ReliabilityDomain::getNumberOfCorrelationCoefficients()
00276 {
00277         return theCorrelationCoefficientsPtr->getNumComponents();
00278 }
00279 int
00280 ReliabilityDomain::getNumberOfLimitStateFunctions()
00281 {
00282         return theLimitStateFunctionsPtr->getNumComponents();
00283 }
00284 int
00285 ReliabilityDomain::getNumberOfRandomVariablePositioners()
00286 {
00287         return theRandomVariablePositionersPtr->getNumComponents();
00288 }
00289 int
00290 ReliabilityDomain::getNumberOfParameterPositioners()
00291 {
00292         return theParameterPositionersPtr->getNumComponents();
00293 }
00294 int
00295 ReliabilityDomain::getNumberOfModulatingFunctions()
00296 {
00297         return theModulatingFunctionsPtr->getNumComponents();
00298 }
00299 int
00300 ReliabilityDomain::getNumberOfFilters()
00301 {
00302         return theFiltersPtr->getNumComponents();
00303 }
00304 int
00305 ReliabilityDomain::getNumberOfSpectra()
00306 {
00307         return theSpectraPtr->getNumComponents();
00308 }
00309 
00310 
00311 
00312 
00313 
00314 int
00315 ReliabilityDomain::getTagOfActiveLimitStateFunction()
00316 {
00317         return tagOfActiveLimitStateFunction;
00318 }
00319 void
00320 ReliabilityDomain::setTagOfActiveLimitStateFunction(int passedTag)
00321 {
00322         tagOfActiveLimitStateFunction = passedTag;
00323 }
00324 

Generated on Mon Oct 23 15:05:26 2006 for OpenSees by doxygen 1.5.0