UserDefinedBeamIntegration.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.4 $
00022 // $Date: 2003/06/10 00:36:09 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/element/forceBeamColumn/UserDefinedBeamIntegration.cpp,v $
00024 
00025 #include <UserDefinedBeamIntegration.h>
00026 
00027 #include <Vector.h>
00028 #include <Channel.h>
00029 #include <FEM_ObjectBroker.h>
00030 
00031 UserDefinedBeamIntegration::UserDefinedBeamIntegration(int nIP,
00032                                                        const Vector &pt,
00033                                                        const Vector &wt):
00034   BeamIntegration(BEAM_INTEGRATION_TAG_UserDefined),
00035   pts(nIP), wts(nIP)
00036 {
00037   for (int i = 0; i < nIP; i++) {
00038     if (pt(i) < 0.0 || pt(i) > 1.0)
00039       opserr << "UserDefinedBeamIntegration::UserDefinedBeamIntegration -- point lies outside [0,1]" << endln;
00040     if (wt(i) < 0.0 || wt(i) > 1.0)
00041       opserr << "UserDefinedBeamIntegration::UserDefinedBeamIntegration -- weight lies outside [0,1]" << endln;
00042     pts(i) = pt(i);
00043     wts(i) = wt(i);
00044   }
00045 }
00046 
00047 UserDefinedBeamIntegration::UserDefinedBeamIntegration():
00048   BeamIntegration(BEAM_INTEGRATION_TAG_UserDefined)
00049 {
00050  
00051 }
00052 
00053 UserDefinedBeamIntegration::~UserDefinedBeamIntegration()
00054 {
00055   // Nothing to do
00056 }
00057 
00058 void
00059 UserDefinedBeamIntegration::getSectionLocations(int numSections,
00060                                                 double L, double *xi)
00061 {
00062   int nIP = pts.Size();
00063 
00064   int i;
00065   for (i = 0; i < nIP; i++)
00066     xi[i] = pts(i);
00067   for ( ; i < numSections; i++)
00068     xi[i] = 0.0;
00069 }
00070 
00071 void
00072 UserDefinedBeamIntegration::getSectionWeights(int numSections,
00073                                               double L, double *wt)
00074 {
00075   int nIP = wts.Size();
00076 
00077   int i;
00078   for (i = 0; i < nIP; i++)
00079     wt[i] = wts(i);
00080   for ( ; i < numSections; i++)
00081     wt[i] = 1.0;
00082 }
00083 
00084 BeamIntegration*
00085 UserDefinedBeamIntegration::getCopy(void)
00086 {
00087   int nIP = pts.Size();
00088 
00089   return new UserDefinedBeamIntegration(nIP, pts, wts);
00090 }
00091 
00092 int
00093 UserDefinedBeamIntegration::sendSelf(int cTag, Channel &theChannel)
00094 {
00095   return -1;
00096 }
00097 
00098 int
00099 UserDefinedBeamIntegration::recvSelf(int cTag, Channel &theChannel,
00100                                      FEM_ObjectBroker &theBroker)
00101 {
00102   return -1;
00103 }
00104 
00105 void
00106 UserDefinedBeamIntegration::Print(OPS_Stream &s, int flag)
00107 {
00108   s << "UserDefined" << endln;
00109   s << " Points: " << pts;
00110   s << " Weights: " << wts;
00111 }

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