Truss.h

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.15 $
00022 // $Date: 2006/09/05 21:15:19 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/element/truss/Truss.h,v $
00024                                                                         
00025                                                                         
00026 #ifndef Truss_h
00027 #define Truss_h
00028 
00029 // Written: fmk 
00030 // Created: 07/98
00031 // Revision: A
00032 //
00033 // Description: This file contains the class definition for Truss. A Truss object
00034 // provides the abstraction of the small deformation bar element. Each truss
00035 // object is assocaited with a material object. This Truss element will work
00036 // in 1d, 2d or 3d problems.
00037 //
00038 // What: "@(#) Truss.h, revA"
00039 
00040 #include <Element.h>
00041 #include <Matrix.h>
00042 
00043 class Node;
00044 class Channel;
00045 class UniaxialMaterial;
00046 
00047 class Truss : public Element
00048 {
00049   public:
00050     Truss(int tag, 
00051           int dimension,
00052           int Nd1, int Nd2, 
00053           UniaxialMaterial &theMaterial,
00054           double A, double rho=0.0);
00055     
00056     Truss();    
00057     ~Truss();
00058 
00059     const char *getClassType(void) const {return "Truss";};
00060 
00061     // public methods to obtain inforrmation about dof & connectivity    
00062     int getNumExternalNodes(void) const;
00063     const ID &getExternalNodes(void);
00064     Node **getNodePtrs(void);
00065 
00066     int getNumDOF(void);        
00067     void setDomain(Domain *theDomain);
00068 
00069     // public methods to set the state of the element    
00070     int commitState(void);
00071     int revertToLastCommit(void);        
00072     int revertToStart(void);        
00073     int update(void);
00074     
00075     // public methods to obtain stiffness, mass, damping and residual information    
00076     const Matrix &getKi(void);
00077     const Matrix &getTangentStiff(void);
00078     const Matrix &getInitialStiff(void);
00079     const Matrix &getDamp(void);    
00080     const Matrix &getMass(void);    
00081 
00082     void zeroLoad(void);        
00083     int addLoad(ElementalLoad *theLoad, double loadFactor);
00084     int addInertiaLoadToUnbalance(const Vector &accel);
00085 
00086     const Vector &getResistingForce(void);
00087     const Vector &getResistingForceIncInertia(void);            
00088 
00089     // public methods for element output
00090     int sendSelf(int commitTag, Channel &theChannel);
00091     int recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker);
00092     int displaySelf(Renderer &theViewer, int displayMode, float fact);    
00093     void Print(OPS_Stream &s, int flag =0);    
00094 
00095     Response *setResponse(const char **argv, int argc, Information &eleInfo, OPS_Stream &s);
00096     int getResponse(int responseID, Information &eleInformation);
00097 
00098     // AddingSensitivity:BEGIN //////////////////////////////////////////
00099     int            addInertiaLoadSensitivityToUnbalance(const Vector &accel, bool tag);
00100     int setParameter(const char **argv, int argc, Parameter &param);
00101     int            updateParameter(int parameterID, Information &info);
00102     int            activateParameter(int parameterID);
00103     const Vector & getResistingForceSensitivity(int gradNumber);
00104     const Matrix & getKiSensitivity(int gradNumber);
00105     const Matrix & getMassSensitivity(int gradNumber);
00106     int            commitSensitivity(int gradNumber, int numGrads);
00107     // AddingSensitivity:END ///////////////////////////////////////////
00108 
00109   protected:
00110     
00111   private:
00112     double computeCurrentStrain(void) const;
00113     double computeCurrentStrainRate(void) const;
00114     
00115     // private attributes - a copy for each object of the class
00116     UniaxialMaterial *theMaterial;  // pointer to a material
00117     ID  connectedExternalNodes;     // contains the tags of the end nodes
00118     int dimension;                  // truss in 2 or 3d domain
00119     int numDOF;                     // number of dof for truss
00120 
00121     Vector *theLoad;     // pointer to the load vector P
00122     Matrix *theMatrix; // pointer to objects matrix (a class wide Matrix)
00123     Vector *theVector; // pointer to objects vector (a clas wide Vector)
00124 
00125     double L;       // length of truss based on undeformed configuration
00126     double A;       // area of truss
00127     double rho;         // rho: mass density per unit length
00128 
00129     double cosX[3]; // direction cosines
00130 
00131     Node *theNodes[2];
00132         
00133 // AddingSensitivity:BEGIN //////////////////////////////////////////
00134     int parameterID;
00135     Vector *theLoadSens;
00136 // AddingSensitivity:END ///////////////////////////////////////////
00137 
00138     // static data - single copy for all objects of the class   
00139     static Matrix trussM2;   // class wide matrix for 2*2
00140     static Matrix trussM4;   // class wide matrix for 4*4
00141     static Matrix trussM6;   // class wide matrix for 6*6
00142     static Matrix trussM12;  // class wide matrix for 12*12
00143     static Vector trussV2;   // class wide Vector for size 2
00144     static Vector trussV4;   // class wide Vector for size 44
00145     static Vector trussV6;   // class wide Vector for size 6
00146     static Vector trussV12;  // class wide Vector for size 12
00147 };
00148 
00149 #endif
00150 
00151 
00152 
00153 

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