xc
Truss.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.13 $
49 // $Date: 2003/03/17 19:19:49 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/element/truss/Truss.h,v $
51 
52 
53 #ifndef Truss_h
54 #define Truss_h
55 
56 // File: ~/element/truss/Truss.h
57 //
58 // Written: fmk
59 // Created: 07/98
60 // Revision: A
61 //
62 // Description: This file contains the class definition for Truss.
63 //
64 // What: "@(#) Truss.h, revA"
65 
66 #include "TrussBase.h"
67 
68 namespace XC {
69 class Channel;
70 class UniaxialMaterial;
71 
73 //
79 class Truss: public TrussBase
80  {
81  private:
82  double computeCurrentStrain(void) const;
83  double computeCurrentStrainRate(void) const;
84 
85  // private attributes - a copy for each object of the class
86  UniaxialMaterial *theMaterial;
87  double A;
88 
89 // AddingSensitivity:BEGIN //////////////////////////////////////////
90  int parameterID;
91  Vector *theLoadSens;
92 // AddingSensitivity:END ///////////////////////////////////////////
93 
94  double persistentInitialDeformation;
95 
96  void initialize(void);
97  protected:
98  DbTagData &getDbTagData(void) const;
99  int sendData(Communicator &comm);
100  int recvData(const Communicator &comm);
101  void free_material(void);
102  void free_load_sens(void);
103  void free_mem(void);
104  void set_material(const UniaxialMaterial &);
105  void set_load_sens(const Vector &);
106 
107  public:
108  Truss(int tag, int dimension, int Nd1, int Nd2, UniaxialMaterial &theMaterial, double A);
109  Truss(int tag,int dimension, const Material *ptr_mat);
110  Truss(void);
111  Truss(const Truss &);
112  Truss &operator=(const Truss &);
113  Element *getCopy(void) const;
114  ~Truss(void);
115 
116  // public methods to obtain information about dof & connectivity
117  void setDomain(Domain *theDomain);
118 
119  // Element birth and death stuff.
120  const double &getPersistentInitialSectionDeformation(void) const;
122 
123  // public methods to set the state of the element
124  int commitState(void);
125  int revertToLastCommit(void);
126  int revertToStart(void);
127  int update(void);
128 
129  const Material *getMaterial(void) const;
130  Material *getMaterial(void);
131  void setRho(const double &);
132  virtual double getRho(void) const;
133  inline const double &getSectionArea(void) const
134  { return A; }
135  inline void setSectionArea(const double &a)
136  { A= a; }
137  double getLinearRho(void) const;
138 
139  // public methods to obtain stiffness, mass, damping and residual information
140  const Matrix &getKi(void);
141  const Matrix &getTangentStiff(void) const;
142  const Matrix &getInitialStiff(void) const;
143  const Matrix &getDamp(void) const;
144  const Matrix &getMass(void) const;
145 
146  void alive(void);
147  void zeroLoad(void);
148  int addLoad(ElementalLoad *, double loadFactor);
149  int addInertiaLoadToUnbalance(const Vector &accel);
150 
151  double getAxialForce(void) const;
152  const Vector &getResistingForce(void) const;
153  const Vector &getResistingForceIncInertia(void) const;
154  double getInitialStrain(void) const;
155 
156  // public methods for element output
157  int sendSelf(Communicator &);
158  int recvSelf(const Communicator &);
159  void Print(std::ostream &s, int flag =0) const;
160 
161 
162  Response *setResponse(const std::vector<std::string> &argv, Information &eleInfo);
163  int getResponse(int responseID, Information &eleInformation);
164 
165  // AddingSensitivity:BEGIN //////////////////////////////////////////
166  int addInertiaLoadSensitivityToUnbalance(const Vector &accel, bool tag);
167  int setParameter(const std::vector<std::string> &argv, Parameter &param);
168  int updateParameter(int parameterID, Information &info);
169  int activateParameter(int parameterID);
170  const Vector & getResistingForceSensitivity(int gradNumber);
171  const Matrix & getKiSensitivity(int gradNumber);
172  const Matrix & getMassSensitivity(int gradNumber);
173  int commitSensitivity(int gradNumber, int numGrads);
174  // AddingSensitivity:END ///////////////////////////////////////////
175  };
176 } // end of XC namespace
177 
178 #endif
179 
180 
181 
182 
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: Truss.cpp:739
void set_load_sens(const Vector &)
Assign the load sensitivity vector.
Definition: Truss.cpp:122
int revertToStart(void)
Returns to the initial state.
Definition: Truss.cpp:319
const Matrix & getDamp(void) const
Returns the damping matrix.
Definition: Truss.cpp:404
double getAxialForce(void) const
Return the axial internal force.
Definition: Truss.cpp:822
int update(void)
Computes current strain from the trial displacements of the nodes.
Definition: Truss.cpp:330
int commitState(void)
Commits truss state.
Definition: Truss.cpp:288
Float vector abstraction.
Definition: Vector.h:94
Information about an element.
Definition: Information.h:81
Truss(void)
constructor: invoked by a FEM_ObjectBroker - blank object that recvSelf needs to be invoked upon ...
Definition: Truss.cpp:176
Communication parameters between processes.
Definition: Communicator.h:66
void free_mem(void)
Free the material pointer and the load sensitivity.
Definition: Truss.cpp:99
Base class response objects.
Definition: Response.h:81
void alive(void)
Reactivates the element.
Definition: Truss.cpp:491
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: Truss.cpp:784
double getLinearRho(void) const
Returns the element mass per unit length.
Definition: Truss.cpp:461
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:93
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: Truss.cpp:765
int addInertiaLoadToUnbalance(const Vector &accel)
Adds inertia forces.
Definition: Truss.cpp:537
Base class for materials.
Definition: Material.h:93
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: Truss.cpp:750
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
const Matrix & getTangentStiff(void) const
Returns the tangent stiffness matrix.
Definition: Truss.cpp:338
void free_material(void)
Free the material pointer.
Definition: Truss.cpp:79
Truss finite element.
Definition: Truss.h:79
Base class for the finite elements.
Definition: Element.h:112
int revertToLastCommit(void)
Returns to the last committed state.
Definition: Truss.cpp:303
int addLoad(ElementalLoad *, double loadFactor)
Adds a load.
Definition: Truss.cpp:510
Base class for truss elements.
Definition: TrussBase.h:42
int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: Truss.cpp:938
int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: Truss.cpp:913
void incrementPersistentInitialDeformationWithCurrentDeformation(void)
Increments the persistent (does not get wiped out by zeroLoad) initial deformation of the section...
Definition: Truss.cpp:224
Element * getCopy(void) const
Virtual constructor.
Definition: Truss.cpp:206
Truss & operator=(const Truss &)
Assignment operator.
Definition: Truss.cpp:193
double getInitialStrain(void) const
Return the element initial strain.
Definition: Truss.cpp:831
void setDomain(Domain *theDomain)
Set a link to the enclosing Domain and to set the node pointers.
Definition: Truss.cpp:233
const Vector & getResistingForce(void) const
Returns the reaction of the element.
Definition: Truss.cpp:655
void setRho(const double &)
Set the material density.
Definition: Truss.cpp:445
const Matrix & getInitialStiff(void) const
Returns the initial tangent stiffness matrix.
Definition: Truss.cpp:371
const Matrix & getMass(void) const
Returns the mass matrix.
Definition: Truss.cpp:465
void free_load_sens(void)
Free the load sensitivity.
Definition: Truss.cpp:89
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:875
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int activateParameter(int parameterID)
Activates the parameter identified by parameterID.
Definition: Truss.cpp:957
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: Truss.cpp:897
Matrix of floats.
Definition: Matrix.h:111
void set_material(const UniaxialMaterial &)
Assign the material.
Definition: Truss.cpp:106
const Vector & getResistingForceIncInertia(void) const
Returns the reaction of the element includin inertia forces.
Definition: Truss.cpp:684
const double & getPersistentInitialSectionDeformation(void) const
Returns the value of the persistent (does not get wiped out by zeroLoad) initial deformation of the s...
Definition: Truss.cpp:217
Parameter.
Definition: Parameter.h:68
Base class for loads over elements.
Definition: ElementalLoad.h:79
const Material * getMaterial(void) const
Return a pointer to the element material.
Definition: Truss.cpp:437
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
~Truss(void)
destructor delete must be invoked on any objects created by the object and on the matertial object...
Definition: Truss.cpp:212
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: Truss.cpp:721
virtual double getRho(void) const
Returns the material density.
Definition: Truss.cpp:449
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: Truss.cpp:728
void zeroLoad(void)
Zeroes loads on element.
Definition: Truss.cpp:502