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  const double &getSectionArea(void) const;
134  void setSectionArea(const double &);
135  double getLinearRho(void) const;
136 
137  // public methods to obtain stiffness, mass, damping and residual information
138  const Matrix &getKi(void);
139  const Matrix &getTangentStiff(void) const;
140  const Matrix &getInitialStiff(void) const;
141  const Matrix &getDamp(void) const;
142  const Matrix &getMass(void) const;
143 
144  void alive(void);
145  void zeroLoad(void);
146  int addLoad(ElementalLoad *, double loadFactor);
147  int addInertiaLoadToUnbalance(const Vector &accel);
148 
149  double getAxialForce(void) const;
150  const Vector &getResistingForce(void) const;
151  const Vector &getResistingForceIncInertia(void) const;
152  double getInitialStrain(void) const;
153 
154  // public methods for element output
155  int sendSelf(Communicator &);
156  int recvSelf(const Communicator &);
157  void Print(std::ostream &s, int flag =0) const;
158 
159 
160  Response *setResponse(const std::vector<std::string> &argv, Information &eleInfo);
161  int getResponse(int responseID, Information &eleInformation);
162 
163  // AddingSensitivity:BEGIN //////////////////////////////////////////
164  int addInertiaLoadSensitivityToUnbalance(const Vector &accel, bool tag);
165  int setParameter(const std::vector<std::string> &argv, Parameter &param);
166  int updateParameter(int parameterID, Information &info);
167  int activateParameter(int parameterID);
168  const Vector & getResistingForceSensitivity(int gradNumber);
169  const Matrix & getKiSensitivity(int gradNumber);
170  const Matrix & getMassSensitivity(int gradNumber);
171  int commitSensitivity(int gradNumber, int numGrads);
172  // AddingSensitivity:END ///////////////////////////////////////////
173  };
174 } // end of XC namespace
175 
176 #endif
177 
178 
179 
180 
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: Truss.cpp:797
void set_load_sens(const Vector &)
Assign the load sensitivity vector.
Definition: Truss.cpp:126
int revertToStart(void)
Returns to the initial state.
Definition: Truss.cpp:350
const Matrix & getDamp(void) const
Returns the damping matrix.
Definition: Truss.cpp:436
double getAxialForce(void) const
Return the axial internal force.
Definition: Truss.cpp:883
int update(void)
Computes current strain from the trial displacements of the nodes.
Definition: Truss.cpp:362
int commitState(void)
Commits truss state.
Definition: Truss.cpp:318
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:182
Communication parameters between processes.
Definition: Communicator.h:66
void free_mem(void)
Free the material pointer and the load sensitivity.
Definition: Truss.cpp:102
Base class response objects.
Definition: Response.h:81
void alive(void)
Reactivates the element.
Definition: Truss.cpp:524
void setSectionArea(const double &)
Set the area of the section.
Definition: Truss.cpp:226
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: Truss.cpp:845
double getLinearRho(void) const
Returns the element mass per unit length.
Definition: Truss.cpp:494
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:93
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: Truss.cpp:824
int addInertiaLoadToUnbalance(const Vector &accel)
Adds inertia forces.
Definition: Truss.cpp:593
Base class for materials.
Definition: Material.h:93
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: Truss.cpp:808
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:370
void free_material(void)
Free the material pointer.
Definition: Truss.cpp:82
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:334
int addLoad(ElementalLoad *, double loadFactor)
Adds a load.
Definition: Truss.cpp:543
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:999
int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: Truss.cpp:974
void incrementPersistentInitialDeformationWithCurrentDeformation(void)
Increments the persistent (does not get wiped out by zeroLoad) initial deformation of the section...
Definition: Truss.cpp:253
Element * getCopy(void) const
Virtual constructor.
Definition: Truss.cpp:212
Truss & operator=(const Truss &)
Assignment operator.
Definition: Truss.cpp:199
double getInitialStrain(void) const
Return the element initial strain.
Definition: Truss.cpp:892
void setDomain(Domain *theDomain)
Set a link to the enclosing Domain and to set the node pointers.
Definition: Truss.cpp:262
const Vector & getResistingForce(void) const
Returns the reaction of the element.
Definition: Truss.cpp:713
void setRho(const double &)
Set the material density.
Definition: Truss.cpp:477
const double & getSectionArea(void) const
Return the area of the section.
Definition: Truss.cpp:222
const Matrix & getInitialStiff(void) const
Returns the initial tangent stiffness matrix.
Definition: Truss.cpp:403
const Matrix & getMass(void) const
Returns the mass matrix.
Definition: Truss.cpp:498
void free_load_sens(void)
Free the load sensitivity.
Definition: Truss.cpp:92
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:936
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:1018
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: Truss.cpp:958
Matrix of floats.
Definition: Matrix.h:111
void set_material(const UniaxialMaterial &)
Assign the material.
Definition: Truss.cpp:109
const Vector & getResistingForceIncInertia(void) const
Returns the reaction of the element includin inertia forces.
Definition: Truss.cpp:742
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:246
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:469
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:218
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: Truss.cpp:779
virtual double getRho(void) const
Returns the material density.
Definition: Truss.cpp:481
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: Truss.cpp:786
void zeroLoad(void)
Zeroes loads on element.
Definition: Truss.cpp:535