UserDefinedHingeIntegration.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 1999, 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 ** ****************************************************************** */
00020 
00021 // $Revision: 1.1 $
00022 // $Date: 2006/01/18 21:58:24 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/element/forceBeamColumn/UserDefinedHingeIntegration.cpp,v $
00024 
00025 #include <UserDefinedHingeIntegration.h>
00026 
00027 #include <Matrix.h>
00028 #include <Vector.h>
00029 #include <Channel.h>
00030 #include <FEM_ObjectBroker.h>
00031 #include <Information.h>
00032 
00033 UserDefinedHingeIntegration::UserDefinedHingeIntegration(int npL,
00034                                                          const Vector &ptL,
00035                                                          const Vector &wtL,
00036                                                          int npR,
00037                                                          const Vector &ptR,
00038                                                          const Vector &wtR):
00039   BeamIntegration(BEAM_INTEGRATION_TAG_UserHinge),
00040   ptsL(npL), wtsL(npL), ptsR(npR), wtsR(npR)
00041 {
00042   int i;
00043   for (i = 0; i < npL; i++) {
00044     if (ptL(i) < 0.0 || ptL(i) > 1.0)
00045       opserr << "UserDefinedHingeIntegration::UserDefinedHingeIntegration -- point lies outside [0,1]" << endln;
00046     if (wtL(i) < 0.0 || wtL(i) > 1.0)
00047       opserr << "UserDefinedHingeIntegration::UserDefinedHingeIntegration -- weight lies outside [0,1]" << endln;
00048     ptsL(i) = ptL(i);
00049     wtsL(i) = wtL(i);
00050   }
00051 
00052   for (i = 0; i < npR; i++) {
00053     if (ptR(i) < 0.0 || ptR(i) > 1.0)
00054       opserr << "UserDefinedHingeIntegration::UserDefinedHingeIntegration -- point lies outside [0,1]" << endln;
00055     if (wtR(i) < 0.0 || wtR(i) > 1.0)
00056       opserr << "UserDefinedHingeIntegration::UserDefinedHingeIntegration -- weight lies outside [0,1]" << endln;
00057     ptsR(i) = ptR(i);
00058     wtsR(i) = wtR(i);
00059   }
00060 }
00061 
00062 UserDefinedHingeIntegration::UserDefinedHingeIntegration():
00063   BeamIntegration(BEAM_INTEGRATION_TAG_UserHinge)
00064 {
00065 
00066 }
00067 
00068 UserDefinedHingeIntegration::~UserDefinedHingeIntegration()
00069 {
00070   // Nothing to do
00071 }
00072 
00073 void
00074 UserDefinedHingeIntegration::getSectionLocations(int numSections,
00075                                                  double L, double *xi)
00076 {
00077   int npL = ptsL.Size();
00078   int npR = ptsR.Size();
00079 
00080   double lpI = 0.0;
00081   double lpJ = 0.0;
00082   int i, j;
00083   for (i = 0; i < npL; i++) {
00084     xi[i] = ptsL(i);
00085     lpI += wtsL(i);
00086   }
00087   for (j = 0; j < npR; j++, i++) {
00088     xi[i] = ptsR(j);
00089     lpJ += wtsR(j);
00090   }
00091 
00092   double alpha = 0.5-0.5*(lpI+lpJ);
00093   double beta  = 0.5+0.5*(lpI-lpJ);
00094   xi[i++] = alpha*(-1/sqrt(3.0)) + beta;
00095   xi[i++] = alpha*(1/sqrt(3.0)) + beta;
00096 
00097   for ( ; i < numSections; i++)
00098     xi[i] = 0.0;
00099 }
00100 
00101 void
00102 UserDefinedHingeIntegration::getSectionWeights(int numSections,
00103                                                double L, double *wt)
00104 {
00105   int npL = wtsL.Size();
00106   int npR = wtsR.Size();
00107 
00108   double lpI = 0.0;
00109   double lpJ = 0.0;
00110   int i, j;
00111   for (i = 0; i < npL; i++) {
00112     wt[i] = wtsL(i);
00113     lpI += wtsL(i);
00114   }
00115   for (j = 0; j < npR; j++, i++) {
00116     wt[i] = wtsR(j);
00117     lpJ += wtsR(j);
00118   }
00119 
00120   double oneOverL = 1.0/L;
00121   wt[i++] = 0.5-0.5*(lpI+lpJ);
00122   wt[i++] = 0.5-0.5*(lpI+lpJ);
00123 
00124   for ( ; i < numSections; i++)
00125     wt[i] = 1.0;
00126 }
00127 
00128 BeamIntegration*
00129 UserDefinedHingeIntegration::getCopy(void)
00130 {
00131   int npL = ptsL.Size();
00132   int npR = ptsR.Size();
00133 
00134   return new UserDefinedHingeIntegration(npL, ptsL, wtsL,
00135                                          npR, ptsR, wtsR);
00136 }
00137 
00138 int
00139 UserDefinedHingeIntegration::sendSelf(int cTag, Channel &theChannel)
00140 {
00141   return -1;
00142 }
00143 
00144 int
00145 UserDefinedHingeIntegration::recvSelf(int cTag, Channel &theChannel,
00146                                       FEM_ObjectBroker &theBroker)
00147 {
00148   return -1;
00149 }
00150 
00151 void
00152 UserDefinedHingeIntegration::Print(OPS_Stream &s, int flag)
00153 {
00154   s << "UserHinge" << endln;
00155   s << " Points hinge I: " << ptsL;
00156   s << " Weights hinge I: " << wtsL;
00157   s << " Points hinge J: " << ptsR;
00158   s << " Weights hinge J: " << wtsR;
00159 }

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