double HydraulicM_vGp::K (const double h) const { if (h < 0.0) { const double Se_h = Se (h); const double M_vG_K = K_sat * pow (Se_h, l) * pow (1.0 - pow (1.0 - pow (Se_h, 1.0/m), m), 2.0); const double X = 1.0; // [cm^-1] const double p_m = (h > h_m) ? pow (1.0 / (-h * X + 1.0), f) : p_m_matrix; return M_vG_K * p_m; } else return K_sat; }
void ElasticForceBeamColumn2d::Print(OPS_Stream &s, int flag) { static Vector Se(NEBD); static Vector vp(NEBD); static Matrix fe(NEBD,NEBD); if (flag == 2) { s << "#ElasticForceBeamColumn2D\n"; const Vector &node1Crd = theNodes[0]->getCrds(); const Vector &node2Crd = theNodes[1]->getCrds(); const Vector &node1Disp = theNodes[0]->getDisp(); const Vector &node2Disp = theNodes[1]->getDisp(); s << "#NODE " << node1Crd(0) << " " << node1Crd(1) << " " << node1Disp(0) << " " << node1Disp(1) << " " << node1Disp(2) << endln; s << "#NODE " << node2Crd(0) << " " << node2Crd(1) << " " << node2Disp(0) << " " << node2Disp(1) << " " << node2Disp(2) << endln; this->computeBasicForces(Se); double P = Se(0); double M1 = Se(1); double M2 = Se(2); double L = crdTransf->getInitialLength(); double V = (M1+M2)/L; double p0[3]; p0[0] = 0.0; p0[1] = 0.0; p0[2] = 0.0; if (numEleLoads > 0) this->computeReactions(p0); s << "#END_FORCES " << -P+p0[0] << " " << V+p0[1] << " " << M1 << endln; s << "#END_FORCES " << P << " " << -V+p0[2] << " " << M2 << endln; // plastic hinge rotation this->getInitialFlexibility(fe); vp = crdTransf->getBasicTrialDisp(); vp.addMatrixVector(1.0, fe, Se, -1.0); s << "#PLASTIC_HINGE_ROTATION " << vp[1] << " " << vp[2] << " " << 0.1*L << " " << 0.1*L << endln; /* // allocate array of vectors to store section coordinates and displacements static int maxNumSections = 0; static Vector *coords = 0; static Vector *displs = 0; if (maxNumSections < numSections) { if (coords != 0) delete [] coords; if (displs != 0) delete [] displs; coords = new Vector [numSections]; displs = new Vector [numSections]; if (!coords) { opserr << "NLBeamColumn3d::Print() -- failed to allocate coords array"; exit(-1); } int i; for (i = 0; i < numSections; i++) coords[i] = Vector(NDM); if (!displs) { opserr << "NLBeamColumn3d::Print() -- failed to allocate coords array"; exit(-1); } for (i = 0; i < numSections; i++) displs[i] = Vector(NDM); maxNumSections = numSections; } // compute section location & displacements this->compSectionDisplacements(coords, displs); // spit out the section location & invoke print on the scetion for (int i=0; i<numSections; i++) { s << "#SECTION " << (coords[i])(0) << " " << (coords[i])(1); s << " " << (displs[i])(0) << " " << (displs[i])(1) << endln; sections[i]->Print(s, flag); } */ } else { s << "\nElement: " << this->getTag() << " Type: ElasticForceBeamColumn2d "; s << "\tConnected Nodes: " << connectedExternalNodes ; s << "\tNumber of Sections: " << numSections; s << "\tMass density: " << rho << endln; beamIntegr->Print(s, flag); crdTransf->Print(s, flag); this->computeBasicForces(Se); double P = Se(0); double M1 = Se(1); double M2 = Se(2); double L = crdTransf->getInitialLength(); double V = (M1+M2)/L; theVector(1) = V; theVector(4) = -V; double p0[3]; p0[0] = 0.0; p0[1] = 0.0; p0[2] = 0.0; if (numEleLoads > 0) this->computeReactions(p0); s << "\tEnd 1 Forces (P V M): " << -P+p0[0] << " " << V+p0[1] << " " << M1 << endln; s << "\tEnd 2 Forces (P V M): " << P << " " << -V+p0[2] << " " << M2 << endln; if (flag == 1) { for (int i = 0; i < numSections; i++) s << "\numSections "<<i<<" :" << *sections[i]; } } }
int ElasticForceBeamColumn2d::getResponse(int responseID, Information &eleInfo) { static Vector Se(NEBD); static Vector vp(NEBD); static Matrix fe(NEBD,NEBD); if (responseID == 1) return eleInfo.setVector(this->getResistingForce()); else if (responseID == 2) { double p0[3]; p0[0] = 0.0; p0[1] = 0.0; p0[2] = 0.0; if (numEleLoads > 0) this->computeReactions(p0); this->computeBasicForces(Se); theVector(3) = Se(0); theVector(0) = -Se(0)+p0[0]; theVector(2) = Se(1); theVector(5) = Se(2); double V = (Se(1)+Se(2))/crdTransf->getInitialLength(); theVector(1) = V+p0[1]; theVector(4) = -V+p0[2]; return eleInfo.setVector(theVector); } // Chord rotation else if (responseID == 7) { this->computeBasicForces(Se); return eleInfo.setVector(Se); } // Chord rotation else if (responseID == 3) { vp = crdTransf->getBasicTrialDisp(); return eleInfo.setVector(vp); } // Plastic rotation else if (responseID == 4) { this->computeBasicForces(Se); this->getInitialFlexibility(fe); vp = crdTransf->getBasicTrialDisp(); vp.addMatrixVector(1.0, fe, Se, -1.0); return eleInfo.setVector(vp); } // Point of inflection else if (responseID == 5) { double LI = 0.0; this->computeBasicForces(Se); if (fabs(Se(1)+Se(2)) > DBL_EPSILON) { double L = crdTransf->getInitialLength(); LI = Se(1)/(Se(1)+Se(2))*L; } return eleInfo.setDouble(LI); } else if (responseID == 7) { this->computeBasicForces(Se); return eleInfo.setVector(Se); } else if (responseID == 10) { double L = crdTransf->getInitialLength(); double pts[maxNumSections]; beamIntegr->getSectionLocations(numSections, L, pts); Vector locs(numSections); for (int i = 0; i < numSections; i++) locs(i) = pts[i]*L; return eleInfo.setVector(locs); } else if (responseID == 11) { double L = crdTransf->getInitialLength(); double wts[maxNumSections]; beamIntegr->getSectionWeights(numSections, L, wts); Vector weights(numSections); for (int i = 0; i < numSections; i++) weights(i) = wts[i]*L; return eleInfo.setVector(weights); } else return -1; }
double HydraulicM_vGp::Theta (const double h) const { return Se (h) * (Theta_sat - Theta_res) + Theta_res; }