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 <HingeRadauTwoBeamIntegration.h>
00026 #include <ElementalLoad.h>
00027
00028 #include <Matrix.h>
00029 #include <Vector.h>
00030 #include <Channel.h>
00031 #include <FEM_ObjectBroker.h>
00032 #include <Information.h>
00033 #include <Parameter.h>
00034
00035 HingeRadauTwoBeamIntegration::HingeRadauTwoBeamIntegration(double lpi,
00036 double lpj):
00037 BeamIntegration(BEAM_INTEGRATION_TAG_HingeRadauTwo), lpI(lpi), lpJ(lpj)
00038 {
00039
00040 }
00041
00042 HingeRadauTwoBeamIntegration::HingeRadauTwoBeamIntegration():
00043 BeamIntegration(BEAM_INTEGRATION_TAG_HingeRadauTwo), lpI(0.0), lpJ(0.0)
00044 {
00045
00046 }
00047
00048 HingeRadauTwoBeamIntegration::~HingeRadauTwoBeamIntegration()
00049 {
00050
00051 }
00052
00053 void
00054 HingeRadauTwoBeamIntegration::getSectionLocations(int numSections, double L,
00055 double *xi)
00056 {
00057 double oneOverL = 1.0/L;
00058
00059 xi[0] = 0.0;
00060 xi[1] = 2.0/3*lpI*oneOverL;
00061 xi[4] = 1.0-2.0/3*lpJ*oneOverL;
00062 xi[5] = 1.0;
00063
00064 double alpha = 0.5-0.5*(lpI+lpJ)*oneOverL;
00065 double beta = 0.5+0.5*(lpI-lpJ)*oneOverL;
00066 xi[2] = alpha*(-1/sqrt(3.0)) + beta;
00067 xi[3] = alpha*(1/sqrt(3.0)) + beta;
00068
00069 for (int i = 6; i < numSections; i++)
00070 xi[i] = 0.0;
00071 }
00072
00073 void
00074 HingeRadauTwoBeamIntegration::getSectionWeights(int numSections, double L,
00075 double *wt)
00076 {
00077 double oneOverL = 1.0/L;
00078
00079 wt[0] = 0.25*lpI*oneOverL;
00080 wt[1] = 0.75*lpI*oneOverL;
00081 wt[4] = 0.75*lpJ*oneOverL;
00082 wt[5] = 0.25*lpJ*oneOverL;
00083
00084 wt[2] = 0.5-0.5*(lpI+lpJ)*oneOverL;
00085 wt[3] = 0.5-0.5*(lpI+lpJ)*oneOverL;
00086
00087 for (int i = 6; i < numSections; i++)
00088 wt[i] = 1.0;
00089 }
00090
00091 BeamIntegration*
00092 HingeRadauTwoBeamIntegration::getCopy(void)
00093 {
00094 return new HingeRadauTwoBeamIntegration(lpI, lpJ);
00095 }
00096
00097 int
00098 HingeRadauTwoBeamIntegration::sendSelf(int cTag, Channel &theChannel)
00099 {
00100 static Vector data(2);
00101
00102 data(0) = lpI;
00103 data(1) = lpJ;
00104
00105 int dbTag = this->getDbTag();
00106
00107 if (theChannel.sendVector(dbTag, cTag, data) < 0) {
00108 opserr << "HingeRadauTwoBeamIntegration::sendSelf() - failed to send Vector data\n";
00109 return -1;
00110 }
00111
00112 return 0;
00113 }
00114
00115 int
00116 HingeRadauTwoBeamIntegration::recvSelf(int cTag, Channel &theChannel,
00117 FEM_ObjectBroker &theBroker)
00118 {
00119 static Vector data(2);
00120
00121 int dbTag = this->getDbTag();
00122
00123 if (theChannel.recvVector(dbTag, cTag, data) < 0) {
00124 opserr << "HingeRadauTwoBeamIntegration::recvSelf() - failed to receive Vector data\n";
00125 return -1;
00126 }
00127
00128 lpI = data(0);
00129 lpJ = data(1);
00130
00131 return 0;
00132 }
00133
00134 int
00135 HingeRadauTwoBeamIntegration::setParameter(const char **argv, int argc,
00136 Parameter ¶m)
00137 {
00138 if (argc < 1)
00139 return -1;
00140
00141 if (strcmp(argv[0],"lpI") == 0)
00142 return param.addObject(1, this);
00143
00144 if (strcmp(argv[0],"lpJ") == 0)
00145 return param.addObject(2, this);
00146
00147 if (strcmp(argv[0],"lp") == 0)
00148 return param.addObject(3, this);
00149
00150 return -1;
00151 }
00152
00153 int
00154 HingeRadauTwoBeamIntegration::updateParameter(int parameterID,
00155 Information &info)
00156 {
00157 switch (parameterID) {
00158 case 1:
00159 lpI = info.theDouble;
00160 return 0;
00161 case 2:
00162 lpJ = info.theDouble;
00163 return 0;
00164 case 3:
00165 lpI = lpJ = info.theDouble;
00166 return 0;
00167 default:
00168 return -1;
00169 }
00170 }
00171
00172 int
00173 HingeRadauTwoBeamIntegration::activateParameter(int paramID)
00174 {
00175 parameterID = paramID;
00176
00177 return 0;
00178 }
00179
00180 void
00181 HingeRadauTwoBeamIntegration::Print(OPS_Stream &s, int flag)
00182 {
00183 s << "HingeRadauTwo" << endln;
00184 s << " lpI = " << lpI;
00185 s << " lpJ = " << lpJ << endln;
00186
00187 return;
00188 }
00189
00190 void
00191 HingeRadauTwoBeamIntegration::getLocationsDeriv(int numSections,
00192 double L, double dLdh,
00193 double *dptsdh)
00194 {
00195 double oneOverL = 1.0/L;
00196
00197 for (int i = 0; i < numSections; i++)
00198 dptsdh[i] = 0.0;
00199
00200 if (parameterID == 1) {
00201 dptsdh[1] = 2.0/3*oneOverL;
00202 dptsdh[2] = -0.5*(1.0-1/sqrt(3.0))*oneOverL + oneOverL;
00203 dptsdh[3] = -0.5*(1.0+1/sqrt(3.0))*oneOverL + oneOverL;
00204 }
00205
00206 if (parameterID == 2) {
00207 dptsdh[2] = -0.5*(1.0-1/sqrt(3.0))*oneOverL;
00208 dptsdh[3] = -0.5*(1.0+1/sqrt(3.0))*oneOverL;
00209 dptsdh[4] = -2.0/3*oneOverL;
00210 }
00211
00212 if (parameterID == 3) {
00213 dptsdh[1] = 2.0/3*oneOverL;
00214 dptsdh[2] = -(1.0-1/sqrt(3.0))*oneOverL + oneOverL;
00215 dptsdh[3] = -(1.0+1/sqrt(3.0))*oneOverL + oneOverL;
00216 dptsdh[4] = -2.0/3*oneOverL;
00217 }
00218
00219 if (dLdh != 0.0) {
00220
00221 opserr << "getPointsDeriv -- to do" << endln;
00222 }
00223
00224 return;
00225 }
00226
00227 void
00228 HingeRadauTwoBeamIntegration::getWeightsDeriv(int numSections,
00229 double L, double dLdh,
00230 double *dwtsdh)
00231 {
00232 double oneOverL = 1.0/L;
00233
00234 for (int i = 0; i < numSections; i++)
00235 dwtsdh[i] = 0.0;
00236
00237 if (parameterID == 1) {
00238 dwtsdh[0] = 0.25*oneOverL;
00239 dwtsdh[1] = 0.75*oneOverL;
00240 dwtsdh[2] = -0.5*oneOverL;
00241 dwtsdh[3] = -0.5*oneOverL;
00242 }
00243
00244 if (parameterID == 2) {
00245 dwtsdh[2] = -0.5*oneOverL;
00246 dwtsdh[3] = -0.5*oneOverL;
00247 dwtsdh[4] = 0.75*oneOverL;
00248 dwtsdh[5] = 0.25*oneOverL;
00249 }
00250
00251 if (parameterID == 3) {
00252 dwtsdh[0] = 0.25*oneOverL;
00253 dwtsdh[1] = 0.75*oneOverL;
00254 dwtsdh[2] = -oneOverL;
00255 dwtsdh[3] = -oneOverL;
00256 dwtsdh[4] = 0.75*oneOverL;
00257 dwtsdh[5] = 0.25*oneOverL;
00258 }
00259
00260 if (dLdh != 0.0) {
00261 dwtsdh[0] = -lpI*dLdh/(L*L);
00262 dwtsdh[5] = -lpJ*dLdh/(L*L);
00263
00264 opserr << "getWeightsDeriv -- to do" << endln;
00265 }
00266
00267 return;
00268 }