FirstPrincipalCurvature.cppGo 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.5 $ 00026 // $Date: 2003/03/04 00:38:57 $ 00027 // $Source: /usr/local/cvs/OpenSees/SRC/reliability/analysis/curvature/FirstPrincipalCurvature.cpp,v $ 00028 00029 // 00030 // Written by Terje Haukaas (haukaas@ce.berkeley.edu) 00031 // 00032 00033 #include <FirstPrincipalCurvature.h> 00034 #include <FindCurvatures.h> 00035 #include <LimitStateFunction.h> 00036 #include <Vector.h> 00037 00038 00039 FirstPrincipalCurvature::FirstPrincipalCurvature() 00040 :FindCurvatures(), curvatures(1) 00041 { 00042 } 00043 00044 FirstPrincipalCurvature::~FirstPrincipalCurvature() 00045 { 00046 } 00047 00048 00049 int 00050 FirstPrincipalCurvature::computeCurvatures(ReliabilityDomain *theReliabilityDomain) 00051 { 00052 00053 // "Download" limit-state function from reliability domain 00054 int lsf = theReliabilityDomain->getTagOfActiveLimitStateFunction(); 00055 LimitStateFunction *theLimitStateFunction = 00056 theReliabilityDomain->getLimitStateFunctionPtr(lsf); 00057 00058 // Get hold of 'u' and 'alpha' at the two last steps 00059 Vector last_u = theLimitStateFunction->designPoint_u_inStdNormalSpace; 00060 Vector secondLast_u = theLimitStateFunction->secondLast_u; 00061 Vector lastAlpha = theLimitStateFunction->normalizedNegativeGradientVectorAlpha; 00062 Vector secondLastAlpha = theLimitStateFunction->secondLastAlpha; 00063 00064 // Compute curvature according to Der Kiureghian & De Stefano (1992), Eq.26: 00065 00066 // Initial computations 00067 Vector uLastMinus_u = last_u - secondLast_u; 00068 double signumProduct = secondLastAlpha ^ uLastMinus_u; 00069 double alphaProduct = secondLastAlpha ^ lastAlpha; 00070 double sumSquared = 0.0; 00071 00072 // Compute norm of the difference vector 00073 for ( int i=0; i<last_u.Size(); i++ ) { 00074 sumSquared += uLastMinus_u(i)*uLastMinus_u(i); 00075 } 00076 00077 double norm_uLastMinus_u = sqrt(sumSquared); 00078 00079 // Check sign and compute curvature 00080 if (fabs(signumProduct)==(signumProduct)) { 00081 curvatures(0) = acos(alphaProduct) / norm_uLastMinus_u; 00082 } 00083 else { 00084 curvatures(0) = -acos(alphaProduct) / norm_uLastMinus_u; 00085 } 00086 00087 return 0; 00088 } 00089 00090 00091 Vector 00092 FirstPrincipalCurvature::getCurvatures() 00093 { 00094 return curvatures; 00095 } 00096 00097 |