xc
ZeroLength.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.8 $
49 // $Date: 2003/02/25 23:33:13 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/element/zeroLength/ZeroLength.h,v $
51 
52 
53 #ifndef ZeroLength_h
54 #define ZeroLength_h
55 
56 // File: ~/element/zero_length/ZeroLength.h
57 //
58 // Written: GLF
59 // Created: 12/99
60 // Revision: A
61 //
62 // Description: This file contains the class definition for ZeroLength.
63 // A ZeroLength element is defined by two nodes with the same coordinate.
64 // One or more material objects may be associated with the nodes to
65 // provide a force displacement relationship.
66 // ZeroLength element will work with 1d, 2d, or 3d material models.
67 //
68 // What: "@(#) ZeroLength.h, revA"
69 
70 #include <domain/mesh/element/Element0D.h>
71 #include "material/uniaxial/ZeroLengthMaterials.h"
72 #include <utility/matrix/Matrix.h>
73 #include <material/uniaxial/DqUniaxialMaterial.h>
74 
75 
76 // Type of dimension of element NxDy has dimension x=1,2,3 and
77 // y=2,4,6,12 degrees-of-freedom for the element
78 enum Etype { D1N2, D2N4, D2N6, D3N6, D3N12 };
79 
80 
81 namespace XC {
82 class Node;
83 class Channel;
84 class UniaxialMaterial;
85 class Response;
86 
88 //
100 class ZeroLength: public Element0D
101  {
102  private:
103  Etype elemType;
104  Matrix *theMatrix;
105  Vector *theVector;
106  // Storage for uniaxial material models
107  ZeroLengthMaterials theMaterial1d;
108 
109  Matrix t1d;
110  Vector persistentInitialDeformation;
111 
112  // private methods
113  void checkDirection(ID &dir) const;
114 
115  void setUp(int Nd1, int Nd2,const Vector &x,const Vector &y);
116  void setTran1d ( Etype e, int n );
117  double computeCurrentStrain1d(int mat, const Vector& diff ) const;
118 
119 
120 
121  // static data - single copy for all objects of the class
122  static Matrix ZeroLengthM2; // class wide matrix for 2*2
123  static Matrix ZeroLengthM4; // class wide matrix for 4*4
124  static Matrix ZeroLengthM6; // class wide matrix for 6*6
125  static Matrix ZeroLengthM12; // class wide matrix for 12*12
126  static Vector ZeroLengthV2; // class wide Vector for size 2
127  static Vector ZeroLengthV4; // class wide Vector for size 4
128  static Vector ZeroLengthV6; // class wide Vector for size 6
129  static Vector ZeroLengthV12; // class wide Vector for size 12
130 
131  protected:
132  void setUpType(const size_t &);
133  void setUpType(void);
134 
135  DbTagData &getDbTagData(void) const;
136  int sendData(Communicator &);
137  int recvData(const Communicator &);
138 
139  const Material *get_material_ptr(const std::string &) const;
140 
141  public:
142  ZeroLength(int tag= 0);
143  // Constructor for a single 1d material model
144  ZeroLength(int tag,int dimension,int Nd1, int Nd2,const Vector &,const Vector &,UniaxialMaterial &,int direction );
145  // Constructor for a multiple 1d material models
146  ZeroLength(int tag,int dimension,int Nd1, int Nd2, const Vector &,const Vector &,const DqUniaxialMaterial &,const ID &direction);
147  ZeroLength(int tag,int dimension,const Material *ptr_mat,int direction);
148  Element *getCopy(void) const;
149  ~ZeroLength(void);
150 
151  void setDomain(Domain *theDomain);
152 
153  // Element birth and death stuff.
156 
157  inline void clearMaterials(void)
158  { theMaterial1d.clear(); }
159  void setMaterial(const int &,const std::string &);
160  void setMaterials(const std::deque<int> &,const std::vector<std::string> &);
161  ZeroLengthMaterials &getMaterials(void)
162  { return theMaterial1d; }
163  // public methods to set the state of the element
164  int commitState(void);
165  int revertToLastCommit(void);
166  int revertToStart(void);
167  int update(void);
168 
169  const Vector &getCurrentDispDiff(void) const;
170  const Vector &getCurrentVelDiff(void) const;
171 
172  // public methods to obtain stiffness, mass, damping and residual information
173  std::string getElementType(void) const;
174  const Matrix &getTangentStiff(void) const;
175  const Matrix &getInitialStiff(void) const;
176  const Matrix &getDamp(void) const;
177  const Matrix &getMass(void) const;
178 
179  void alive(void);
180 
181  int addLoad(ElementalLoad *theLoad, double loadFactor);
182  int addInertiaLoadToUnbalance(const Vector &accel);
183 
184  Matrix getExtrapolatedValues(const Matrix &) const;
185  boost::python::list getValuesAtNodes(const std::string &, bool silent= false) const;
186 
187  Vector getInternalForces(void) const;
188  const Vector &getResistingForce(void) const;
189  const Vector &getResistingForceIncInertia(void) const;
190 
191  // public methods for element output
192  int sendSelf(Communicator &);
193  int recvSelf(const Communicator &);
194  void Print(std::ostream &s, int flag =0) const;
195  boost::python::dict getPyDict(void) const;
196  void setPyDict(const boost::python::dict &);
197 
198  Response *setResponse(const std::vector<std::string> &argv, Information &eleInformation);
199  int getResponse(int responseID, Information &eleInformation);
200 
201  void updateDir(const Vector& x, const Vector& y);
202 
203  };
204 } // end of XC namespace
205 
206 #endif
207 
208 
209 
210 
void setMaterial(const int &, const std::string &)
Set the material for the direction argument.
Definition: ZeroLength.cpp:195
const Matrix & getDamp(void) const
Return the element damping matrix.
Definition: ZeroLength.cpp:614
int commitState(void)
Commit state of element.
Definition: ZeroLength.cpp:439
Matrix getExtrapolatedValues(const Matrix &) const
Extrapolate from Gauss points to nodes.
Definition: ZeroLength.cpp:730
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: ZeroLength.cpp:834
void setUpType(void)
Sets the matrix dimensions from element type.
Definition: ZeroLength.cpp:317
Float vector abstraction.
Definition: Vector.h:94
A ZeroLengthElement is defined by two nodes with the same coordinate.
Definition: ZeroLengthMaterials.h:54
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
void incrementPersistentInitialDeformationWithCurrentDeformation(void)
Increments the persistent (does not get wiped out by zeroLoad) initial deformation of the section...
Definition: ZeroLength.cpp:367
Base class response objects.
Definition: Response.h:81
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: ZeroLength.cpp:783
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: ZeroLength.cpp:889
void clear(void)
Free memory.
Definition: ZeroLengthMaterials.cc:72
const Matrix & getInitialStiff(void) const
Return initial stiffness matrix.
Definition: ZeroLength.cpp:576
const Vector & getPersistentInitialSectionDeformation(void) const
Returns the value of the persistent (does not get wiped out by zeroLoad) initial deformation of the s...
Definition: ZeroLength.cpp:360
ZeroLength(int tag=0)
Default constructor:
Definition: ZeroLength.cpp:94
const Vector & getResistingForceIncInertia(void) const
Return resisting force vector with inertia included.
Definition: ZeroLength.cpp:723
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: ZeroLength.cpp:818
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:93
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: ZeroLength.cpp:874
Base class for materials.
Definition: Material.h:93
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
int getResponse(int responseID, Information &eleInformation)
Get response information for responseID.
Definition: ZeroLength.cpp:961
Vector of integers.
Definition: ID.h:95
void alive(void)
Reactivates the element.
Definition: ZeroLength.cpp:657
int recvData(const Communicator &)
Receives members through the communicator argument.
Definition: ZeroLength.cpp:803
int addInertiaLoadToUnbalance(const Vector &accel)
The element has no mass, so this operation has no effect and returns 0.
Definition: ZeroLength.cpp:680
Response * setResponse(const std::vector< std::string > &argv, Information &eleInformation)
Set response quantities as "force", "deformation", "material", or "stiff".
Definition: ZeroLength.cpp:932
Base class for the finite elements.
Definition: Element.h:112
const Vector & getCurrentVelDiff(void) const
Compute the current difference in displacements between the nodes.
Definition: ZeroLength.cpp:490
Pointers to UniaxialMaterial container.
Definition: DqUniaxialMaterial.h:45
const Matrix & getMass(void) const
Return a zero mass matrix.
Definition: ZeroLength.cpp:648
int dimension
= 2 or 3 dimensions
Definition: Element0D.h:61
const Material * get_material_ptr(const std::string &) const
Return a pointer to the material that corresponds to the name.
Definition: ZeroLength.cpp:171
void setDomain(Domain *theDomain)
Set the elemento domain.
Definition: ZeroLength.cpp:382
~ZeroLength(void)
Destructor: delete must be invoked on any objects created by the object and on the matertial object...
Definition: ZeroLength.cpp:259
int revertToStart(void)
Revert state of element to initial.
Definition: ZeroLength.cpp:469
Element * getCopy(void) const
Virtual constructor.
Definition: ZeroLength.cpp:253
const Vector & getCurrentDispDiff(void) const
Compute the current difference in displacements between the nodes.
Definition: ZeroLength.cpp:478
const Matrix & getTangentStiff(void) const
Return tangent stiffness matrix for element.
Definition: ZeroLength.cpp:538
int addLoad(ElementalLoad *theLoad, double loadFactor)
The element has no loads, so this operation has no effect and returns 0.
Definition: ZeroLength.cpp:669
int update(void)
Update element state.
Definition: ZeroLength.cpp:500
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
void Print(std::ostream &s, int flag=0) const
Print information about element.
Definition: ZeroLength.cpp:904
Matrix of floats.
Definition: Matrix.h:111
int sendData(Communicator &)
Send members through the communicator argument.
Definition: ZeroLength.cpp:790
const Vector & getResistingForce(void) const
Return resisting force vector.
Definition: ZeroLength.cpp:702
Base class for loads over elements.
Definition: ElementalLoad.h:79
Zero length element.
Definition: ZeroLength.h:100
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Vector getInternalForces(void) const
Return the element internal forces.
Definition: ZeroLength.cpp:687
int revertToLastCommit(void)
Revert state of element to last commit.
Definition: ZeroLength.cpp:456
Element of dimension 0 (both nodes have the same position).
Definition: Element0D.h:44
boost::python::list getValuesAtNodes(const std::string &, bool silent=false) const
Return a python list with the values of the argument property at element nodes.
Definition: ZeroLength.cpp:751