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
00031
00032
00033 #ifndef UpdatedLagrangianElement2D
00034 #define UpdatedLagrangianElement2D
00035
00036
00037 #include <bool.h>
00038 #include <Node.h>
00039 #include <Matrix.h>
00040 #include <Vector.h>
00041 #include <Element.h>
00042 #include <ID.h>
00043
00044 #define min_(a,b) (((a) < (b)) ? (a) : (b))
00045 #define max_(a,b) (((a) > (b)) ? (a) : (b))
00046 #define sign(a) (((a) < (0)) ?(-1) : (1))
00047
00048 class Response;
00049
00050 class UpdatedLagrangianBeam2D : public Element
00051 {
00052 public:
00053
00054 UpdatedLagrangianBeam2D(int classTag);
00055 UpdatedLagrangianBeam2D(int tag, int classTag, int nd1, int nd2, bool islinear = false);
00056
00057 virtual ~UpdatedLagrangianBeam2D();
00058
00060
00061
00063 public:
00064 virtual int update(void);
00065
00066
00067
00068 int getNumExternalNodes(void) const;
00069 const ID &getExternalNodes(void);
00070 Node **getNodePtrs(void);
00071
00072 int getNumDOF(void);
00073 virtual void setDomain(Domain *theDomain);
00074
00075 virtual int commitState(void);
00076 virtual int revertToLastCommit(void);
00077
00078
00079
00080 virtual const Matrix &getTangentStiff(void);
00081 virtual const Matrix &getInitialStiff(void);
00082 virtual const Matrix &getMass(void);
00083
00084
00085 virtual Vector &getUVLoadVector(double q1, double q2);
00086 void zeroLoad(void);
00087 int addLoad(const Vector &load);
00088 int addLoad(ElementalLoad *theLoad, double loadFactor)
00089 { return -1;}
00090 int addInertiaLoadToUnbalance(const Vector &accel)
00091 { return -1;}
00092
00093 virtual const Vector &getResistingForce(void);
00094 const Vector &getResistingForceIncInertia(void);
00095
00096
00097 virtual int displaySelf(Renderer &theViewer,
00098 int displayMode, float fact);
00099
00100 virtual Response *setResponse(const char **argv, int argc,
00101 Information &eleInformation);
00102 virtual int getResponse(int responseID, Information &eleInformation);
00103
00104 protected:
00105
00106 virtual void getLocalStiff(Matrix &K)=0;
00107 virtual void getLocalMass(Matrix &M)=0;
00108
00109
00110 void getIncrLocalDisp(Vector &localDisp);
00111 void getTrialNaturalDisp(Vector &localDisp);
00112 void getIncrNaturalDisp(Vector &nDisp);
00113 void getConvLocalDisp(Vector &lDisp);
00114 void getTrialLocalDisp(Vector &lDisp);
00115 void getTrialLocalForce(Vector &force);
00116
00117 virtual void updateState(void);
00118
00119 void addInternalGeomStiff(Matrix &K);
00120 void addExternalGeomStiff(Matrix &K);
00121
00122 void transformToGlobal(Matrix &K);
00123
00124 protected:
00125
00126 bool isLinear;
00127 int numDof;
00128 double L, sn, cs, massDof;
00129
00130 ID connectedExternalNodes;
00131 Vector load;
00132
00133 Node *end1Ptr, *end2Ptr;
00134 double L_hist, cs_hist, sn_hist;
00135
00136 Vector eleForce, eleForce_hist;
00137
00138 int nodeRecord, dofRecord;
00139 int m_Iter;
00140
00141 Matrix *Ki;
00142
00143 static Matrix K, Kg, Kt;
00144 static Matrix M;
00145 static Matrix D;
00146 static Matrix T;
00147
00148 static Vector disp;
00149 static Vector force;
00150
00151
00152
00153 static Vector ZeroVector;
00154 static Matrix ZeroMatrix;
00155
00156
00157 static Vector end1IncrDisp;
00158 static Vector end2IncrDisp;
00159
00160 static Node *theNodes[2];
00161 };
00162
00163
00164 #endif // !defined(UpdatedLagrangianElement2D)