00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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
00046 Brick();
00047
00048
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
00062 virtual ~Brick( ) ;
00063
00064 const char *getClassType(void) const {return "Brick";};
00065
00066
00067 void setDomain( Domain *theDomain ) ;
00068
00069
00070 int getNumExternalNodes( ) const ;
00071
00072
00073 const ID &getExternalNodes( ) ;
00074 Node **getNodePtrs(void);
00075
00076
00077 int getNumDOF( ) ;
00078
00079
00080 int commitState( ) ;
00081
00082
00083 int revertToLastCommit( ) ;
00084
00085
00086 int revertToStart( ) ;
00087
00088
00089 int update(void);
00090
00091
00092 void Print( OPS_Stream &s, int flag ) ;
00093
00094
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
00104 const Vector &getResistingForce( ) ;
00105
00106
00107 const Vector &getResistingForceIncInertia( ) ;
00108
00109
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
00118 int displaySelf(Renderer &theViewer, int displayMode, float fact);
00119
00120 private :
00121
00122
00123
00124
00125 ID connectedExternalNodes ;
00126 Node *nodePointers[8] ;
00127
00128
00129 NDMaterial *materialPointers[8];
00130
00131 double b[3];
00132 Vector *load;
00133 Matrix *Ki;
00134
00135
00136
00137
00138
00139 static Matrix stiff ;
00140 static Vector resid ;
00141 static Matrix mass ;
00142 static Matrix damping ;
00143
00144
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
00151 static double xl[3][8] ;
00152
00153
00154
00155
00156
00157
00158 void formInertiaTerms( int tangFlag ) ;
00159
00160
00161 void formResidAndTangent( int tang_flag ) ;
00162
00163
00164 void computeBasis( ) ;
00165
00166
00167 const Matrix& computeB( int node, const double shp[4][8] ) ;
00168
00169
00170 Matrix transpose( int dim1, int dim2, const Matrix &M ) ;
00171
00172 } ;
00173
00174
00175
00176
00177
00178
00179