Elastic2DGNL.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 ** See file 'COPYRIGHT'  in main directory for information on usage   **
00010 ** and redistribution of OpenSees, and for a DISCLAIMER OF ALL        **
00011 ** WARRANTIES.                                                        **
00012 **                                                                    **
00013 ** Element2dGNL.cpp: implementation of the Element2dGNL class         **
00014 ** Developed by:                                                      **
00015 **    Rohit Kaul       (rkaul@stanford.edu)                           **
00016 **    Greg Deierlein   (ggd@stanford.edu)                             **
00017 **                                                                    **
00018 **           John A. Blume Earthquake Engineering Center              **
00019 **                    Stanford University                             **
00020 ** ****************************************************************** **/
00021 
00022 #include <Domain.h>
00023 #include <Channel.h>
00024 #include <FEM_ObjectBroker.h>
00025 #include <Renderer.h>
00026 #include <math.h>
00027 #include <stdlib.h>
00028 
00029 #include "Elastic2DGNL.h"
00030 
00031 #define Ele_TAG_Elastic2dGNL -1
00032  
00034 // Construction/Destruction
00036 
00037 
00038 // Constructor
00039 Elastic2dGNL::Elastic2dGNL(int tag, double a, double e, double i, int Nd1, int Nd2, 
00040                            bool islinear, double rho)
00041   :UpdatedLagrangianBeam2D(tag, Ele_TAG_Elastic2dGNL, Nd1, Nd2, islinear),
00042    A(a), E(e), Iz(i)
00043 {
00044   massDof = A*L*rho;
00045   massDof = massDof/2;
00046 
00047 }
00048 
00049 Elastic2dGNL::~Elastic2dGNL()
00050 {
00051 
00052 }
00053 
00054 void Elastic2dGNL::getLocalMass(Matrix &M)
00055 {
00056     if(massDof < 0)
00057     {
00058             opserr << "Elastic2dGNL::getMass - Distributed mass not implemented\n";
00059             M.Zero();
00060     }
00061     else if(massDof == 0)//this cond. is taken care of already
00062     {
00063         M.Zero();
00064     }
00065     else
00066     {
00067         M.Zero();
00068             M(0,0) = M(1,1) = M(2,2) = M(3,3) = M(4,4) = M(5,5) = massDof;
00069     }
00070 
00071 }
00072 
00073 void Elastic2dGNL::getLocalStiff(Matrix &K)
00074 {
00075  double EIbyL = E*Iz/L_hist;
00076  double l = L_hist;
00077 
00078     K(0, 1) = K(0, 2) = K(0, 4) = K(0, 5)=0;
00079     K(1, 0) = K(1, 3) =0;
00080     K(2, 0) = K(2, 3) =0;
00081     K(3, 1) = K(3, 2) = K(3, 4) = K(3, 5)=0;
00082     K(4, 0) = K(4, 3) =0;
00083     K(5, 0) = K(5, 3) =0;
00084 
00085         K(0,0) = K(3,3) = (A/Iz)*(EIbyL);
00086         K(0,3) = K(3,0) = (-A/Iz)*(EIbyL);
00087         K(1,1) = K(4,4) = (12/(l*l))*(EIbyL);
00088         K(1,4) = K(4,1) = (-12/(l*l))*(EIbyL);
00089         K(1,2) = K(2,1) = K(1,5) = K(5,1) = (6/l)*(EIbyL);
00090         K(2,4) = K(4,2) = K(4,5) = K(5,4) = (-6/l)*(EIbyL);
00091         K(2,2) = K(5,5) = 4*(EIbyL);
00092         K(2,5) = K(5,2) = 2*(EIbyL);
00093         
00094 
00095 }//getLocalStiff
00096 
00097 
00098 
00099 void Elastic2dGNL::Print(OPS_Stream &s, int flag)
00100 {
00101     s << "\nElement No: " << this->getTag();
00102     s << " type: Elastic2dGNL  iNode: " << connectedExternalNodes(0);
00103     s << " jNode: " << connectedExternalNodes(1);
00104         if(isLinear) s << "(1st-Order):\n";
00105         else             s << "(2nd-Order):\n";
00106 }
00107 
00108 int Elastic2dGNL::sendSelf(int commitTag, Channel &theChannel)
00109 {
00110         opserr << "WARNING (W_C_10) - Elastic2dGNL::sendSelf(..) [" << getTag() <<"]\n";
00111         opserr << "method not implemented\n";
00112         return -1;
00113 }
00114 
00115 int Elastic2dGNL::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
00116 {
00117         opserr << "WARNING (W_C_20) - Elastic2dGNL::recvSelf(..) [" << getTag() <<"]\n";
00118         opserr << "method not implemented\n";
00119         return -1;
00120 }
00121 

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