XC Open source finite element analysis program
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 //
89 class ZeroLength: public Element0D
90  {
91  private:
92  Etype elemType;
93  Matrix *theMatrix;
94  Vector *theVector;
95  // Storage for uniaxial material models
96  ZeroLengthMaterials theMaterial1d;
97 
98  Matrix t1d; // hold the transformation matrix
99 
100  // private methods
101  void checkDirection(ID &dir) const;
102 
103  void setUp(int Nd1, int Nd2,const Vector &x,const Vector &y);
104  void setTran1d ( Etype e, int n );
105  double computeCurrentStrain1d(int mat, const Vector& diff ) const;
106 
107 
108 
109  // static data - single copy for all objects of the class
110  static Matrix ZeroLengthM2; // class wide matrix for 2*2
111  static Matrix ZeroLengthM4; // class wide matrix for 4*4
112  static Matrix ZeroLengthM6; // class wide matrix for 6*6
113  static Matrix ZeroLengthM12; // class wide matrix for 12*12
114  static Vector ZeroLengthV2; // class wide Vector for size 2
115  static Vector ZeroLengthV4; // class wide Vector for size 4
116  static Vector ZeroLengthV6; // class wide Vector for size 6
117  static Vector ZeroLengthV12; // class wide Vector for size 12
118 
119  protected:
120  void setUpType(const size_t &);
121 
122  int sendData(CommParameters &);
123  int recvData(const CommParameters &);
124 
125  public:
126  // Constructor for a single 1d material model
127  ZeroLength(int tag,int dimension,int Nd1, int Nd2,const Vector &,const Vector &,UniaxialMaterial &,int direction );
128  // Constructor for a multiple 1d material models
129  ZeroLength(int tag,int dimension,int Nd1, int Nd2, const Vector &,const Vector &,const DqUniaxialMaterial &,const ID &direction);
130  ZeroLength(int tag,int dimension,const Material *ptr_mat,int direction);
131  ZeroLength(void);
132  Element *getCopy(void) const;
133  ~ZeroLength(void);
134 
135  void setDomain(Domain *theDomain);
136 
137  inline void clearMaterials(void)
138  { theMaterial1d.clear(); }
139  void setMaterial(const int &,const std::string &);
140  void setMaterials(const std::deque<int> &,const std::vector<std::string> &);
141  ZeroLengthMaterials &getMaterials(void)
142  { return theMaterial1d; }
143  // public methods to set the state of the element
144  int commitState(void);
145  int revertToLastCommit(void);
146  int revertToStart(void);
147  int update(void);
148 
149  // public methods to obtain stiffness, mass, damping and residual information
150  std::string getElementType(void) const;
151  const Matrix &getTangentStiff(void) const;
152  const Matrix &getInitialStiff(void) const;
153  const Matrix &getDamp(void) const;
154  const Matrix &getMass(void) const;
155 
156  int addLoad(ElementalLoad *theLoad, double loadFactor);
157  int addInertiaLoadToUnbalance(const Vector &accel);
158 
159  const Vector &getResistingForce(void) const;
160  const Vector &getResistingForceIncInertia(void) const;
161 
162  // public methods for element output
163  int sendSelf(CommParameters &);
164  int recvSelf(const CommParameters &);
165  void Print(std::ostream &s, int flag =0);
166 
167  Response *setResponse(const std::vector<std::string> &argv, Information &eleInformation);
168  int getResponse(int responseID, Information &eleInformation);
169 
170  void updateDir(const Vector& x, const Vector& y);
171 
172  };
173 } // end of XC namespace
174 
175 #endif
176 
177 
178 
179 
int commitState(void)
Consuma el estado of the element.
Definition: ZeroLength.cpp:305
const Matrix & getDamp(void) const
Returns the matriz de amortiguamiento.
Definition: ZeroLength.cpp:437
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:204
const Matrix & getMass(void) const
Returns the mass matrix.
Definition: ZeroLength.cpp:471
Base class for materials.
Definition: Material.h:85
~ZeroLength(void)
Destructor: delete must be invoked on any objects created by the object and on the matertial object...
Definition: ZeroLength.cpp:193
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
Definition: Vector.h:82
int dimension
= 2 or 3 dimensions
Definition: Element0D.h:61
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: ZeroLength.cpp:562
Zero length material.
Definition: ZeroLength.h:89
Information about an element.
Definition: Information.h:80
int recvData(const CommParameters &)
Receives members through the channel being passed as parameter.
Definition: ZeroLength.cpp:534
A ZeroLengthElement is defined by two nodes with the same coordinate. One or more material objects ma...
Definition: ZeroLengthMaterials.h:47
Base calass for the finite elements.
Definition: Element.h:104
Base class for loads over elements.
Definition: ElementalLoad.h:73
Element of dimension 0 (both nodes have the same position).
Definition: Element0D.h:45
void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: ZeroLength.cpp:255
Definition: ID.h:77
Contenedor de pointers to UniaxialMaterial.
Definition: DqUniaxialMaterial.h:44
Definition: Matrix.h:82
Element * getCopy(void) const
Virtual constructor.
Definition: ZeroLength.cpp:187
int update(void)
Actualiza el estado of the element.
Definition: ZeroLength.cpp:327
int sendData(CommParameters &)
Send members through the channel being passed as parameter.
Definition: ZeroLength.cpp:522
void Print(std::ostream &s, int flag=0)
Imprime el objeto.
Definition: ZeroLength.cpp:576
const Vector & getResistingForceIncInertia(void) const
Returns the action of the element over its attached nodes. Computes damping matrix.
Definition: ZeroLength.cpp:515
Communication parameters between processes.
Definition: CommParameters.h:65
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: ZeroLength.cpp:548
================================================================================
Definition: ContinuaReprComponent.h:34
Definition: Response.h:71
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:88