xc
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.
62 //
63 // What: "@(#) Truss.h, revA"
64 
65 #include "TrussBase.h"
66 
67 namespace XC {
68 class Channel;
69 class UniaxialMaterial;
70 
72 //
78 class Truss : public TrussBase
79  {
80  private:
81  double computeCurrentStrain(void) const;
82  double computeCurrentStrainRate(void) const;
83 
84  // private attributes - a copy for each object of the class
85  UniaxialMaterial *theMaterial;
86  double A;
87 
88 // AddingSensitivity:BEGIN //////////////////////////////////////////
89  int parameterID;
90  Vector *theLoadSens;
91 // AddingSensitivity:END ///////////////////////////////////////////
92 
93  void inicializa(void);
94  protected:
95  DbTagData &getDbTagData(void) const;
96  int sendData(CommParameters &cp);
97  int recvData(const CommParameters &cp);
98  void free_material(void);
99  void free_load_sens(void);
100  void free_mem(void);
101  void set_material(const UniaxialMaterial &);
102  void set_load_sens(const Vector &);
103 
104  public:
105  Truss(int tag, int dimension, int Nd1, int Nd2, UniaxialMaterial &theMaterial, double A);
106  Truss(int tag,int dimension,const Material *ptr_mat);
107  Truss(void);
108  Truss(const Truss &);
109  Truss &operator=(const Truss &);
110  Element *getCopy(void) const;
111  ~Truss(void);
112 
113  // public methods to obtain inforrmation about dof & connectivity
114  void setDomain(Domain *theDomain);
115 
116  // public methods to set the state of the element
117  int commitState(void);
118  int revertToLastCommit(void);
119  int revertToStart(void);
120  int update(void);
121 
122  const Material *getMaterial(void) const;
123  Material *getMaterial(void);
124  virtual double getRho(void) const;
125  inline const double &getArea(void) const
126  { return A; }
127  inline void setArea(const double &a)
128  { A= a; }
129 
130  // public methods to obtain stiffness, mass, damping and residual information
131  const Matrix &getKi(void);
132  const Matrix &getTangentStiff(void) const;
133  const Matrix &getInitialStiff(void) const;
134  const Matrix &getDamp(void) const;
135  const Matrix &getMass(void) const;
136 
137  void zeroLoad(void);
138  int addLoad(ElementalLoad *theLoad, double loadFactor);
139  int addInertiaLoadToUnbalance(const Vector &accel);
140 
141  double getAxialForce(void) const;
142  const Vector &getResistingForce(void) const;
143  const Vector &getResistingForceIncInertia(void) const;
144 
145  // public methods for element output
146  int sendSelf(CommParameters &);
147  int recvSelf(const CommParameters &);
148  void Print(std::ostream &s, int flag =0);
149 
150 
151  Response *setResponse(const std::vector<std::string> &argv, Information &eleInfo);
152  int getResponse(int responseID, Information &eleInformation);
153 
154  // AddingSensitivity:BEGIN //////////////////////////////////////////
155  int addInertiaLoadSensitivityToUnbalance(const Vector &accel, bool tag);
156  int setParameter(const std::vector<std::string> &argv, Parameter &param);
157  int updateParameter(int parameterID, Information &info);
158  int activateParameter(int parameterID);
159  const Vector & getResistingForceSensitivity(int gradNumber);
160  const Matrix & getKiSensitivity(int gradNumber);
161  const Matrix & getMassSensitivity(int gradNumber);
162  int commitSensitivity(int gradNumber, int numGrads);
163  // AddingSensitivity:END ///////////////////////////////////////////
164  };
165 } // end of XC namespace
166 
167 #endif
168 
169 
170 
171 
int revertToStart(void)
Returns to the initial state.
Definition: Truss.cpp:292
const Matrix & getDamp(void) const
Returns the damping matrix.
Definition: Truss.cpp:377
int update(void)
Computes current strain from the trial displacements of the nodes.
Definition: Truss.cpp:304
int commitState(void)
Commits truss state.
Definition: Truss.cpp:262
Float vector abstraction.
Definition: Vector.h:93
Information about an element.
Definition: Information.h:80
Truss(void)
constructor: invoked by a FEM_ObjectBroker - blank object that recvSelf needs to be invoked upon ...
Definition: Truss.cpp:166
int sendData(CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: Truss.cpp:670
Definition: Response.h:71
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:92
int addInertiaLoadToUnbalance(const Vector &accel)
Adds inertia forces.
Definition: Truss.cpp:479
Base class for materials.
Definition: Material.h:91
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
const Matrix & getTangentStiff(void) const
Returns the tangent stiffness matrix.
Definition: Truss.cpp:312
Truss finite element.
Definition: Truss.h:78
Base class for the finite elements.
Definition: Element.h:109
void Print(std::ostream &s, int flag=0)
Print stuff.
Definition: Truss.cpp:723
int revertToLastCommit(void)
Returns to the last commited state.
Definition: Truss.cpp:277
Base class for truss elements.
Definition: TrussBase.h:41
int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: Truss.cpp:860
int addLoad(ElementalLoad *theLoad, double loadFactor)
Adds a load.
Definition: Truss.cpp:453
int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: Truss.cpp:835
Element * getCopy(void) const
Virtual constructor.
Definition: Truss.cpp:194
Truss & operator=(const Truss &)
Assignment operator.
Definition: Truss.cpp:181
int recvData(const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: Truss.cpp:681
void setDomain(Domain *theDomain)
method: setDomain() to set a link to the enclosing XC::Domain and to set the node pointers...
Definition: Truss.cpp:209
const Vector & getResistingForce(void) const
Returns the reaction of the element.
Definition: Truss.cpp:597
const Matrix & getInitialStiff(void) const
Returns the initial tangent stiffness matrix.
Definition: Truss.cpp:345
const Matrix & getMass(void) const
Returns the mass matrix.
Definition: Truss.cpp:418
Response * setResponse(const std::vector< std::string > &argv, Information &eleInfo)
setResponse() is a method invoked to determine if the element will respond to a request for a certain...
Definition: Truss.cpp:797
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
int activateParameter(int parameterID)
Activates the parameter identified by parameterID.
Definition: Truss.cpp:879
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: Truss.cpp:819
Communication parameters between processes.
Definition: CommParameters.h:65
Matrix of floats.
Definition: Matrix.h:108
const Vector & getResistingForceIncInertia(void) const
Returns the reaction of the element includin inertia forces.
Definition: Truss.cpp:626
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: Truss.cpp:706
Definition: Parameter.h:65
Base class for loads over elements.
Definition: ElementalLoad.h:77
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
~Truss(void)
destructor delete must be invoked on any objects created by the object and on the matertial object...
Definition: Truss.cpp:200
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: Truss.cpp:663
virtual double getRho(void) const
Returns the material density.
Definition: Truss.cpp:414
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: Truss.cpp:692
void zeroLoad(void)
Zeroes loads on element.
Definition: Truss.cpp:444