EightNodeBrick.h

Go to the documentation of this file.
00001 
00002 //
00003 // COPYLEFT (C):     :-))
00004 //``This  source code is Copyrighted in U.S., by the The Regents of the University
00005 //of California, for an indefinite period, and anybody caught using it without our
00006 //permission,  will  be  mighty  good friends of ourn, cause we don't give a darn.
00007 //Hack  it.  Compile it. Debug it. Run it. Yodel it. Enjoy it. We wrote it, that's
00008 //all we wanted to do.'' bj
00009 // PROJECT:           Object Oriented Finite Element Program
00010 // FILE:              EightNodeBrick.h
00011 // CLASS:             EightNodeBrick
00012 // MEMBER FUNCTIONS:
00013 //
00014 // MEMBER VARIABLES
00015 //
00016 // PURPOSE:           Finite Element Class
00017 // RETURN:
00018 // VERSION:
00019 // LANGUAGE:          C++.ver >= 3.0
00020 // TARGET OS:         DOS || UNIX || . . .
00021 // DESIGNER:          Boris Jeremic, Zhaohui Yang and Xiaoyan Wu
00022 // PROGRAMMER:        Boris Jeremic, Zhaohui Yang  and Xiaoyan Wu
00023 // DATE:              Aug. 2000
00024 // UPDATE HISTORY:                       Modified from Brick3D and FourNodeQuad.hh  07/06/00
00025 //                                                                                                                                                       Sept. - Oct 2000 connected to OpenSees by Zhaohui
00026 //                                                                                                                                                       Sept 2001 optimized to some extent (static tensors...)
00027 //
00029 //
00030 
00031 
00032 #ifndef EIGHTNODEBRICK_H
00033 #define EIGHTNODEBRICK_H
00034 
00035 #ifndef _bool_h
00036 #include "bool.h"
00037 #endif
00038 
00039 #include <Element.h>
00040 #include <Node.h>
00041 
00042 // Commented by Xiaoyan. Use  ~/fem/node.hh  08/04/00
00043 // Released Node.h now. Wu use Opensees's Node.09/27/00
00044 
00045 
00046 #include <ID.h>
00047 #include <Renderer.h>
00048 #include <Domain.h>
00049 #include <string.h>
00050 
00051 #include <GaussQuadRule1d.h>
00052 
00053 #include <OPS_Globals.h>
00054 
00055 #include <Matrix.h>
00056 #include <Vector.h>
00057 
00058 // Xiaoyan added from brick3d.hh   07/11/00
00059 #include <basics.h>
00060 #include <BJtensor.h>
00061 #include <nDarray.h>
00062 #include <stresst.h>
00063 #include <straint.h>
00064 
00065 //#include <node.h>
00066 //#include <mmodel.h>
00067 //#include <fe.h>
00068 #include <MatPoint3D.h>
00069 
00070 #include <NDMaterial.h>
00071 #include <Template3Dep.h>
00072 
00073 #include <NDMaterial.h>
00074 #include <Matrix.h>
00075 #include <Vector.h>
00076 #include <ID.h>
00077 #include <Renderer.h>
00078 #include <Domain.h>
00079 #include <string.h>
00080 #include <Information.h>
00081 #include <Channel.h>
00082 #include <FEM_ObjectBroker.h>
00083 #include <ElementResponse.h>
00084 
00085 #include <ElementalLoad.h>
00086 
00087 
00088 
00089 class Node;
00090 //class NDMaterial;
00091 //class QuadRule1d;
00092 
00093 class EightNodeBrick: public Element
00094 {
00095 
00096   public:
00097     EightNodeBrick(int element_number,
00098                    int node_numb_1, int node_numb_2, int node_numb_3, int node_numb_4,
00099                    int node_numb_5, int node_numb_6, int node_numb_7, int node_numb_8,
00100                    NDMaterial * Globalmmodel, double b1, double b2, double b3,
00101                   double r, double p);
00102    // int dir, double surflevel);
00103    //, EPState *InitEPS);   const char * type,
00104 
00105     EightNodeBrick ();
00106     ~EightNodeBrick();
00107 
00108     //Not needed Zhaohui
00109     //int Initialize(int element_number,
00110     //               int node_numb_1, int node_numb_2, int node_numb_3, int node_numb_4,
00111     //               int node_numb_5, int node_numb_6, int node_numb_7, int node_numb_8,
00112     //               NDMaterial * Globalmmodel, double b1, double b2, double b3,
00113     //               double p, double r);
00114     //             //, EPState * InitEPS);const char * type,
00115 
00116     // update, Guanzhou added Apr. 2004 to update incremental strain in the domain
00117     int update(void);
00118 
00119     int getNumExternalNodes () const;
00120     const ID &getExternalNodes ();
00121     Node **getNodePtrs(void);
00122 
00123     int getNumDOF ();
00124     void setDomain(Domain *theDomain);
00125 
00126     // public methods to set the state of the element
00127     int commitState ();
00128     int revertToLastCommit ();
00129     int revertToStart ();
00130 
00131     // public methods to obtain stiffness, mass, damping and residual information
00132     // We haven't build the following functions.
00133     // All the value of K M Dmp and F are nothing. just
00134     // want to test the program.  Xiaoyan 08/16/00
00135     const Matrix &getTangentStiff ();
00136     const Matrix &getInitialStiff();
00137     const Matrix &getMass ();
00138 
00139     const Matrix &getConsMass ();
00140 
00141     void zeroLoad ();
00142     int addLoad(ElementalLoad *theLoad, double loadFactor);
00143     int addInertiaLoadToUnbalance(const Vector &accel);
00144 
00145     const Vector  FormEquiBodyForce(void);
00146     const Vector &getResistingForce ();
00147     const Vector &getResistingForceIncInertia ();
00148 
00149     // public methods for element output
00150     int sendSelf (int commitTag, Channel &theChannel);
00151     int recvSelf (int commitTag, Channel &theChannel, FEM_ObjectBroker
00152                   &theBroker);
00153     int displaySelf (Renderer &theViewer, int displayMode, float fact);
00154     void Print(OPS_Stream &s, int flag =0);
00155     //    Do nothing with void Print (OPS_Stream &s, int flag =0);
00156     //    use Brick3D report.  08/16/00
00157     Response *setResponse (const char **argv, int argc, Information &eleInformation);
00158     int getResponse (int responseID, Information &eleInformation);
00159 
00160   protected:
00161 
00162   private:
00163     // private attributes - a copy for each object of the class
00164 
00165     //NDMaterial * **theMaterial; // pointer to the ND material objects
00166 
00167     int numDOF;                 // Number of element DOF
00168     ID  connectedExternalNodes; // Tags of quad nodes
00169 
00170     Matrix *Ki;
00171     Node *theNodes[8];
00172 
00173     static Matrix K;            // Element stiffness Matrix
00174     static Matrix C;            // Element damping matrix
00175     static Matrix M;            // Element mass matrix
00176     static Vector P;            // Element resisting force vector
00177     Vector Q;           // Applied nodal loads
00178     Vector bf;          // Body forces
00179 
00180     //Vector q0;  // hold element load affects q0 and p0 in one vector
00181 
00182     // double thickness;        // Element thickness
00183     double rho;         // Mass per unit volume
00184     double pressure;    // Normal surface traction (pressure) over entire element
00185     int    order;       // Order of the quadrature rule
00186 
00187     //int dir;            // Direction of vertial coord.
00188     //double surflevel;   // free surface level above or below this element
00189 
00190     //QuadRule1d *theQuadRule;  // Integration rule
00191 
00192 //    Matrix J;         // Jacobian of transformation
00193 //    Matrix L;         // Inverse of J
00194 //    Matrix B;         // Strain interpolation matrix
00195 
00196 
00197     //    // static data - single copy for all objects of the class
00198     //    static G3Matrix N;    // Displacement interpolation matrix
00199 
00200     //    // private member functions - only objects of this class can call these
00201     //    void setJacobian (double r, double s, double t);         // Xiaoyan changed
00202     //    double formDetJ (double r, double s, double t);          // xi, eta to r and s
00203     //    void formBMatrix (double r, double s, double t);         // and added t
00204     //    static void formNMatrix (double r, double s, double t);  // 07/06/00
00205 
00206   private:
00207     // element number (tag)
00208     //unsigned int  elem_numb;
00209 
00210     double determinant_of_Jacobian;
00211     //int  G_N_numbs[8];     // Global node numbers for this element  Xiaoyan changed from 20 to 8
00212 
00213     int nodes_in_brick;      // number of nodes ( from 8-20 //8 now Zhaohui)
00214 
00215     //Node * nodes;          // pointer to GLOBAL nodes
00216 
00217     NDMaterial * mmodel;     // pointer to GLOBAL material models
00218 
00219     int r_integration_order; // Gauss-Legendre integration order in r direction
00220     int s_integration_order; // Gauss-Legendre integration order in s direction
00221     int t_integration_order; // Gauss-Legendre integration order in t direction
00222 
00223     // Now I want 3D array of Material points!
00224     // MatPoint3D[r_integration_order][s_integration_order][t_integration_order]
00225     // 3D array of Material points
00226     MatPoint3D ** matpoint;  // pointer to array of Material Points
00227 
00228     // 3D array of material models for each Material points
00229     // NDMaterial *GPmmodel;  // pointer to array of material models for Material Points
00230     // Do we need this one?
00231 
00232     //..NDMaterial  *MatPoint;  // Zhaohui  10-01-2000
00233 
00234 
00235     int  LM[24]; // for 8noded x 3 = 24
00236   public:
00237 
00238     void incremental_Update(void);
00239     //void iterative_Update(void);
00240 
00241 
00242     tensor H_3D(double r1, double r2, double r3);
00243     tensor interp_poli_at(double r, double s, double t);
00244     tensor dh_drst_at(double r, double s, double t);
00245 
00246 
00247     //CE Dynamic Allocation for for brick3d s.
00248     //Finite_Element * new_el( int total );
00249     EightNodeBrick & operator[](int subscript);
00250     //Finite_Element & operator[](int subscript);
00251     //Finite_Element & operator[](int subscript);
00252 
00253     tensor getStiffnessTensor(void);
00254     //matrix stiffness_tensor(void);
00255 
00256     void set_strain_stress_tensor(FILE *fp, double * u);
00257     tensor getMassTensor(void);
00258 //out19Jan2001     double Potential_Energy(void);
00259 
00260     tensor Jacobian_3D(tensor dh);
00261     tensor Jacobian_3Dinv(tensor dh);
00262     tensor Nodal_Coordinates(void);
00263 
00264     tensor incr_disp(void);
00265     tensor total_disp(void);
00266 
00267     tensor total_disp(FILE *fp, double * u);
00268 
00269     tensor stiffness_matrix(const tensor & K);
00270     tensor mass_matrix(const tensor & M);
00271 
00272 
00273     int  get_global_number_of_node(int local_node_number);
00274     int  get_Brick_Number(void);
00275 
00276     int * get_LM(void);
00277     //void set_LM(Node * node); // commented out temporarily 09-27-2000 Zhaohui
00278 
00279     //these two files are originally in fe.h
00280     double get_Gauss_p_c(short order, short point_numb);
00281     double get_Gauss_p_w(short order, short point_numb);
00282 
00283     // returns nodal forces for given stress field in an element
00284     tensor nodal_forces(void);
00285     // returns nodal forces for ITERATIVE stress field in an element
00286     tensor iterative_nodal_forces(void);
00287     // returns nodal forces for given constant stress field in the element
00288     tensor nodal_forces_from_stress(stresstensor & );
00289     // returns nodal forces for given incremental strain field in an element
00290     // by using the linearized constitutive tensor from the begining of the step !
00291     tensor linearized_nodal_forces(void);
00292     // updates Material point stresses and strains from given displacements
00293     tensor update_stress_strain(tensor & disp);
00294 
00295     void report(char *);
00296     void reportshort(char *);
00297     void reportPAK(char *);
00298     void reportpqtheta(int);
00299     //void reportLM(char *);
00300     void computeGaussPoint(void);
00301     void reportCIPIC(char *);
00302     void reportTensorF(FILE *);
00303 
00304     // Setting initial E according to the initial pressure
00305     //void setInitE(void);
00306     //void reportStressTensorF(FILE *);
00307 
00308 };
00309 
00310 
00311 #endif
00312 

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