xc
fElement.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 /* ****************************************************************** **
29 ** OpenSees - Open System for Earthquake Engineering Simulation **
30 ** Pacific Earthquake Engineering Research Center **
31 ** **
32 ** **
33 ** (C) Copyright 1999, The Regents of the University of California **
34 ** All Rights Reserved. **
35 ** **
36 ** Commercial use of this program without express permission of the **
37 ** University of California, Berkeley, is strictly prohibited. See **
38 ** file 'COPYRIGHT' in main directory for information on usage and **
39 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
40 ** **
41 ** Developed by: **
42 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
43 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
44 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
45 ** **
46 ** ****************************************************************** */
47 
48 // $Revision: 1.4 $
49 // $Date: 2003/02/14 23:01:08 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/element/special/feap/fElement.h,v $
51 
52 
53 #ifndef fElement_h
54 #define fElement_h
55 
56 // File: ~/element/fortran/fElement.h
57 //
58 // Written: fmk
59 // Created: 03/99
60 // Revision: A
61 //
62 // Description: This file contains the class definition for fElement. fElement
63 // is a wrapper used to call fortran element subroutine. It is an abstract class.
64 //
65 // What: "@(#) fElement.h, revA"
66 
67 #include "domain/mesh/element/Element.h"
68 #include "domain/mesh/element/utils/NodePtrs.h"
69 
70 namespace XC {
71 class Node;
72 class Channel;
73 class UniaxialMaterial;
74 
79 //
82 class fElement: public Element
83  {
84  private:
85  // private attributes - a copy for each object of the class
86  double *h;
87  NodePtrs theNodes;
88  double *u;
89  double *d;
90  int eleType;
91  int ndf;
92  int nen;
93  int ndm;
94  int nh1, nh3;
95  int nrCount;
96 
97  Matrix *Ki;
98 
99  // static data - single copy for all objects of the class
100  static std::vector<Matrix *> fElementM; // class wide matrices - use s array
101  static std::vector<Vector *> fElementV; // class wide vectors - use r array
102  static std::vector<double> s; // element tangent (nst x nst)
103  static std::vector<double> r; // element residual (ndf x nen) == (nst)
104  static std::vector<double> ul; // nodal responses (ndf x nen x 5) == (nst X 5)
105  static std::vector<double> xl; // nodal coordinates (ndf x nen) == (nst)
106  static std::vector<double> tl; // nodal temp (nen)
107  static std::vector<int> ix; // nodal tags (nen)
108  static int numfElements;
109  protected:
110  // protected methods
111  virtual int invokefRoutine(int ior, int iow, double *ctan, int isw);
112  virtual int readyfRoutine(bool incInertia);
113  virtual int invokefInit(int isw, int iow);
114 
115  // protected data
116  Vector feapData;
117  ID connectedNodes;
118  public:
119  // constructors
120  fElement(int tag,
121  int classTag,
122  int eleType,
123  int sizeD, int nen,
124  int ndm, int ndf,
125  int nh1, int nh3);
126 
127  fElement(int tag,
128  int classTag,
129  int eleType,
130  int sizeD, int nen,
131  int ndm, int ndf, int iow);
132 
133  fElement(int classTag);
134 
135  // destructor
136  virtual ~fElement();
137 
138  // public methods for element operations
139  virtual int getNumExternalNodes(void) const;
140  virtual const ID &getExternalNodes(void) const;
141 
142  virtual int getNumDOF(void) const;
143  virtual void setDomain(Domain *theDomain);
144 
145  virtual int commitState(void);
146  virtual int revertToLastCommit(void);
147  virtual int revertToStart(void);
148  virtual int update(void);
149 
150  virtual const Matrix &getTangentStiff(void) const;
151  const Matrix &getInitialStiff(void) const;
152  virtual const Matrix &getDamp(void) const;
153  virtual const Matrix &getMass(void) const;
154 
155  virtual void zeroLoad(void);
156  virtual int addLoad(ElementalLoad *theLoad, double loadFactor);
157  virtual int addInertiaLoadToUnbalance(const Vector &accel);
158 
159  virtual const Vector &getResistingForce(void) const;
160  virtual const Vector &getResistingForceIncInertia(void) const;
161 
162  // public methods for output
163  virtual int sendSelf(Communicator &);
164  virtual int recvSelf(const Communicator &);
165  virtual void Print(std::ostream &s, int flag =0) const;
166  };
167 } // end of XC namespace
168 
169 #endif
170 
171 
172 
173 
Float vector abstraction.
Definition: Vector.h:94
virtual int revertToLastCommit(void)
Revert to the last committed state.
Definition: fElement.cpp:366
virtual const Matrix & getMass(void) const
Returns the mass matrix.
Definition: fElement.cpp:466
virtual const Vector & getResistingForce(void) const
Returns the resisting force vector for the element.
Definition: fElement.cpp:540
virtual int getNumDOF(void) const
return the number of DOF associated with the element.
Definition: fElement.cpp:252
Communication parameters between processes.
Definition: Communicator.h:66
virtual void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: fElement.cpp:643
Vector of integers.
Definition: ID.h:95
virtual const Matrix & getDamp(void) const
Returns the damping matrix.
Definition: fElement.cpp:426
Base class for the finite elements.
Definition: Element.h:112
virtual int getNumExternalNodes(void) const
return the number of external nodes associated with the element.
Definition: fElement.cpp:246
virtual int recvSelf(const Communicator &)
Receive the object.
Definition: fElement.cpp:636
Wrapper used to call fortran element subroutines from FEAP.
Definition: fElement.h:82
virtual const Vector & getResistingForceIncInertia(void) const
Returns the resisting force vector including inertia forces.
Definition: fElement.cpp:586
Element pointers to nodes.
Definition: NodePtrs.h:60
virtual int revertToStart(void)
Reverts the element to its initial state.
Definition: fElement.cpp:378
virtual int sendSelf(Communicator &)
Send the object.
Definition: fElement.cpp:630
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
virtual void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: fElement.cpp:255
Matrix of floats.
Definition: Matrix.h:111
Base class for loads over elements.
Definition: ElementalLoad.h:79
virtual int update(void)
Updates the element state.
Definition: fElement.cpp:927
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
virtual int commitState(void)
Commit the current element state.
Definition: fElement.cpp:350
virtual void zeroLoad(void)
Zeroes the loads over the element.
virtual const Matrix & getTangentStiff(void) const
Return the tangent stiffness matrix.
Definition: fElement.cpp:382