BeamColumnJoint2d.cpp

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.4 $
00022 // $Date: 2006/08/04 22:22:37 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/element/joint/BeamColumnJoint2d.cpp,v $
00024                                                                         
00025 // Written: NM (nmitra@u.washington.edu)
00026 // Created: April 2002
00027 // Revised: August 2004
00028 //
00029 // Description: This file contains the class implementation for beam-column joint.
00030 // This element is a 4 noded 12 dof (3 dof at each node) finite area super-element introduced by
00031 // Prof. Lowes and Arash. The element takes in 13 different material types in order to simulate
00032 // the inelastic action observed in a reinforced beam column joint.
00033 // Updates: Several concerning Joint formulation (presently a revised formulation for joints)
00034 
00035 
00036 #include <BeamColumnJoint2d.h>
00037 
00038 #include <Domain.h>
00039 #include <Node.h>
00040 #include <Channel.h>
00041 #include <FEM_ObjectBroker.h>
00042 #include <Renderer.h>
00043 #include <MatrixUtil.h>
00044 
00045 #include <UniaxialMaterial.h>
00046 #include <string.h>
00047 #include <ElementResponse.h>
00048 
00049 // full constructors:
00050 BeamColumnJoint2d::BeamColumnJoint2d(int tag,int Nd1, int Nd2, int Nd3, int Nd4,
00051                                      UniaxialMaterial& theMat1,
00052                                      UniaxialMaterial& theMat2,
00053                                      UniaxialMaterial& theMat3,
00054                                      UniaxialMaterial& theMat4,
00055                                      UniaxialMaterial& theMat5,
00056                                      UniaxialMaterial& theMat6,
00057                                      UniaxialMaterial& theMat7,
00058                                      UniaxialMaterial& theMat8,
00059                                      UniaxialMaterial& theMat9,
00060                                      UniaxialMaterial& theMat10,
00061                                      UniaxialMaterial& theMat11,
00062                                      UniaxialMaterial& theMat12,
00063                                      UniaxialMaterial& theMat13):
00064   Element(tag,ELE_TAG_BeamColumnJoint2d), connectedExternalNodes(4),
00065   nodeDbTag(0), dofDbTag(0), elemActHeight(0.0), elemActWidth(0.0), 
00066   elemWidth(0.0), elemHeight(0.0), HgtFac(1.0), WdtFac(1.0),
00067   Uecommit(12), UeIntcommit(4), UeprCommit(12), UeprIntCommit(4), 
00068   BCJoint(13,16), dg_df(4,13), dDef_du(13,4), K(12,12), R(12)
00069 {
00070         // ensure the connectedExternalNode ID is of correct size & set values
00071  
00072         if (connectedExternalNodes.Size() != 4)
00073       opserr << "ERROR : BeamColumnJoint::BeamColumnJoint " << tag << "failed to create an ID of size 4" << endln;
00074 
00075         connectedExternalNodes(0) = Nd1 ;
00076     connectedExternalNodes(1) = Nd2 ;
00077     connectedExternalNodes(2) = Nd3 ;
00078     connectedExternalNodes(3) = Nd4 ;
00079 
00080         MaterialPtr = new UniaxialMaterial*[13];
00081 
00082         for (int x = 0; x <13; x++)
00083         {       MaterialPtr[x] = 0; }
00084 
00085         Uecommit.Zero();
00086         UeIntcommit.Zero();
00087         UeprCommit.Zero();
00088         UeprIntCommit.Zero();
00089 
00090         BCJoint.Zero(); dg_df.Zero(); dDef_du.Zero();
00091 
00092         K.Zero();
00093         R.Zero();
00094 
00095         nodePtr[0] = 0;
00096         nodePtr[1] = 0;
00097 
00098 // get a copy of the material and check we obtained a valid copy
00099   MaterialPtr[0] = theMat1.getCopy();
00100   if (!MaterialPtr[0]){
00101                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 1" << endln;}
00102   MaterialPtr[1] = theMat2.getCopy();
00103   if (!MaterialPtr[1]){
00104                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 2"<< endln;}
00105   MaterialPtr[2] = theMat3.getCopy();
00106   if (!MaterialPtr[2]){
00107                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 3"<< endln;}
00108   MaterialPtr[3] = theMat4.getCopy();
00109   if (!MaterialPtr[3]){
00110                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 4"<< endln;}
00111   MaterialPtr[4] = theMat5.getCopy();
00112   if (!MaterialPtr[4]){
00113                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 5"<< endln;}
00114   MaterialPtr[5] = theMat6.getCopy();
00115   if (!MaterialPtr[5]){
00116                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 6"<< endln;}
00117   MaterialPtr[6] = theMat7.getCopy();
00118   if (!MaterialPtr[6]){
00119             opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 7"<< endln;}
00120   MaterialPtr[7] = theMat8.getCopy();
00121   if (!MaterialPtr[7]){
00122                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 8"<< endln;}
00123   MaterialPtr[8] = theMat9.getCopy();
00124   if (!MaterialPtr[8]){
00125                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 9"<< endln;}
00126   MaterialPtr[9] = theMat10.getCopy();
00127   if (!MaterialPtr[9]){
00128                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 10"<< endln;}
00129   MaterialPtr[10] = theMat11.getCopy();
00130   if (!MaterialPtr[10]){
00131                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 11"<< endln;}
00132   MaterialPtr[11] = theMat12.getCopy();
00133   if (!MaterialPtr[11]){
00134                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 12"<< endln;}
00135   MaterialPtr[12] = theMat13.getCopy();
00136   if (!MaterialPtr[12]){
00137                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 13"<< endln;}  
00138 
00139 }
00140 
00141 // full constructors:
00142 BeamColumnJoint2d::BeamColumnJoint2d(int tag,int Nd1, int Nd2, int Nd3, int Nd4,
00143                                      UniaxialMaterial& theMat1,
00144                                      UniaxialMaterial& theMat2,
00145                                      UniaxialMaterial& theMat3,
00146                                      UniaxialMaterial& theMat4,
00147                                      UniaxialMaterial& theMat5,
00148                                      UniaxialMaterial& theMat6,
00149                                      UniaxialMaterial& theMat7,
00150                                      UniaxialMaterial& theMat8,
00151                                      UniaxialMaterial& theMat9,
00152                                      UniaxialMaterial& theMat10,
00153                                      UniaxialMaterial& theMat11,
00154                                      UniaxialMaterial& theMat12,
00155                                      UniaxialMaterial& theMat13,
00156                                          double elHgtFac, double elWdtFac):
00157   Element(tag,ELE_TAG_BeamColumnJoint2d), connectedExternalNodes(4),
00158   nodeDbTag(0), dofDbTag(0), elemActHeight(0.0), elemActWidth(0.0),
00159   elemWidth(0.0), elemHeight(0.0), HgtFac(elHgtFac), WdtFac(elWdtFac),
00160   Uecommit(12), UeIntcommit(4), UeprCommit(12), UeprIntCommit(4),
00161   BCJoint(13,16), dg_df(4,13), dDef_du(13,4), K(12,12), R(12)
00162 {
00163         // ensure the connectedExternalNode ID is of correct size & set values
00164  
00165         if (connectedExternalNodes.Size() != 4)
00166       opserr << "ERROR : BeamColumnJoint::BeamColumnJoint " << tag << "failed to create an ID of size 4" << endln;
00167 
00168         connectedExternalNodes(0) = Nd1 ;
00169     connectedExternalNodes(1) = Nd2 ;
00170     connectedExternalNodes(2) = Nd3 ;
00171     connectedExternalNodes(3) = Nd4 ;
00172 
00173         MaterialPtr = new UniaxialMaterial*[13];
00174 
00175         for (int x = 0; x <13; x++)
00176         {       MaterialPtr[x] = 0; }
00177 
00178         Uecommit.Zero();
00179         UeIntcommit.Zero();
00180         UeprCommit.Zero();
00181         UeprIntCommit.Zero();
00182 
00183         BCJoint.Zero(); dg_df.Zero(); dDef_du.Zero();
00184 
00185         K.Zero();
00186         R.Zero();
00187 
00188         // added
00189         nodePtr[0] = 0;
00190         nodePtr[1] = 0;
00191 
00192 
00193         // get a copy of the material and check we obtained a valid copy
00194   MaterialPtr[0] = theMat1.getCopy();
00195   if (!MaterialPtr[0]){
00196                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 1" << endln;}
00197   MaterialPtr[1] = theMat2.getCopy();
00198   if (!MaterialPtr[1]){
00199                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 2"<< endln;}
00200   MaterialPtr[2] = theMat3.getCopy();
00201   if (!MaterialPtr[2]){
00202                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 3"<< endln;}
00203   MaterialPtr[3] = theMat4.getCopy();
00204   if (!MaterialPtr[3]){
00205                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 4"<< endln;}
00206   MaterialPtr[4] = theMat5.getCopy();
00207   if (!MaterialPtr[4]){
00208                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 5"<< endln;}
00209   MaterialPtr[5] = theMat6.getCopy();
00210   if (!MaterialPtr[5]){
00211                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 6"<< endln;}
00212   MaterialPtr[6] = theMat7.getCopy();
00213   if (!MaterialPtr[6]){
00214             opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 7"<< endln;}
00215   MaterialPtr[7] = theMat8.getCopy();
00216   if (!MaterialPtr[7]){
00217                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 8"<< endln;}
00218   MaterialPtr[8] = theMat9.getCopy();
00219   if (!MaterialPtr[8]){
00220                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 9"<< endln;}
00221   MaterialPtr[9] = theMat10.getCopy();
00222   if (!MaterialPtr[9]){
00223                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 10"<< endln;}
00224   MaterialPtr[10] = theMat11.getCopy();
00225   if (!MaterialPtr[10]){
00226                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 11"<< endln;}
00227   MaterialPtr[11] = theMat12.getCopy();
00228   if (!MaterialPtr[11]){
00229                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 12"<< endln;}
00230   MaterialPtr[12] = theMat13.getCopy();
00231   if (!MaterialPtr[12]){
00232                 opserr << "ERROR : BeamColumnJoint::Constructor failed to get a copy of material 13"<< endln;}  
00233 
00234 }
00235 
00236 // default constructor:
00237 BeamColumnJoint2d::BeamColumnJoint2d():
00238   Element(0,ELE_TAG_BeamColumnJoint2d), connectedExternalNodes(4),
00239   nodeDbTag(0), dofDbTag(0), elemActHeight(0.0), elemActWidth(0.0),
00240   elemWidth(0.0), elemHeight(0.0), HgtFac(1.0), WdtFac(1.0),
00241   Uecommit(12), UeIntcommit(4), UeprCommit(12), UeprIntCommit(4),
00242   BCJoint(13,16), dg_df(4,13), dDef_du(13,4), K(12,12), R(12)
00243 {
00244         nodePtr[0] = 0;
00245         nodePtr[1] = 0;
00246         for (int x = 0; x <13; x++)
00247         {       MaterialPtr[x] = 0; }
00248    // does nothing (invoked by FEM_ObjectBroker)
00249 }
00250 
00251 //  destructor:
00252 BeamColumnJoint2d::~BeamColumnJoint2d()
00253 {
00254         for (int i =0; i<13; i++)
00255         {
00256             if (MaterialPtr[i] != 0)
00257                 delete MaterialPtr[i];
00258         }
00259 
00260         if (MaterialPtr)
00261                  delete [] MaterialPtr;
00262 }
00263 
00264 // public methods
00265 int
00266 BeamColumnJoint2d::getNumExternalNodes(void) const
00267 {
00268     return 4;
00269 }
00270 
00271 const ID &
00272 BeamColumnJoint2d::getExternalNodes(void) 
00273 {
00274     return connectedExternalNodes;
00275 }
00276 
00277 Node **BeamColumnJoint2d::getNodePtrs(void)
00278 {
00279         return nodePtr;
00280 }
00281 
00282 int
00283 BeamColumnJoint2d::getNumDOF(void) 
00284 {
00285     return 12;
00286 }
00287 
00288 void
00289 BeamColumnJoint2d::setDomain(Domain *theDomain)
00290 {
00291     if (theDomain == 0)
00292         opserr << "ERROR : BeamColumnJoint::setDomain -- Domain is null" << endln;
00293         
00294         // Check Domain is not null - invoked when object removed from a domain
00295     if (theDomain == 0) {
00296         nodePtr[0] = 0;
00297         nodePtr[1] = 0;
00298     }
00299 
00300         //node pointers set
00301     for (int i = 0; i < 4; i++ ) {
00302                 nodePtr[i] = theDomain->getNode( connectedExternalNodes(i) ) ;
00303                 if (nodePtr[i] == 0)
00304                 {
00305                         opserr << "ERROR : BeamColumnJoint::setDomain -- node pointer is null"<< endln;
00306                         exit(-1); // donot go any further - otherwise segmentation fault
00307                 }
00308         }
00309 
00310     // call the base class method
00311     this->DomainComponent::setDomain(theDomain);
00312 
00313         // ensure connected nodes have correct dof's
00314         int dofNd1 = nodePtr[0]->getNumberDOF();
00315         int dofNd2 = nodePtr[1]->getNumberDOF();
00316         int dofNd3 = nodePtr[2]->getNumberDOF();
00317         int dofNd4 = nodePtr[3]->getNumberDOF();
00318 
00319         if ((dofNd1 != 3) || (dofNd2 != 3) || (dofNd3 != 3) || (dofNd4 != 3)) 
00320         {
00321                         opserr << "ERROR : BeamColumnJoint::setDomain -- number of DOF associated with the node incorrect"<< endln;
00322                         exit(-1); // donot go any further - otherwise segmentation fault
00323         }
00324 
00325 
00326     // obtain the nodal coordinates    
00327         const Vector &end1Crd = nodePtr[0]->getCrds();
00328         const Vector &end2Crd = nodePtr[1]->getCrds();
00329         const Vector &end3Crd = nodePtr[2]->getCrds();
00330         const Vector &end4Crd = nodePtr[3]->getCrds();
00331 
00332         Vector Node1(end1Crd);
00333         Vector Node2(end2Crd);
00334         Vector Node3(end3Crd);
00335         Vector Node4(end4Crd);
00336 
00337         // set the height and width of the element and perform check   
00338         Node3 = Node3 - Node1;
00339         Node2 = Node2 - Node4;
00340 
00341         double beam = 1.0; //HgtFac;
00342         double col = 1.0; //WdtFac;
00343 
00344         elemActHeight = fabs(Node3.Norm());
00345         elemActWidth = fabs(Node2.Norm());
00346         elemHeight = beam*elemActHeight;
00347         elemWidth = col*elemActWidth;
00348 
00349         if ((elemHeight <= 1e-12) || (elemWidth <= 1e-12))
00350         {
00351                 opserr << "ERROR : BeamColumnJoint::setDomain -- length or width not correct, division by zero occurs"<< endln;
00352                 exit(-1); // donot go any further - otherwise segmentation fault
00353         }
00354 
00355         getBCJoint();
00356         getdg_df();
00357         getdDef_du();
00358 }   
00359 
00360 int
00361 BeamColumnJoint2d::commitState(void)
00362 {
00363         // store commited external nodal displacements
00364         Uecommit = UeprCommit;
00365         // store commited internal nodal displacements
00366         UeIntcommit = UeprIntCommit;
00367 
00368         // store material history data.
00369         int mcs = 0;
00370                 for (int j=0; j<13; j++)
00371                 {
00372                         if (MaterialPtr[j] != 0) mcs = MaterialPtr[j]->commitState();
00373                         if (mcs != 0) break;
00374                 }
00375     
00376         return mcs;
00377 }
00378 
00379 int
00380 BeamColumnJoint2d::revertToLastCommit(void)
00381 {
00382         int mcs = 0;
00383         for (int j=0; j<13; j++)
00384         {
00385                 if (MaterialPtr[j] != 0) mcs = MaterialPtr[j]->revertToLastCommit();
00386                 if (mcs != 0) break;
00387         }
00388         UeprCommit = Uecommit;
00389         UeprIntCommit = UeIntcommit;   
00390         
00391         this->update();
00392 
00393   return mcs;
00394 }
00395 
00396 int
00397 BeamColumnJoint2d::revertToStart(void)
00398 {
00399         int mcs = 0;
00400         for (int j=0; j<13; j++)
00401         {
00402                 if (MaterialPtr[j] != 0) mcs = MaterialPtr[j]->revertToStart();
00403                 if (mcs != 0) break;
00404         }
00405         
00406         return mcs;
00407 }
00408 
00409 int
00410 BeamColumnJoint2d::update(void)
00411 {       
00412                 Vector Ue(16);
00413                 Ue.Zero();
00414 
00415         // determine commited displacements given trial displacements
00416                 getGlobalDispls(Ue);
00417  
00418                 // update displacements for the external nodes
00419                 UeprCommit.Extract(Ue,0,1.0); 
00420                 // update displacement for the internal nodes
00421                 UeprIntCommit.Extract(Ue,12,1.0);
00422 
00423                 return 0;
00424 }
00425 
00426 const Matrix &
00427 BeamColumnJoint2d::getTangentStiff(void)
00428 {
00429         return K;
00430 }
00431 
00432 const Matrix &
00433 BeamColumnJoint2d::getInitialStiff(void)
00434 {
00435         return getTangentStiff();
00436 }
00437 
00438 const Vector &
00439 BeamColumnJoint2d::getResistingForce(void)
00440 {
00441   return R;
00442 }
00443 
00444 void BeamColumnJoint2d::getGlobalDispls(Vector &dg) 
00445 {
00446         // local variables that will be used in this method
00447         int converge = 0;
00448         int linesearch = 0;
00449         int totalCount = 0;
00450         int dtConverge = 0;
00451         int incCount = 0;
00452         int count = 0;
00453         int maxTotalCount = 1000;
00454         int maxCount = 20;
00455         double loadStep = 0.0;
00456         double dLoadStep = 1.0;
00457         double stepSize = 0.0;
00458 
00459         Vector uExtOld(12);   uExtOld.Zero();
00460         Vector uExt(12);      uExt.Zero();
00461         Vector duExt(12);     duExt.Zero();
00462         Vector uIntOld(4);    uIntOld.Zero(); 
00463         Vector uInt(4);       uInt.Zero();
00464         Vector duInt(4);      duInt.Zero(); 
00465         Vector duIntTemp(4);  duIntTemp.Zero();
00466         Vector intEq(4);      intEq.Zero();
00467         Vector intEqLast(4);  intEqLast.Zero();
00468         Vector Uepr(12);      Uepr.Zero();
00469         Vector UeprInt(4);    UeprInt.Zero();
00470         Vector Ut(12);        Ut.Zero();
00471         
00472 
00473     Vector disp1 = nodePtr[0]->getTrialDisp(); 
00474     Vector disp2 = nodePtr[1]->getTrialDisp();
00475     Vector disp3 = nodePtr[2]->getTrialDisp();
00476     Vector disp4 = nodePtr[3]->getTrialDisp();
00477 
00478         for (int i = 0; i < 3; i++)
00479     {
00480       Ut(i)     = disp1(i);
00481       Ut(i+3)   = disp2(i);
00482       Ut(i+6)   = disp3(i);
00483       Ut(i+9)   = disp4(i);
00484     }
00485 
00486         Uepr = Uecommit;   
00487 
00488         UeprInt = UeprIntCommit;  
00489 
00490         uExtOld = Uepr;
00491         duExt = Ut -Uepr;
00492 
00493         uExt = uExtOld;
00494 
00495         uIntOld = UeprInt;
00496         uInt = uIntOld;
00497 
00498         double tol = 1e-12;
00499         double tolIntEq = tol;
00500         double toluInt = (tol>tol*uInt.Norm())? tol:tol*uInt.Norm();
00501         double tolIntEqdU = tol;
00502         double ctolIntEqdU = tol;
00503         double ctolIntEq = tol;
00504         double normDuInt = toluInt;
00505         double normIntEq = tolIntEq;
00506         double normIntEqdU = tolIntEqdU;
00507            
00508         Vector u(16);
00509         u.Zero();
00510 
00511         double engrLast = 0.0;
00512         double engr = 0.0;
00513 
00514         Vector fSpring(13);   fSpring.Zero();
00515         Vector kSpring(13);   kSpring.Zero();
00516     Matrix dintEq_du(4,4);     dintEq_du.Zero();
00517     Matrix df_dDef(13,13);     df_dDef.Zero();
00518     Matrix tempintEq_du (4,13);  tempintEq_du.Zero();
00519 
00520         
00521         while ((loadStep < 1.0) && (totalCount < maxTotalCount))
00522         {
00523                 count = 0;
00524                 converge = 0;
00525                 dtConverge = 0;
00526                 while ((!converge) && (count < maxCount))
00527                 {
00528                         if (dLoadStep <= 1e-3)
00529                         {
00530                                 dLoadStep = dLoadStep;
00531                         }
00532                         totalCount ++;
00533                         count ++;
00534                         
00535                         for (int ic = 0; ic < 12; ic++ ) {
00536                                 u(ic) = uExt(ic) + duExt(ic);
00537                         }
00538                         u(12) = uInt(0);
00539                         u(13) = uInt(1);
00540                         u(14) = uInt(2);
00541                         u(15) = uInt(3);
00542                         
00543                         fSpring.Zero(); kSpring.Zero();
00544 
00545                         getMatResponse(u,fSpring,kSpring);              
00546 
00547                 // performs internal equilibrium 
00548 
00549                 intEq(0) = -fSpring(2)-fSpring(3)+fSpring(9)-fSpring(12)/elemHeight; 
00550                 intEq(1) = fSpring(1)-fSpring(5)-fSpring(7)+fSpring(12)/elemWidth; 
00551                 intEq(2) = -fSpring(4)-fSpring(8)+fSpring(10)+fSpring(12)/elemHeight; 
00552                 intEq(3) = fSpring(0)-fSpring(6)-fSpring(11)-fSpring(12)/elemWidth; 
00553 
00554                 df_dDef.Zero();
00555                 matDiag(kSpring, df_dDef);
00556 
00558                 tempintEq_du.Zero(); dintEq_du.Zero();
00559 
00560                 tempintEq_du.addMatrixProduct(0.0,dg_df,df_dDef,1.0);
00561                 dintEq_du.addMatrixProduct(0.0,tempintEq_du,dDef_du,1.0);
00562 
00563                 normIntEq = intEq.Norm();
00564                 normIntEqdU = 0.0;
00565                 for (int jc = 0; jc<4 ; jc++)
00566                 {
00567                         normIntEqdU += intEq(jc)*duInt(jc);
00568                 }
00569                 normIntEqdU = fabs(normIntEqdU);
00570 
00571                 if (totalCount == 1)
00572                 {
00573                         tolIntEq = (tol>tol*normIntEq) ? tol:tol*normIntEq;
00574                         tolIntEqdU = tol;
00575                 }
00576                 else if (totalCount == 2)
00577                 {
00578                         tolIntEqdU = (tol>tol*normIntEqdU) ? tol:tol*normIntEqdU;
00579                 }
00580                 ctolIntEq = (tolIntEq*dLoadStep > tol) ? tolIntEq*dLoadStep:tol;
00581                 ctolIntEqdU = (tolIntEqdU*dLoadStep > tol) ? tolIntEqdU*dLoadStep:tol;
00582 
00583                 
00584                 // check for convergence starts  
00585 
00586       if ((normIntEq < ctolIntEq) || ((normIntEqdU < ctolIntEqdU) && (count >1)) || (normDuInt < toluInt) || (dLoadStep < 1e-3))
00587                 {
00588                         converge = 1;
00589                         loadStep = loadStep + dLoadStep;
00590                         if (fabs(1.0 - loadStep) < tol)
00591                         {
00592                                 loadStep = 1.0;
00593                         }
00594                 }
00595                 else
00596                 {
00598                         dintEq_du.Solve(intEq,duInt);
00599                         duInt *= -1;
00600 
00601                         normDuInt = duInt.Norm();
00602                         if (!linesearch)
00603                         {
00604                                 uInt = uInt + duInt;
00605                         }
00606                         else
00607                         {
00608                                 engrLast = 0.0;
00609                                 engr = 0.0;
00610 
00611                                 for (int jd = 0; jd<4 ; jd++)
00612                                 {
00613                                         engrLast += duInt(jd)*intEqLast(jd);
00614                                         engr += duInt(jd)*intEq(jd);
00615                                 }
00616 
00617                                 if (fabs(engr) > tol*engrLast)
00618                                 {
00619                                         duIntTemp = duInt;
00620                                         duIntTemp *= -1;
00621                                         // lineSearch algorithm requirement
00622                                         stepSize = getStepSize(engrLast,engr,uExt,duExt,uInt,duIntTemp,tol);
00623                                         
00624                                         if (fabs(stepSize) > 0.001)
00625                                         {
00626                                                 uInt = uInt + stepSize*duInt;
00627                                         }
00628                                         else
00629                                         {
00630                                                 uInt = uInt + duInt;
00631                                         }
00632                                 }
00633                                 else
00634                                 {
00635                                         uInt = uInt + duInt;
00636                                 }
00637                                 intEqLast = intEq;
00638                         }
00639                 }
00640         }
00641 
00642                 if (!converge && loadStep < 1.0)
00643                 {
00644         
00645                         incCount = 0;
00646                         maxCount = 25;
00647                         if (!linesearch)
00648                         {
00649                                 linesearch = 1;
00650                                 uInt = uIntOld;
00651                                 duInt.Zero();
00652                         }
00653                         else
00654                         {                                       
00655                                 uInt = uIntOld;
00656                                 duInt.Zero();
00657                                 duExt = duExt*0.1;
00658 
00659                                 dLoadStep = dLoadStep*0.1;
00660                         }
00661                 }
00662                 else if (loadStep < 1.0)
00663                 {
00664                         maxCount = 10;
00665                         incCount ++;
00666                         normDuInt = toluInt;
00667                         if ((incCount < maxCount) || dtConverge)
00668                         {
00669                                 uExt = uExt + duExt;
00670                                 if (loadStep + dLoadStep > 1.0)
00671                                 {
00672                                         duExt = duExt*(1.0 - loadStep)/dLoadStep;
00673                                         dLoadStep = 1.0 - loadStep;
00674                                         incCount = 9;
00675                                 }
00676                         }
00677                         else
00678                         {
00679                                 incCount = 0;
00680 
00681                                 uExt = uExt + duExt;
00682                                 dLoadStep = dLoadStep*10;
00683                                 if (loadStep + dLoadStep > 1.0)
00684                                 {
00685                                         uExt = uExt + duExt*(1.0 - loadStep)/dLoadStep;
00686                                         dLoadStep = 1.0 - loadStep;
00687                                         incCount = 9;
00688                                 }
00689                         }
00690                 }
00691         }
00692 
00693         // determination of stiffness matrix and the residual force vector for the element
00694 
00695         formR(fSpring);
00696 
00697         formK(kSpring);
00698 
00699         dg.Zero();
00700         // commmited external and internal displacement update
00701         for (int ig = 0; ig < 13; ig++ ) {
00702                 if (ig<12)
00703                 {
00704                         dg(ig) = Ut(ig);
00705                 }               
00706         }
00707         dg(12) = uInt(0);
00708         dg(13) = uInt(1);
00709         dg(14) = uInt(2);
00710         dg(15) = uInt(3);
00711 }
00712 
00713 void BeamColumnJoint2d::getMatResponse(Vector U, Vector &fS, Vector &kS)
00714 {
00715         double jh = HgtFac;            // factor for beams
00716         double jw = WdtFac;            // factor for column
00717 
00718         // obtains the material response from the material class
00719         Vector defSpring(13);
00720         defSpring.Zero();
00721         fS.Zero();
00722         kS.Zero();
00723 
00724         defSpring.addMatrixVector(0.0, BCJoint, U, 1.0);
00725 
00726         // slip @ bar = slip @ spring * tc couple
00727 
00728         defSpring(0) = defSpring(0)*jw;                   // new model applied on 
00729         defSpring(1) = defSpring(1)*jw;                   // 4th June 2004
00730         defSpring(6) = defSpring(6)*jw;                   // h, h_bar distinction was
00731         defSpring(7) = defSpring(7)*jw;                   // removed from the previous model
00732 
00733         defSpring(3)  = defSpring(3)*jh;                  // by making h = h_bar
00734         defSpring(4)  = defSpring(4)*jh;                  // similar case done for width
00735         defSpring(9) = defSpring(9)*jh;
00736         defSpring(10) = defSpring(10)*jh;
00737 
00738         for (int j=0; j<13; j++)
00739         {
00740                 MaterialPtr[j]->setTrialStrain(defSpring(j));
00741                 kS(j) = MaterialPtr[j]->getTangent();
00742                 fS(j) = MaterialPtr[j]->getStress();
00743         }
00744 
00745         // force @ spring = force @ bar * tc couple
00746 
00747         fS(0) = fS(0)*jw;
00748         fS(1) = fS(1)*jw;
00749         fS(6) = fS(6)*jw;
00750         fS(7) = fS(7)*jw;
00751 
00752         fS(3) = fS(3)*jh;
00753         fS(4) = fS(4)*jh;
00754         fS(9) = fS(9)*jh;
00755         fS(10) = fS(10)*jh;
00756 
00757         // stiffness @ spring = stiffness @ bar * (tc couple)^2
00758 
00759         kS(0) = kS(0)*jw*jw;
00760         kS(1) = kS(1)*jw*jw;
00761         kS(6) = kS(6)*jw*jw;
00762         kS(7) = kS(7)*jw*jw;
00763 
00764         kS(3) = kS(3)*jh*jh;
00765         kS(4) = kS(4)*jh*jh;
00766         kS(9) = kS(9)*jh*jh;
00767         kS(10) = kS(10)*jh*jh;
00768 
00769 }
00770 
00771 void BeamColumnJoint2d::getdDef_du()
00772 {       
00773         dDef_du.Zero();
00774         
00775         for (int jb=0; jb<13; jb++)
00776         {
00777                 dDef_du(jb,0) = BCJoint(jb,12);
00778                 dDef_du(jb,1) = BCJoint(jb,13);
00779                 dDef_du(jb,2) = BCJoint(jb,14);
00780                 dDef_du(jb,3) = BCJoint(jb,15);
00781         }
00782 }
00783 
00784 void BeamColumnJoint2d::matDiag(Vector k,Matrix &dfd)
00785 {
00786         dfd.Zero();
00787         // takes in a vector and converts it to a diagonal matrix (could have been placed as a method in matrix class)
00788         for (int ja=0; ja<13; ja++)
00789         {
00790                 dfd(ja,ja) = k(ja);
00791         }
00792 }
00793 
00794 void BeamColumnJoint2d::formR(Vector f)
00795 {
00796         // develops the element residual force vector
00797         Vector rForceTemp(16);
00798         rForceTemp.Zero();
00799         
00800         rForceTemp.addMatrixTransposeVector(0.0,BCJoint,f,1.0);   // rForceTemp = BCJoint'*f
00801         R.Extract(rForceTemp,0,1.0);
00802 }
00803 
00804 void BeamColumnJoint2d::formK(Vector k)
00805 {
00806     // develops the element stiffness matrix
00807         Matrix kSprDiag(13,13);
00808         kSprDiag.Zero();
00809     Matrix kRForce(16,16);
00810         kRForce.Zero();
00811         Matrix kRFT1(4,12);
00812         kRFT1.Zero();
00813         Matrix kRFT2(4,4);
00814         kRFT2.Zero();
00815         Matrix kRFT3(12,4);
00816         kRFT3.Zero();
00817         Matrix I(4,4);
00818         I.Zero();
00819         Matrix kRSTinv(4,4);
00820         kRSTinv.Zero();
00821     Matrix kRF(12,12);
00822         kRF.Zero();
00823         Matrix K2Temp(12,4);
00824         K2Temp.Zero();
00825         Matrix K2(12,12);
00826         K2.Zero();
00827 
00828         matDiag(k,kSprDiag);
00829 
00830         kRForce.addMatrixTripleProduct(0.0,BCJoint,kSprDiag,1.0);    // kRForce = BCJoint'*kSprDiag*BCJoint
00831         kRFT2.Extract(kRForce,12,12,1.0);
00832         kRFT1.Extract(kRForce,12,0,1.0);
00833         kRFT3.Extract(kRForce,0,12,1.0);
00834         kRF.Extract(kRForce,0,0,1.0);
00835         
00836     for (int ic=0; ic<4; ic++)
00837         {
00838                 I(ic,ic) = 1.0;
00839         }
00840         kRFT2.Solve(I,kRSTinv);
00841         
00842         K2Temp.addMatrixProduct(0.0,kRFT3,kRSTinv,1.0);
00843 
00844         // loop done for some idiotic reason
00845         for(int i = 0; i < 12; ++i)
00846         {       
00847                 for(int j = 0; j < 4; ++j)
00848                 {
00849                         if(fabs(K2Temp(i,j)) < 1e-15)
00850                                 K2Temp(i,j) = 0.;
00851                 }
00852         }
00853 
00854         K2.addMatrixProduct(0.0,K2Temp,kRFT1,1.0);
00855 
00856         // loop done for some idiotic reason
00857         for(int i1 = 0; i1 < 12; ++i1)
00858         {       
00859                 for(int j1 = 0; j1 < 12; ++j1)
00860                 {
00861                         if(fabs(K2(i1,j1)) < 1e-15)
00862                                 K2(i1,j1) = 0.;
00863                 }
00864         }
00865 
00866         kRF.addMatrix(1.0,K2,-1.0);
00867         
00868         K = kRF;    // K = kRF - kRFT3*kRSTinv*kRFT1
00869 }
00870 
00871 void BeamColumnJoint2d::getdg_df()
00872 {
00873                 dg_df.Zero();        // basically derivative of intEq
00874                 dg_df(0,2) = -1;
00875                 dg_df(0,3) = -1;
00876                 dg_df(0,9) = 1;
00877                 dg_df(0,12) = -1/elemHeight; 
00878                 dg_df(1,1) = 1;
00879                 dg_df(1,5) = -1;
00880                 dg_df(1,7) = -1;
00881                 dg_df(1,12) = 1/elemWidth;
00882                 dg_df(2,4) = -1;
00883                 dg_df(2,8) = -1;
00884                 dg_df(2,10) = 1;
00885                 dg_df(2,12) = 1/elemHeight;
00886                 dg_df(3,0) = 1;
00887                 dg_df(3,6) = -1;
00888                 dg_df(3,11) = -1;
00889                 dg_df(3,12) = -1/elemWidth;
00890 
00891 }
00892 
00893 void BeamColumnJoint2d::getBCJoint() 
00894 {
00895         BCJoint.Zero();                  // basically the transformation matrix for the element
00896         BCJoint(0,1) =  -1;
00897         BCJoint(0,2) =  elemWidth/2;
00898         BCJoint(0,15) = 1;
00899         BCJoint(1,1) =  -1;
00900         BCJoint(1,2) =  -elemWidth/2;
00901         BCJoint(1,13) = 1;
00902         BCJoint(2,0) =  1;
00903         BCJoint(2,12) = -1;
00904         BCJoint(3,3) =  1;
00905         BCJoint(3,5) =  elemHeight/2;
00906         BCJoint(3,12) = -1;
00907         BCJoint(4,3) = 1;
00908         BCJoint(4,5) = -elemHeight/2;
00909         BCJoint(4,14) = -1;
00910         BCJoint(5,4) = 1;
00911         BCJoint(5,13) = -1;
00912         BCJoint(6,7) =  1;
00913         BCJoint(6,8) =  -elemWidth/2;
00914         BCJoint(6,15) = -1;
00915         BCJoint(7,7) =  1;
00916         BCJoint(7,8) =  elemWidth/2;
00917         BCJoint(7,13) = -1;
00918         BCJoint(8,6) =  1;
00919         BCJoint(8,14) = -1;
00920         BCJoint(9,9) =  -1;
00921         BCJoint(9,11) =  -elemHeight/2;
00922         BCJoint(9,12) = 1;
00923         BCJoint(10,9) = -1;
00924         BCJoint(10,11) = elemHeight/2;
00925         BCJoint(10,14) = 1;
00926         BCJoint(11,10) = 1;
00927         BCJoint(11,15) = -1;
00928         BCJoint(12,12) = -1/elemHeight;
00929         BCJoint(12,13) = 1/elemWidth;
00930         BCJoint(12,14) = 1/elemHeight;
00931         BCJoint(12,15) = -1/elemWidth;
00932 
00933         // based upon the new formulation 
00934         BCJoint(2,2) = -(elemActHeight - elemHeight)/2;
00935         BCJoint(5,5) = -(elemActWidth - elemWidth)/2;
00936         BCJoint(8,8) = (elemActHeight - elemHeight)/2;;
00937         BCJoint(11,11) = (elemActWidth - elemWidth)/2;;
00938 
00939 }
00940 
00941 double BeamColumnJoint2d::getStepSize(double s0,double s1,Vector uExt,Vector duExt,Vector uInt,Vector duInt,double tol)
00942 {
00943         Vector u(16);    u.Zero();
00944         Vector fSpr(13); fSpr.Zero();
00945         Vector kSpr(13); kSpr.Zero();
00946         Vector intEq(4); intEq.Zero();
00947 
00948         double r0 = 0.0;            // tolerance chcek for line-search
00949         double tolerance = 0.8;     // slack region tolerance set for line-search
00950     
00951         if (s0 != 0.0)
00952                 r0 = fabs(s1/s0);
00953 
00954         if (r0 <= tolerance)
00955                 return 1.0;   // Linsearch Not required residual decrease less than tolerance
00956 
00957         if (s1 == s0)
00958                 return 1.0;   // Bisection would have divide by zero error if continued
00959 
00960         // set some variables
00961         double etaR;
00962         double eta = 1.0;
00963         double s = s1;
00964         double etaU = 1.0;
00965         double etaL = 0.0;
00966         double sU = s1;
00967         double sL = s0;
00968         double r = r0;
00969         double etaJ = 1.0;
00970 
00971         double minEta = 0.1;
00972         double maxEta = 10.0;
00973         int maxIter = 20;
00974 
00975         // bracket the region
00976         int count = 0;
00977         while ((sU*sL > 0.0) && (etaU < maxEta)) {
00978                 count ++;
00979                 etaU *= 2.0;
00980                 etaR = etaU - etaJ;
00981 
00982                 for (int i = 0; i < 12; i++) {
00983                         u(i) = uExt(i) + duExt(i);
00984                 }
00985                 u(12) = uInt(0) - etaR*duInt(0);
00986                 u(13) = uInt(1) - etaR*duInt(1);
00987                 u(14) = uInt(2) - etaR*duInt(2);
00988                 u(15) = uInt(3) - etaR*duInt(3);
00989 
00990                 getMatResponse(u,fSpr,kSpr);
00991 
00992                 intEq(0) = -fSpr(2) - fSpr(3) + fSpr(9) - fSpr(12)/elemHeight;
00993                 intEq(1) = fSpr(1) - fSpr(5) - fSpr(7) + fSpr(12)/elemWidth;
00994                 intEq(2) = -fSpr(4) - fSpr(8) + fSpr(10) + fSpr(12)/elemHeight;
00995                 intEq(3) = fSpr(0) - fSpr(6) - fSpr(11) - fSpr(12)/elemWidth;
00996 
00997                 sU = duInt^intEq;
00998 
00999                 // check if we are happy with the solution
01000                 r = fabs(sU/s0);
01001                 if (r < tolerance)
01002                         return etaU;
01003 
01004                 etaJ = etaU;
01005         }
01006 
01007         if (sU*sL > 0.0)   // no bracketing could be done
01008                 return 1.0;
01009 
01010         count = 0;
01011         while (r > tolerance && count < maxIter) {
01012                 count ++;
01013                 eta = (etaU + etaL)/2.0;
01014 
01015                 if (r > r0) eta = 1.0;
01016 
01017                 etaR = eta - etaJ;
01018 
01019                 for (int i = 0; i < 12; i++) {
01020                         u(i) = uExt(i) + duExt(i);
01021                 }
01022                 u(12) = uInt(0) - etaR*duInt(0);
01023                 u(13) = uInt(1) - etaR*duInt(1);
01024                 u(14) = uInt(2) - etaR*duInt(2);
01025                 u(15) = uInt(3) - etaR*duInt(3);
01026 
01027                 getMatResponse(u,fSpr,kSpr);
01028 
01029                 intEq(0) = -fSpr(2) - fSpr(3) + fSpr(9) - fSpr(12)/elemHeight;
01030                 intEq(1) = fSpr(1) - fSpr(5) - fSpr(7) + fSpr(12)/elemWidth;
01031                 intEq(2) = -fSpr(4) - fSpr(8) + fSpr(10) + fSpr(12)/elemHeight;
01032                 intEq(3) = fSpr(0) - fSpr(6) - fSpr(11) - fSpr(12)/elemWidth;
01033 
01034                 s = duInt^intEq;
01035 
01036                 // check if we are happy with the solution
01037                 r = fabs(s/s0);
01038 
01039                 // set variables for next iteration 
01040                 etaJ = eta;
01041                 
01042                 if (s*sU < 0.0) {
01043                         etaL = eta;
01044                         sL = s;
01045                 } else if (s*sU == 0.0) {
01046                         count = maxIter;
01047                 } else {
01048                         etaU = eta;
01049                         sU = s;
01050                 }
01051 
01052                 if (sL == sU)
01053                         count = maxIter;
01054 
01055         }
01056 
01057         return eta;
01058 }
01059     
01060 const Matrix &
01061 BeamColumnJoint2d::getDamp(void)
01062 {
01063         //not applicable (stiffness being returned)
01064         return K;
01065 }
01066 
01067 const Matrix &
01068 BeamColumnJoint2d::getMass(void)
01069 { 
01070         //not applicable  (stiffness being returned)
01071         return K;
01072 }
01073 
01074 void 
01075 BeamColumnJoint2d::zeroLoad(void)
01076 {
01077         //not applicable  
01078         return;
01079 }
01080 
01081 int 
01082 BeamColumnJoint2d::addLoad(ElementalLoad *theLoad, double loadFactor)
01083 {
01084         //not applicable
01085         return 0;
01086 }
01087 
01088 int 
01089 BeamColumnJoint2d::addInertiaLoadToUnbalance(const Vector &accel)
01090 {
01091         //not applicable
01092         return 0;
01093 }
01094 
01095 
01096 const Vector &
01097 BeamColumnJoint2d::getResistingForceIncInertia()
01098 {       
01099   //not applicable (residual being returned)
01100         return R;
01101 }
01102 
01103 int
01104 BeamColumnJoint2d::sendSelf(int commitTag, Channel &theChannel)
01105 {
01106         // yet to do.
01107         return -1;
01108 }
01109 
01110 int
01111 BeamColumnJoint2d::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
01112 {
01113         // yet to do.
01114         return -1;
01115 }
01116 
01117 int
01118 BeamColumnJoint2d::displaySelf(Renderer &theViewer, int displayMode, float fact)
01119 {
01120         const Vector &node1Crd = nodePtr[0]->getCrds();
01121         const Vector &node2Crd = nodePtr[1]->getCrds(); 
01122         const Vector &node3Crd = nodePtr[2]->getCrds();
01123         const Vector &node4Crd = nodePtr[3]->getCrds();
01124 
01125         const Vector &node1Disp = nodePtr[0]->getDisp();
01126         const Vector &node2Disp = nodePtr[1]->getDisp();    
01127         const Vector &node3Disp = nodePtr[2]->getDisp();
01128         const Vector &node4Disp = nodePtr[3]->getDisp();  
01129 
01130         static Vector v1(3);
01131         static Vector v2(3);
01132         static Vector v3(3);
01133         static Vector v4(3);
01134         
01135         // calculate the current coordinates of four external nodes
01136         for (int i=0; i<2; i++) 
01137     {
01138                 v1(i) = node1Crd(i)+node1Disp(i)*fact;
01139                 v2(i) = node2Crd(i)+node2Disp(i)*fact;
01140                 v3(i) = node3Crd(i)+node3Disp(i)*fact;
01141                 v4(i) = node4Crd(i)+node4Disp(i)*fact;
01142         }
01143         
01144         // calculate four corners of the element
01145         Vector vb(3);
01146         Vector vc(3);
01147 
01148         vb = v1 - v3;
01149         vc = v2 - v4;
01150 
01151         v1 = v1 - 0.5 * vc;
01152         v2 = v1 + vc;
01153         v3 = v4 + 0.5 * vb;
01154         v4 = v4 + vb;
01155         
01156         int dummy;
01157         dummy = theViewer.drawLine(v1, v2, 1.0, 1.0);
01158         dummy = theViewer.drawLine(v2, v4, 1.0, 1.0);
01159         dummy = theViewer.drawLine(v4, v3, 1.0, 1.0);
01160         dummy = theViewer.drawLine(v3, v1, 1.0, 1.0);
01161 
01162         return 0;
01163 
01164 }
01165 
01166 void
01167 BeamColumnJoint2d::Print(OPS_Stream &s, int flag)
01168 {
01169         s << "Element: " << this->getTag() << " Type: Beam Column Joint " << endln;
01170         for (int i = 0; i<4; i++)
01171         {
01172                 s << "Node :" << connectedExternalNodes(i);
01173                 s << "DOF :" << nodePtr[i]->getNumberDOF();
01174         }
01175         return;
01176 }
01177 
01178 Response*
01179 BeamColumnJoint2d::setResponse(const char **argv, int argc, Information &eleInfo, OPS_Stream &output)
01180 {
01181   // we will compare argv[0] to determine the type of response required
01182   
01183   if (strcmp(argv[0],"node1BarSlipL") == 0 || strcmp(argv[0],"node1BarslipL") ==0 || strcmp(argv[0],"Node1BarSlipL") == 0)
01184     return MaterialPtr[0]->setResponse(&argv[1], argc-1, eleInfo, output);
01185   
01186   else if (strcmp(argv[0],"node1BarSlipR") == 0 || strcmp(argv[0],"node1BarslipR") ==0 || strcmp(argv[0],"Node1BarSlipR") == 0)
01187     return MaterialPtr[1]->setResponse(&argv[1], argc-1, eleInfo, output);
01188   
01189   else if (strcmp(argv[0],"node1InterfaceShear") == 0 || strcmp(argv[0],"node1Interfaceshear") ==0 || strcmp(argv[0],"Node1InterfaceShear") ==0 )
01190     return MaterialPtr[2]->setResponse(&argv[1], argc-1, eleInfo, output);
01191   
01192   else if (strcmp(argv[0],"node2BarSlipB") == 0 || strcmp(argv[0],"node2BarslipB") ==0 || strcmp(argv[0],"Node2BarSlipB") == 0)
01193     return MaterialPtr[3]->setResponse(&argv[1], argc-1, eleInfo, output);
01194   
01195   else if (strcmp(argv[0],"node2BarSlipT") == 0 || strcmp(argv[0],"node2BarslipT") ==0 || strcmp(argv[0],"Node2BarSlipT") == 0)
01196     return MaterialPtr[4]->setResponse(&argv[1], argc-1, eleInfo, output);
01197   
01198   else if (strcmp(argv[0],"node2InterfaceShear") == 0 || strcmp(argv[0],"node2Interfaceshear") ==0 || strcmp(argv[0],"Node2InterfaceShear") ==0 )
01199     return MaterialPtr[5]->setResponse(&argv[1], argc-1, eleInfo, output);
01200   
01201   else if (strcmp(argv[0],"node3BarSlipL") == 0 || strcmp(argv[0],"node3BarslipL") ==0 || strcmp(argv[0],"Node3BarSlipL") == 0)
01202     return MaterialPtr[6]->setResponse(&argv[1], argc-1, eleInfo, output);
01203   
01204   else if (strcmp(argv[0],"node3BarSlipR") == 0 || strcmp(argv[0],"node3BarslipR") ==0 || strcmp(argv[0],"Node3BarSlipR") == 0)
01205     return MaterialPtr[7]->setResponse(&argv[1], argc-1, eleInfo, output);
01206   
01207   else if (strcmp(argv[0],"node3InterfaceShear") == 0 || strcmp(argv[0],"node3Interfaceshear") ==0 || strcmp(argv[0],"Node3InterfaceShear") ==0 )
01208     return MaterialPtr[8]->setResponse(&argv[1], argc-1, eleInfo, output);
01209   
01210   else if (strcmp(argv[0],"node4BarSlipB") == 0 || strcmp(argv[0],"node4BarslipB") ==0 || strcmp(argv[0],"Node4BarSlipB") == 0)
01211     return MaterialPtr[9]->setResponse(&argv[1], argc-1, eleInfo, output);
01212   
01213   else if (strcmp(argv[0],"node4BarSlipT") == 0 || strcmp(argv[0],"node4BarslipT") ==0 || strcmp(argv[0],"Node4BarSlipT") == 0)
01214     return MaterialPtr[10]->setResponse(&argv[1], argc-1, eleInfo, output);
01215   
01216   else if (strcmp(argv[0],"node4InterfaceShear") == 0 || strcmp(argv[0],"node4Interfaceshear") ==0 || strcmp(argv[0],"Node4InterfaceShear") ==0 )
01217     return MaterialPtr[11]->setResponse(&argv[1], argc-1, eleInfo, output);
01218   
01219   else if (strcmp(argv[0],"shearpanel") == 0 || strcmp(argv[0],"shearPanel") ==0)
01220     return MaterialPtr[12]->setResponse(&argv[1], argc-1, eleInfo, output);
01221   
01222   
01223   else if (strcmp(argv[0],"externalDisplacement") == 0 || strcmp(argv[0],"externaldisplacement") == 0)
01224     return new ElementResponse(this,1,Vector(12));
01225     
01226   else if (strcmp(argv[0],"internalDisplacement") == 0 || strcmp(argv[0],"internaldisplacement") == 0)
01227     return new ElementResponse(this,2,Vector(4));
01228   
01229   else if (strcmp(argv[0],"deformation") == 0 || strcmp(argv[0],"Deformation") == 0)
01230     return new ElementResponse(this,3,Vector(4));
01231   
01232   else
01233     return 0;
01234 }
01235 
01236 int 
01237 BeamColumnJoint2d::getResponse(int responseID, Information &eleInfo)
01238 {
01239         static Vector delta(13);
01240         static Vector def(4);
01241         static Vector U(16);
01242         int tr,ty;
01243         double bsFa, bsFb, bsFc, bsFd;
01244         double bsFac, bsFbd, isFac, isFbd; 
01245 
01246         switch (responseID) {
01247         case 1:       
01248                 if(eleInfo.theVector!=0)
01249                 {
01250                         (*(eleInfo.theVector))(0) = UeprCommit(0);
01251                         (*(eleInfo.theVector))(1) = UeprCommit(1);
01252                         (*(eleInfo.theVector))(2) = UeprCommit(2);
01253                         (*(eleInfo.theVector))(3) = UeprCommit(3);
01254                         (*(eleInfo.theVector))(4) = UeprCommit(4);
01255                         (*(eleInfo.theVector))(5) = UeprCommit(5);
01256                         (*(eleInfo.theVector))(6) = UeprCommit(6);
01257                         (*(eleInfo.theVector))(7) = UeprCommit(7);
01258                         (*(eleInfo.theVector))(8) = UeprCommit(8);
01259                         (*(eleInfo.theVector))(9) = UeprCommit(9);
01260                         (*(eleInfo.theVector))(10) = UeprCommit(10);
01261                         (*(eleInfo.theVector))(11) = UeprCommit(11);
01262                 }
01263                 return 0;
01264 
01265         case 2:
01266                 if (eleInfo.theVector !=0) {
01267                         (*(eleInfo.theVector))(0) = UeprIntCommit(0);
01268                         (*(eleInfo.theVector))(1) = UeprIntCommit(1);
01269                         (*(eleInfo.theVector))(2) = UeprIntCommit(2);
01270                         (*(eleInfo.theVector))(3) = UeprIntCommit(3);
01271                 }
01272                 return 0;
01273 
01274         case 3:
01275 
01276                 for (ty =0; ty <12; ty++)
01277                 {
01278                         U(ty) = UeprCommit(ty);
01279                 }
01280                 for (tr = 0; tr <4 ; tr++)
01281                 {
01282                         U(12+tr) = UeprIntCommit(tr);
01283                 }
01284 
01285                 delta.addMatrixVector(0.0,BCJoint,U,1.0);
01286                 
01287                 bsFa = fabs(delta(0) - delta(1))/elemWidth;
01288                 bsFc = fabs(delta(7) - delta(6))/elemWidth;
01289                 bsFac = bsFa + bsFc;
01290                 bsFb = fabs(delta(4) - delta(3))/elemHeight;
01291                 bsFd = fabs(delta(10) - delta(9))/elemHeight;
01292                 bsFbd = bsFb + bsFd;
01293 
01294                 def(0) = bsFac + bsFbd; // contribution of bar slip deformation
01295                 
01296                 
01297                 isFac = (delta(2) + delta(8))/elemHeight;
01298                 isFbd = (delta(5) + delta(11))/elemWidth;
01299 
01300                 def(1) = isFac + isFbd;  // contribution due to interface shear spring
01301 
01302                 def(2) = delta(12);  // contribution due to shear panel
01303 
01304                 def(3) = def(0) + def(1) + def(2);  // total joint deformation
01305 
01306 
01307                 return eleInfo.setVector(def);
01308         default:
01309                 return -1;
01310         }
01311 }
01312 
01313 int
01314 BeamColumnJoint2d::setParameter (char **argv, int argc, Information &info)
01315 {
01316   return -1;
01317 }
01318     
01319 int
01320 BeamColumnJoint2d::updateParameter (int parameterID, Information &info)
01321 {
01322   return -1;
01323 }

Generated on Mon Oct 23 15:05:07 2006 for OpenSees by doxygen 1.5.0