ZeroLength.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.9 $
00022 // $Date: 2006/08/04 21:50:27 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/element/zeroLength/ZeroLength.h,v $
00024                                                                         
00025                                                                         
00026 #ifndef ZeroLength_h
00027 #define ZeroLength_h
00028 
00029 // File: ~/element/zeroLength/ZeroLength.h
00030 // 
00031 // Written: GLF
00032 // Created: 12/99
00033 // Revision: A
00034 //
00035 // Description: This file contains the class definition for ZeroLength.
00036 // A ZeroLength element is defined by two nodes with the same coordinate.
00037 // One or more material objects may be associated with the nodes to
00038 // provide a force displacement relationship.
00039 // ZeroLength element will work with 1d, 2d, or 3d material models.
00040 //
00041 // What: "@(#) ZeroLength.h, revA"
00042 
00043 #include <Element.h>
00044 #include <Matrix.h>
00045 
00046 // Tolerance for zero length of element
00047 #define LENTOL 1.0e-6
00048 
00049 // Type of dimension of element NxDy has dimension x=1,2,3 and
00050 // y=2,4,6,12 degrees-of-freedom for the element
00051 enum Etype { D1N2, D2N4, D2N6, D3N6, D3N12 };
00052 
00053 
00054 class Node;
00055 class Channel;
00056 class UniaxialMaterial;
00057 class Response;
00058 
00059 class ZeroLength : public Element
00060 {
00061   public:
00062     
00063     // Constructor for a single 1d material model
00064     ZeroLength(int tag,                               
00065                int dimension,
00066                int Nd1, int Nd2, 
00067                const Vector& x,
00068                const Vector& yprime,
00069                UniaxialMaterial& theMaterial,
00070                int direction );
00071 
00072     // Constructor for a multiple 1d material models
00073     ZeroLength(int tag,                               
00074                int dimension,
00075                int Nd1, int Nd2, 
00076                const Vector& x,
00077                const Vector& yprime,
00078                int n1dMat,
00079                UniaxialMaterial** theMaterial,  
00080                const ID& direction );
00081 
00082     ZeroLength();    
00083     ~ZeroLength();
00084 
00085     const char *getClassType(void) const {return "ZeroLength";};
00086 
00087     // public methods to obtain inforrmation about dof & connectivity    
00088     int getNumExternalNodes(void) const;
00089     const ID &getExternalNodes(void);
00090     Node **getNodePtrs(void);
00091 
00092     int getNumDOF(void);        
00093     void setDomain(Domain *theDomain);
00094 
00095     // public methods to set the state of the element    
00096     int commitState(void);
00097     int revertToLastCommit(void);        
00098     int revertToStart(void);        
00099     int update(void);
00100 
00101     // public methods to obtain stiffness, mass, damping and residual information    
00102     const Matrix &getTangentStiff(void);
00103     const Matrix &getInitialStiff(void);
00104     const Matrix &getDamp(void);
00105     const Matrix &getMass(void);
00106 
00107     void zeroLoad(void);        
00108     int addLoad(ElementalLoad *theLoad, double loadFactor);
00109     int addInertiaLoadToUnbalance(const Vector &accel);    
00110 
00111     const Vector &getResistingForce(void);
00112     const Vector &getResistingForceIncInertia(void);            
00113 
00114     // public methods for element output
00115     int sendSelf(int commitTag, Channel &theChannel);
00116     int recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker);
00117     int displaySelf(Renderer &theViewer, int displayMode, float fact);    
00118     void Print(OPS_Stream &s, int flag =0);    
00119 
00120     Response *setResponse(const char **argv, int argc, Information &eleInformation, OPS_Stream &s);
00121     int getResponse(int responseID, Information &eleInformation);
00122     
00123     void updateDir (const Vector& x, const Vector& y);
00124 
00125   protected:
00126     
00127   private:
00128           Etype elemType;
00129 
00130     // private methods
00131     void   setUp ( int Nd1, int Nd2, const Vector& x, const Vector& y);
00132     void   checkDirection (  ID& dir ) const;
00133     
00134     void   setTran1d ( Etype e, int n );
00135     double computeCurrentStrain1d ( int mat, const Vector& diff ) const;    
00136 
00137     // private attributes - a copy for each object of the class
00138     ID  connectedExternalNodes;         // contains the tags of the end nodes
00139     int dimension;                      // = 1, 2, or 3 dimensions
00140     int numDOF;                         // number of dof for ZeroLength
00141     Matrix transformation;              // transformation matrix for orientation
00142         
00143     Node *theNodes[2];
00144 
00145     Matrix *theMatrix;          // pointer to objects matrix (a class Matrix)
00146     Vector *theVector;          // pointer to objects vector (a class Vector)
00147 
00148     // Storage for uniaxial material models
00149     int numMaterials1d;                    // number of 1d materials
00150     UniaxialMaterial **theMaterial1d;      // array of pointers to 1d materials
00151     ID                     *dir1d;         // array of directions 0-5 for 1d materials
00152     Matrix                 *t1d;           // hold the transformation matrix
00153 
00154     // static data - single copy for all objects of the class   
00155     static Matrix ZeroLengthM2;   // class wide matrix for 2*2
00156     static Matrix ZeroLengthM4;   // class wide matrix for 4*4
00157     static Matrix ZeroLengthM6;   // class wide matrix for 6*6
00158     static Matrix ZeroLengthM12;  // class wide matrix for 12*12
00159     static Vector ZeroLengthV2;   // class wide Vector for size 2
00160     static Vector ZeroLengthV4;   // class wide Vector for size 4
00161     static Vector ZeroLengthV6;   // class wide Vector for size 6
00162     static Vector ZeroLengthV12;  // class wide Vector for size 12
00163 };
00164 
00165 #endif
00166 
00167 
00168 
00169 

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