NewElement.cpp

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.7 $
00022 // $Date: 2006/09/05 21:02:06 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/element/NewElement.cpp,v $
00024                                                                         
00025 // Written: fmk 
00026 // Created: 08/01
00027 //
00028 // Description: This file contains the implementation for the NewElement class.
00029 //
00030 // What: "@(#) NewElement.cpp, revA"
00031 
00032 #include "NewElement.h"
00033 #include <Information.h>
00034 #include <ElementResponse.h>
00035 
00036 #include <Domain.h>
00037 #include <Node.h>
00038 #include <Channel.h>
00039 #include <FEM_ObjectBroker.h>
00040 #include <Renderer.h>
00041 #include <OPS_Globals.h>
00042 #include <OPS_Stream.h>
00043 
00044 static int NUM_NODE =2;
00045 static int NUM_DOF  =4;
00046 
00047 // constructors:
00048 NewElement::NewElement(int tag)
00049  :Element(tag,ELE_TAG_NewElement),     
00050   connectedExternalNodes(2), theMatrix(NUM_DOF, NUM_DOF), theVector(NUM_DOF)
00051 {
00052 
00053 }
00054 
00055 NewElement::NewElement()
00056  :Element(0,ELE_TAG_NewElement),     
00057   connectedExternalNodes(2), theMatrix(NUM_DOF, NUM_DOF), theVector(NUM_DOF)
00058 {
00059 
00060 }
00061 
00062 //  destructor:
00063 NewElement::~NewElement()
00064 {
00065 
00066 }
00067 
00068 
00069 int
00070 NewElement::getNumExternalNodes(void) const
00071 {
00072     return NUM_NODE;
00073 }
00074 
00075 const ID &
00076 NewElement::getExternalNodes(void) 
00077 {
00078     return connectedExternalNodes;
00079 }
00080 
00081 Node **
00082 NewElement::getNodePtrs(void)
00083 {
00084   return 0;
00085 }
00086 
00087 int
00088 NewElement::getNumDOF(void) 
00089 {
00090     return NUM_DOF;
00091 }
00092 
00093 
00094 void
00095 NewElement::setDomain(Domain *theDomain)
00096 {
00097     // call the base class method
00098     this->DomainComponent::setDomain(theDomain);
00099 
00100 }        
00101 
00102 
00103 int
00104 NewElement::commitState()
00105 {
00106   int retVal = 0;
00107 
00108   // call the base class method
00109   retVal = this->Element::commitState();
00110   if (retVal < 0) {
00111     opserr << "NewElement::commitState() - failed in base class\n";
00112     return retVal;
00113   }
00114 
00115   return retVal;
00116 }
00117 
00118 int
00119 NewElement::revertToLastCommit()
00120 {
00121   return 0;
00122 }
00123 
00124 int
00125 NewElement::revertToStart()
00126 {
00127   return 0;
00128 }
00129 
00130 int
00131 NewElement::update(void)
00132 {
00133   return 0;
00134 }
00135 
00136 
00137 const Matrix &
00138 NewElement::getTangentStiff(void)
00139 {
00140   return theMatrix;
00141 }
00142 
00143 const Matrix &
00144 NewElement::getInitialStiff(void)
00145 {
00146   return theMatrix;
00147 }
00148     
00149 void 
00150 NewElement::zeroLoad(void)
00151 {
00152   return;
00153 }
00154 
00155 int 
00156 NewElement::addLoad(const Vector &addP)
00157 {
00158   return 0;
00159 }
00160 
00161 int 
00162 NewElement::addInertiaLoadToUnbalance(const Vector &accel)
00163 {
00164   return 0;
00165 }
00166 
00167 const Vector &
00168 NewElement::getResistingForce()
00169 {       
00170   return theVector;
00171 }
00172 
00173 
00174 const Vector &
00175 NewElement::getResistingForceIncInertia()
00176 {       
00177   return theVector;
00178 }
00179 
00180 
00181 int
00182 NewElement::sendSelf(int commitTag, Channel &theChannel)
00183 {
00184   return -1;
00185 }
00186 
00187 int
00188 NewElement::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
00189 {
00190   return -1;
00191 }
00192 
00193 
00194 int
00195 NewElement::displaySelf(Renderer &theViewer, int displayMode, float fact)
00196 {
00197   return 0;
00198 }
00199 
00200 
00201 void
00202 NewElement::Print(OPS_Stream &s, int flag)
00203 {
00204   return;
00205 }
00206 
00207 
00208 Response*
00209 NewElement::setResponse(const char **argv, int argc, Information &eleInfo, OPS_Stream &S)
00210 {
00211         return this->Element::setResponse(argv, argc, eleInfo, S);
00212 }
00213 
00214 
00215 int 
00216 NewElement::getResponse(int responseID, Information &eleInfo)
00217 {
00218         return this->Element::getResponse(responseID, eleInfo);
00219 }
00220 
00221 
00222 int
00223 NewElement::setParameter(const char **argv, int argc, Parameter &param)
00224 {
00225   return 0;
00226 }
00227     
00228 
00229 int
00230 NewElement::updateParameter(int parameterID, Information &info)
00231 {
00232   return -1;
00233 }

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