Brick.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.12 $
00022 // $Date: 2006/08/04 21:25:56 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/element/brick/Brick.h,v $
00024 
00025 // Ed "C++" Love
00026 //
00027 // Eight node Brick element 
00028 //
00029 
00030 #include <stdio.h> 
00031 #include <stdlib.h> 
00032 #include <math.h> 
00033 
00034 #include <ID.h> 
00035 #include <Vector.h>
00036 #include <Matrix.h>
00037 #include <Element.h>
00038 #include <Node.h>
00039 #include <NDMaterial.h>
00040 
00041 class Brick : public Element {
00042 
00043   public :
00044     
00045     //null constructor
00046     Brick();
00047   
00048     //full constructor
00049     Brick(int tag, 
00050           int node1,
00051           int node2,
00052           int node3,
00053           int node4,
00054           int node5,
00055           int node6,
00056           int node7,
00057           int node8,
00058           NDMaterial &theMaterial,
00059           double b1 = 0.0, double b2 = 0.0, double b3 = 0.0);
00060     
00061     //destructor 
00062     virtual ~Brick( ) ;
00063 
00064     const char *getClassType(void) const {return "Brick";};
00065 
00066     //set domain
00067     void setDomain( Domain *theDomain ) ;
00068 
00069     //get the number of external nodes
00070     int getNumExternalNodes( ) const ;
00071 
00072     //return connected external nodes
00073     const ID &getExternalNodes( ) ;
00074     Node **getNodePtrs(void);
00075 
00076     //return number of dofs
00077     int getNumDOF( ) ;
00078 
00079     //commit state
00080     int commitState( ) ;
00081     
00082     //revert to last commit 
00083     int revertToLastCommit( ) ;
00084     
00085     //revert to start 
00086     int revertToStart( ) ;
00087 
00088     // update
00089     int update(void);
00090 
00091     //print out element data
00092     void Print( OPS_Stream &s, int flag ) ;
00093         
00094     //return stiffness matrix 
00095     const Matrix &getTangentStiff();
00096     const Matrix &getInitialStiff();    
00097     const Matrix &getMass();    
00098 
00099     void zeroLoad( ) ;
00100     int addLoad(ElementalLoad *theLoad, double loadFactor);
00101     int addInertiaLoadToUnbalance(const Vector &accel);
00102 
00103     //get residual
00104     const Vector &getResistingForce( ) ;
00105     
00106     //get residual with inertia terms
00107     const Vector &getResistingForceIncInertia( ) ;
00108 
00109     // public methods for element output
00110     int sendSelf (int commitTag, Channel &theChannel);
00111     int recvSelf (int commitTag, Channel &theChannel, FEM_ObjectBroker 
00112                   &theBroker);
00113       
00114     Response *setResponse(const char **argv, int argc, Information &eleInformation, OPS_Stream &s);
00115     int getResponse(int responseID, Information &eleInformation);
00116 
00117     //plotting 
00118     int displaySelf(Renderer &theViewer, int displayMode, float fact);
00119 
00120   private : 
00121     //
00122     // private attributes
00123     //
00124 
00125     ID connectedExternalNodes ;  //four node numbers
00126     Node *nodePointers[8] ;      //pointers to eight nodes
00127 
00128     //material information
00129     NDMaterial *materialPointers[8]; //pointers to eight materials
00130 
00131     double b[3];                // Body forces
00132     Vector *load;
00133     Matrix *Ki;
00134 
00135     //
00136     // static attributes
00137     //
00138 
00139     static Matrix stiff ;
00140     static Vector resid ;
00141     static Matrix mass ;
00142     static Matrix damping ;
00143 
00144     //quadrature data
00145     static const double root3 ;
00146     static const double one_over_root3 ;    
00147     static const double sg[2] ;
00148     static const double wg[8] ;
00149   
00150     //local nodal coordinates, three coordinates for each of four nodes
00151     static double xl[3][8] ; 
00152 
00153     //
00154     // private methods
00155     //
00156 
00157     //inertia terms
00158     void formInertiaTerms( int tangFlag ) ;
00159 
00160     //form residual and tangent                                   
00161     void formResidAndTangent( int tang_flag ) ;
00162 
00163     //compute coordinate system
00164     void computeBasis( ) ;
00165 
00166     //compute B matrix
00167     const Matrix& computeB( int node, const double shp[4][8] ) ;
00168   
00169     //Matrix transpose
00170     Matrix transpose( int dim1, int dim2, const Matrix &M ) ;
00171 
00172 } ; 
00173 
00174 
00175 
00176 
00177 
00178 
00179 

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