00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
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 }