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 <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
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 }