xc
ZeroLength.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 /* ****************************************************************** **
28 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.8 $
48 // $Date: 2003/02/25 23:33:13 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/element/zeroLength/ZeroLength.h,v $
50 
51 
52 #ifndef ZeroLength_h
53 #define ZeroLength_h
54 
55 // File: ~/element/zeroLength/ZeroLength.h
56 //
57 // Written: GLF
58 // Created: 12/99
59 // Revision: A
60 //
61 // Description: This file contains the class definition for ZeroLength.
62 // A ZeroLength element is defined by two nodes with the same coordinate.
63 // One or more material objects may be associated with the nodes to
64 // provide a force displacement relationship.
65 // ZeroLength element will work with 1d, 2d, or 3d material models.
66 //
67 // What: "@(#) ZeroLength.h, revA"
68 
69 #include <domain/mesh/element/Element0D.h>
70 #include "material/uniaxial/ZeroLengthMaterials.h"
71 #include <utility/matrix/Matrix.h>
72 #include <material/uniaxial/DqUniaxialMaterial.h>
73 
74 
75 // Type of dimension of element NxDy has dimension x=1,2,3 and
76 // y=2,4,6,12 degrees-of-freedom for the element
77 enum Etype { D1N2, D2N4, D2N6, D3N6, D3N12 };
78 
79 
80 namespace XC {
81 class Node;
82 class Channel;
83 class UniaxialMaterial;
84 class Response;
85 
87 //
99 class ZeroLength: public Element0D
100  {
101  private:
102  Etype elemType;
103  Matrix *theMatrix;
104  Vector *theVector;
105  // Storage for uniaxial material models
106  ZeroLengthMaterials theMaterial1d;
107 
108  Matrix t1d;
109 
110  // private methods
111  void checkDirection(ID &dir) const;
112 
113  void setUp(int Nd1, int Nd2,const Vector &x,const Vector &y);
114  void setTran1d ( Etype e, int n );
115  double computeCurrentStrain1d(int mat, const Vector& diff ) const;
116 
117 
118 
119  // static data - single copy for all objects of the class
120  static Matrix ZeroLengthM2; // class wide matrix for 2*2
121  static Matrix ZeroLengthM4; // class wide matrix for 4*4
122  static Matrix ZeroLengthM6; // class wide matrix for 6*6
123  static Matrix ZeroLengthM12; // class wide matrix for 12*12
124  static Vector ZeroLengthV2; // class wide Vector for size 2
125  static Vector ZeroLengthV4; // class wide Vector for size 4
126  static Vector ZeroLengthV6; // class wide Vector for size 6
127  static Vector ZeroLengthV12; // class wide Vector for size 12
128 
129  protected:
130  void setUpType(const size_t &);
131 
132  int sendData(CommParameters &);
133  int recvData(const CommParameters &);
134 
135  public:
136  // Constructor for a single 1d material model
137  ZeroLength(int tag,int dimension,int Nd1, int Nd2,const Vector &,const Vector &,UniaxialMaterial &,int direction );
138  // Constructor for a multiple 1d material models
139  ZeroLength(int tag,int dimension,int Nd1, int Nd2, const Vector &,const Vector &,const DqUniaxialMaterial &,const ID &direction);
140  ZeroLength(int tag,int dimension,const Material *ptr_mat,int direction);
141  ZeroLength(void);
142  Element *getCopy(void) const;
143  ~ZeroLength(void);
144 
145  void setDomain(Domain *theDomain);
146 
147  inline void clearMaterials(void)
148  { theMaterial1d.clear(); }
149  void setMaterial(const int &,const std::string &);
150  void setMaterials(const std::deque<int> &,const std::vector<std::string> &);
151  ZeroLengthMaterials &getMaterials(void)
152  { return theMaterial1d; }
153  // public methods to set the state of the element
154  int commitState(void);
155  int revertToLastCommit(void);
156  int revertToStart(void);
157  int update(void);
158 
159  // public methods to obtain stiffness, mass, damping and residual information
160  std::string getElementType(void) const;
161  const Matrix &getTangentStiff(void) const;
162  const Matrix &getInitialStiff(void) const;
163  const Matrix &getDamp(void) const;
164  const Matrix &getMass(void) const;
165 
166  int addLoad(ElementalLoad *theLoad, double loadFactor);
167  int addInertiaLoadToUnbalance(const Vector &accel);
168 
169  const Vector &getResistingForce(void) const;
170  const Vector &getResistingForceIncInertia(void) const;
171 
172  // public methods for element output
173  int sendSelf(CommParameters &);
174  int recvSelf(const CommParameters &);
175  void Print(std::ostream &s, int flag =0);
176 
177  Response *setResponse(const std::vector<std::string> &argv, Information &eleInformation);
178  int getResponse(int responseID, Information &eleInformation);
179 
180  void updateDir(const Vector& x, const Vector& y);
181 
182  };
183 } // end of XC namespace
184 
185 #endif
186 
187 
188 
189 
const Matrix & getDamp(void) const
Return the element damping matrix.
Definition: ZeroLength.cpp:503
int commitState(void)
Commit state of element.
Definition: ZeroLength.cpp:357
Float vector abstraction.
Definition: Vector.h:93
A ZeroLengthElement is defined by two nodes with the same coordinate.
Definition: ZeroLengthMaterials.h:53
ZeroLength(void)
Default constructor:
Definition: ZeroLength.cpp:154
Information about an element.
Definition: Information.h:80
int sendData(CommParameters &)
Send members through the channel being passed as parameter.
Definition: ZeroLength.cpp:594
Definition: Response.h:71
void clear(void)
Free memory.
Definition: ZeroLengthMaterials.cc:72
const Matrix & getInitialStiff(void) const
Return initial stiffness matrix.
Definition: ZeroLength.cpp:465
const Vector & getResistingForceIncInertia(void) const
Return resisting force vector with inertia included.
Definition: ZeroLength.cpp:587
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:92
int recvData(const CommParameters &)
Receives members through the channel being passed as parameter.
Definition: ZeroLength.cpp:606
Base class for materials.
Definition: Material.h:91
int getResponse(int responseID, Information &eleInformation)
Get response information for responseID.
Definition: ZeroLength.cpp:707
Vector of integers.
Definition: ID.h:93
int addInertiaLoadToUnbalance(const Vector &accel)
The element has no mass, so this operation has no effect and returns 0.
Definition: ZeroLength.cpp:557
Response * setResponse(const std::vector< std::string > &argv, Information &eleInformation)
Set response quantities as "force", "deformation", "material", or "stiff".
Definition: ZeroLength.cpp:678
Base class for the finite elements.
Definition: Element.h:109
Pointers to UniaxialMaterial container.
Definition: DqUniaxialMaterial.h:44
const Matrix & getMass(void) const
Return a zero mass matrix.
Definition: ZeroLength.cpp:537
int dimension
= 2 or 3 dimensions
Definition: Element0D.h:59
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: ZeroLength.cpp:620
void setUpType(const size_t &)
Sets the element type and matrix dimensions from element dimension and the number of DOF of the conne...
Definition: ZeroLength.cpp:247
void setDomain(Domain *theDomain)
Set the elemento domain.
Definition: ZeroLength.cpp:300
~ZeroLength(void)
Destructor: delete must be invoked on any objects created by the object and on the matertial object...
Definition: ZeroLength.cpp:236
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: ZeroLength.cpp:635
int revertToStart(void)
Revert state of element to initial.
Definition: ZeroLength.cpp:381
Element * getCopy(void) const
Virtual constructor.
Definition: ZeroLength.cpp:230
const Matrix & getTangentStiff(void) const
Return tangent stiffness matrix for element.
Definition: ZeroLength.cpp:427
int addLoad(ElementalLoad *theLoad, double loadFactor)
The element has no loads, so this operation has no effect and returns 0.
Definition: ZeroLength.cpp:547
int update(void)
Updates the element state.
Definition: ZeroLength.cpp:385
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
Matrix of floats.
Definition: Matrix.h:108
void Print(std::ostream &s, int flag=0)
Print information about element.
Definition: ZeroLength.cpp:650
const Vector & getResistingForce(void) const
Return resisting force vector.
Definition: ZeroLength.cpp:564
Base class for loads over elements.
Definition: ElementalLoad.h:77
Zero length element.
Definition: ZeroLength.h:99
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
int revertToLastCommit(void)
Revert state of element to last commit.
Definition: ZeroLength.cpp:374
Element of dimension 0 (both nodes have the same position).
Definition: Element0D.h:43