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
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <CableMaterial.h>
00044 #include <Vector.h>
00045 #include <Channel.h>
00046 #include <Information.h>
00047
00048
00049 CableMaterial::CableMaterial(int tag, double PRESTRESS, double e, double UNIT_WEIGHT_EFF, double L_Element)
00050 :UniaxialMaterial(tag,MAT_TAG_CableMaterial),
00051 Ps(PRESTRESS), E(e), Mue(UNIT_WEIGHT_EFF),
00052 L(L_Element), trialStrain(0.0)
00053 {
00054
00055 }
00056
00057 CableMaterial::CableMaterial()
00058 :UniaxialMaterial(0,MAT_TAG_CableMaterial),
00059 Ps(0.0), E(0.0), Mue(0.0),
00060 L(0.0), trialStrain(0.0)
00061 {
00062
00063 }
00064
00065 CableMaterial::~CableMaterial()
00066 {
00067
00068 }
00069
00070 int
00071 CableMaterial::setTrialStrain(double strain, double strainRate)
00072 {
00073 trialStrain = strain;
00074
00075 double derivE, derivG, stress;
00076
00077
00078 double testStress, dP, curstrain, e0;
00079 int i = 0;
00080
00081
00082 double L_bound = 0, U_bound, middle = 0;
00083
00084
00085 if (trialStrain < 0)
00086 U_bound = Ps;
00087 else {
00088 U_bound = E * trialStrain + Ps;
00089 testStress = U_bound;
00090 }
00091
00092
00093 e0 = Mue*Mue*L*L/(24*Ps*Ps) - Ps/E;
00094 if (trialStrain > 0 && abs(trialStrain - evalStress((trialStrain - e0)*E)) < 10e-9)
00095 trialStress = (trialStrain - e0)*E;
00096
00097
00098 if (trialStrain < - Ps/E*10.0)
00099 trialStress = 0.0;
00100
00101
00102 dP = U_bound - L_bound;
00103
00104 while (abs(dP)/U_bound > 0.00000001 && i < 100) {
00105
00106 middle = .5 * (U_bound + L_bound);
00107 curstrain = evalStress(middle);
00108
00109 if (curstrain <= trialStrain) {
00110 L_bound = middle;
00111 } else {
00112 U_bound = middle;
00113 }
00114 dP = U_bound - L_bound;
00115 i++;
00116 }
00117
00118
00119 if (i == 100)
00120 trialStress = 0.0;
00121 else
00122 trialStress = middle;
00123
00124 if (stress <= 0.0)
00125 trialTangent = 0.0;
00126
00127
00128 derivE = 1 / E * (1. - Mue * Mue * L * L / (24. * stress * stress) * (1. - 2. * Ps / stress));
00129
00130 derivG = 1 / 12. * Mue * Mue * L * L / (stress * stress * stress);
00131
00132 if (derivE + derivG != 0.0)
00133 trialTangent = 1.0 / (derivE + derivG);
00134 else
00135 trialTangent = 1e-8;
00136
00137 return 0;
00138 }
00139
00140
00141 int
00142 CableMaterial::setTrial(double strain, double &stress, double &tangent, double strainRate)
00143 {
00144 this->setTrialStrain(strain, strainRate);
00145
00146
00147 stress = trialStress;
00148 tangent = trialTangent;
00149
00150 return 0;
00151 }
00152
00153 double
00154 CableMaterial::getStress(void)
00155 {
00156 return trialStress;
00157
00158 }
00159
00160 double
00161 CableMaterial::evalStress(double stress)
00162 {
00163 double strainG, strainE;
00164
00165
00166 if (stress <= 0) {return -10;}
00167
00168
00169 strainE = 1 / E * (stress - Ps) * (1 + Mue * Mue * L * L / (24 * stress));
00170
00171
00172 strainG = 1 / 24 * Mue * Mue * L * L * (1 / (Ps * Ps) - 1 / (stress * stress));
00173
00174 return strainE + strainG;
00175 }
00176
00177
00178 double
00179 CableMaterial::getTangent(void)
00180 {
00181
00182 return trialTangent;
00183
00184 };
00185
00186 int
00187 CableMaterial::commitState(void)
00188 {
00189 return 0;
00190 }
00191
00192 int
00193 CableMaterial::revertToLastCommit(void)
00194 {
00195 return 0;
00196 }
00197
00198 int
00199 CableMaterial::revertToStart(void)
00200 {
00201 trialStrain = 0.0;
00202
00203 return 0;
00204 }
00205
00206 UniaxialMaterial *
00207 CableMaterial::getCopy(void)
00208 {
00209 CableMaterial *theCopy = new CableMaterial(this->getTag(), Ps, E, Mue, L);
00210 theCopy->trialStrain = trialStrain;
00211 return theCopy;
00212 }
00213
00214 int
00215 CableMaterial::sendSelf(int cTag, Channel &theChannel)
00216 {
00217 int res = 0;
00218 static Vector data(5);
00219 data(0) = this->getTag();
00220 data(1) = Ps;
00221 data(2) = E;
00222 data(3) = Mue;
00223 data(4) = L;
00224
00225 res = theChannel.sendVector(this->getDbTag(), cTag, data);
00226 if (res < 0)
00227 opserr << "CableMaterial::sendSelf() - failed to send data\n";
00228
00229 return res;
00230 }
00231
00232 int
00233 CableMaterial::recvSelf(int cTag, Channel &theChannel,
00234 FEM_ObjectBroker &theBroker)
00235 {
00236 int res = 0;
00237 static Vector data(5);
00238 res = theChannel.recvVector(this->getDbTag(), cTag, data);
00239
00240 if (res < 0) {
00241 opserr << "CableMaterial::recvSelf() - failed to receive data\n";
00242 E = 0;
00243 this->setTag(0);
00244 return res;
00245 }
00246
00247 this->setTag(data(0));
00248 Ps = data(1);
00249 E = data(2);
00250 Mue = data(3);
00251 L = data(4);
00252
00253 return res;
00254 }
00255
00256 void
00257 CableMaterial::Print(OPS_Stream &s, int flag)
00258 {
00259 s << "CableMaterial tag: " << this->getTag() << endln;
00260 s << " E: " << E << " Prestress: " << Ps << endln;
00261 }
00262
00263
00264
00265
00266
00267
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296 double
00297 CableMaterial::abs(double value)
00298 {
00299 if (value < 0) return -value;
00300 else return value;
00301 }