XC Open source finite element analysis program
Truss.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.13 $
48 // $Date: 2003/03/17 19:19:49 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/element/truss/Truss.h,v $
50 
51 
52 #ifndef Truss_h
53 #define Truss_h
54 
55 // File: ~/element/truss/Truss.h
56 //
57 // Written: fmk
58 // Created: 07/98
59 // Revision: A
60 //
61 // Description: This file contains the class definition for Truss. A Truss object
62 // provides the abstraction of the small deformation bar element. Each truss
63 // object is assocaited with a material object. This Truss element will work
64 // in 1d, 2d or 3d problems.
65 //
66 // What: "@(#) Truss.h, revA"
67 
68 #include "TrussBase.h"
69 
70 namespace XC {
71 class Channel;
72 class UniaxialMaterial;
73 
75 //
77 class Truss : public TrussBase
78  {
79  private:
80  double computeCurrentStrain(void) const;
81  double computeCurrentStrainRate(void) const;
82 
83  // private attributes - a copy for each object of the class
84  UniaxialMaterial *theMaterial;
85  double A;
86 
87 // AddingSensitivity:BEGIN //////////////////////////////////////////
88  int parameterID;
89  Vector *theLoadSens;
90 // AddingSensitivity:END ///////////////////////////////////////////
91 
92  void inicializa(void);
93  protected:
94  DbTagData &getDbTagData(void) const;
95  int sendData(CommParameters &cp);
96  int recvData(const CommParameters &cp);
97  void libera_material(void);
98  void libera_load_sens(void);
99  void libera(void);
100  void set_material(const UniaxialMaterial &);
101  void set_load_sens(const Vector &);
102 
103  public:
104  Truss(int tag, int dimension, int Nd1, int Nd2, UniaxialMaterial &theMaterial, double A);
105  Truss(int tag,int dimension,const Material *ptr_mat);
106  Truss(void);
107  Truss(const Truss &);
108  Truss &operator=(const Truss &);
109  Element *getCopy(void) const;
110  ~Truss(void);
111 
112  // public methods to obtain inforrmation about dof & connectivity
113  void setDomain(Domain *theDomain);
114 
115  // public methods to set the state of the element
116  int commitState(void);
117  int revertToLastCommit(void);
118  int revertToStart(void);
119  int update(void);
120 
121  const Material *getMaterial(void) const;
122  Material *getMaterial(void);
123  virtual double getRho(void) const;
124  inline const double &getArea(void) const
125  { return A; }
126  inline void setArea(const double &a)
127  { A= a; }
128 
129  // public methods to obtain stiffness, mass, damping and residual information
130  const Matrix &getKi(void);
131  const Matrix &getTangentStiff(void) const;
132  const Matrix &getInitialStiff(void) const;
133  const Matrix &getDamp(void) const;
134  const Matrix &getMass(void) const;
135 
136  void zeroLoad(void);
137  int addLoad(ElementalLoad *theLoad, double loadFactor);
138  int addInertiaLoadToUnbalance(const Vector &accel);
139 
140  double getAxil(void) const;
141  const Vector &getResistingForce(void) const;
142  const Vector &getResistingForceIncInertia(void) const;
143 
144  // public methods for element output
145  int sendSelf(CommParameters &);
146  int recvSelf(const CommParameters &);
147  void Print(std::ostream &s, int flag =0);
148 
149 
150  Response *setResponse(const std::vector<std::string> &argv, Information &eleInfo);
151  int getResponse(int responseID, Information &eleInformation);
152 
153  // AddingSensitivity:BEGIN //////////////////////////////////////////
154  int addInertiaLoadSensitivityToUnbalance(const Vector &accel, bool tag);
155  int setParameter(const std::vector<std::string> &argv, Parameter &param);
156  int updateParameter(int parameterID, Information &info);
157  int activateParameter(int parameterID);
158  const Vector & getResistingForceSensitivity(int gradNumber);
159  const Matrix & getKiSensitivity(int gradNumber);
160  const Matrix & getMassSensitivity(int gradNumber);
161  int commitSensitivity(int gradNumber, int numGrads);
162  // AddingSensitivity:END ///////////////////////////////////////////
163  };
164 } // end of XC namespace
165 
166 #endif
167 
168 
169 
170 
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: Truss.cpp:663
Base class for materials.
Definition: Material.h:85
Truss(void)
Definition: Truss.cpp:165
int recvData(const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: Truss.cpp:652
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
int update(void)
Computes current strain from the trial displacements of the nodes.
Definition: Truss.cpp:276
Definition: Vector.h:82
Vector que almacena los dbTags de los miembros de la clase.
Definition: DbTagData.h:43
Barra articulada.
Definition: Truss.h:77
const Matrix & getDamp(void) const
Returns the matriz de amortiguamiento.
Definition: Truss.cpp:349
const Matrix & getInitialStiff(void) const
Returns the initial tangent stiffness matrix.
Definition: Truss.cpp:317
Element * getCopy(void) const
Virtual constructor.
Definition: Truss.cpp:193
Information about an element.
Definition: Information.h:80
int addInertiaLoadToUnbalance(const Vector &accel)
Adds las fuerzas de inercia.
Definition: Truss.cpp:450
const Vector & getResistingForceIncInertia(void) const
Returns the reacción of the element incluyendo fuerzas de inercia.
Definition: Truss.cpp:597
Base calass for the finite elements.
Definition: Element.h:104
Base class for loads over elements.
Definition: ElementalLoad.h:73
int addLoad(ElementalLoad *theLoad, double loadFactor)
Adds a load.
Definition: Truss.cpp:424
void setDomain(Domain *theDomain)
Definition: Truss.cpp:208
Truss & operator=(const Truss &)
Assignment operator.
Definition: Truss.cpp:180
Definition: Matrix.h:82
int commitState(void)
Commits trusst state.
Definition: Truss.cpp:257
virtual double getRho(void) const
Returns the material density.
Definition: Truss.cpp:385
Definition: Parameter.h:65
const Matrix & getMass(void) const
Returns the mass matrix.
Definition: Truss.cpp:389
~Truss(void)
Definition: Truss.cpp:199
void zeroLoad(void)
Zeroes loads on element.
Definition: Truss.cpp:415
int sendData(CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: Truss.cpp:641
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: Truss.cpp:677
int revertToLastCommit(void)
Returns to the last commited state.
Definition: Truss.cpp:268
Communication parameters between processes.
Definition: CommParameters.h:65
DbTagData & getDbTagData(void) const
Returns a vector para almacenar los dbTags de los miembros de la clase.
Definition: Truss.cpp:634
================================================================================
Definition: ContinuaReprComponent.h:34
int revertToStart(void)
Returns the initial state.
Definition: Truss.cpp:272
void Print(std::ostream &s, int flag=0)
Imprime el objeto.
Definition: Truss.cpp:694
const Vector & getResistingForce(void) const
Returns the reacción of the element.
Definition: Truss.cpp:568
Definition: Response.h:71
const Matrix & getTangentStiff(void) const
Returns the tangent stiffness matrix.
Definition: Truss.cpp:284
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:88
Base class for truss elements.
Definition: TrussBase.h:41