xc
Spring.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/Spring.h,v $
51 
52 
53 #ifndef Spring_h
54 #define Spring_h
55 
56 // File: ~/element/truss/Spring.h
57 //
58 // Written: fmk
59 // Created: 07/98
60 // Revision: A
61 //
62 // Description: This file contains the class definition for Spring. A Spring object
63 // provides the abstraction of the small deformation bar element. Each truss
64 // object is associated with a material object. This Truss element will work
65 // in 1d, 2d or 3d problems.
66 //
67 // What: "@(#) Truss.h, revA"
68 
69 #include "ProtoTruss.h"
70 #include <utility/matrix/Matrix.h>
71 
72 namespace XC {
73 class Channel;
74 class UniaxialMaterial;
75 
76 class Spring: public ProtoTruss
77  {
78  private:
79  // private attributes - a copy for each object of the class
80  UniaxialMaterial *theMaterial;
81  double cosX[3];
82 
83  double computeCurrentStrain(void) const;
84  double computeCurrentStrainRate(void) const;
85 
86  int sendData(Communicator &comm);
87  int recvData(const Communicator &comm);
88  void initialize(void);
89  public:
90  Spring(int tag, int dimension, int Nd1, int Nd2, UniaxialMaterial &theMaterial, double A);
91  Spring(int tag,int dimension,const Material *ptr_mat);
92  Spring(void);
93  Spring(const Spring &);
94  Spring &operator=(const Spring &);
95  Element *getCopy(void) const;
96  ~Spring(void);
97 
98  // public methods to obtain information about dof & connectivity
99  void setDomain(Domain *theDomain);
100 
101  // public methods to set the state of the element
102  int commitState(void);
103  int revertToLastCommit(void);
104  int revertToStart(void);
105  int update(void);
106 
107  const Material *getMaterial(void) const;
108  Material *getMaterial(void);
109  virtual double getRho(void) const;
110 
111  // public methods to obtain stiffness, mass, damping and residual information
112  const Matrix &getKi(void);
113  const Matrix &getTangentStiff(void) const;
114  const Matrix &getInitialStiff(void) const;
115  const Matrix &getDamp(void) const;
116  const Matrix &getMass(void) const;
117 
118  int addLoad(ElementalLoad *, double loadFactor);
119  int addInertiaLoadToUnbalance(const Vector &accel);
120 
121  double getAxialForce(void) const;
122  const Vector &getResistingForce(void) const;
123  const Vector &getResistingForceIncInertia(void) const;
124 
125  // public methods for element output
126  int sendSelf(Communicator &);
127  int recvSelf(const Communicator &);
128  void Print(std::ostream &s, int flag =0) const;
129 
130 
131  Response *setResponse(const std::vector<std::string> &argv, Information &eleInfo);
132  int getResponse(int responseID, Information &eleInformation);
133  };
134 } // end of XC namespace
135 
136 #endif
137 
138 
139 
140 
Float vector abstraction.
Definition: Vector.h:94
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
Base class response objects.
Definition: Response.h:81
const Matrix & getInitialStiff(void) const
Returns the initial tangent stiffness matrix.
Definition: Spring.cc:319
int sendSelf(Communicator &)
Send the object.
Definition: Spring.cc:618
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:93
int update(void)
Computes current trial strain from trial displacements at the nodes.
Definition: Spring.cc:285
Definition: Spring.h:76
virtual double getRho(void) const
Returns the material density.
Definition: Spring.cc:376
int revertToStart(void)
Returns to the initial state.
Definition: Spring.cc:277
Base class for materials.
Definition: Material.h:93
const Vector & getResistingForceIncInertia(void) const
Returns the reaction of the element including inertia forces.
Definition: Spring.cc:467
Element * getCopy(void) const
Virtual constructor.
Definition: Spring.cc:110
Base class for the finite elements.
Definition: Element.h:112
void setDomain(Domain *theDomain)
method: setDomain() to set a link to the enclosing XC::Domain and to set the node pointers...
Definition: Spring.cc:129
const Matrix & getTangentStiff(void) const
Returns the tangent stiffness matrix.
Definition: Spring.cc:293
int addInertiaLoadToUnbalance(const Vector &accel)
Adds inertia forces.
Definition: Spring.cc:409
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: Spring.cc:585
int recvSelf(const Communicator &)
Receive the object.
Definition: Spring.cc:630
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: Spring.cc:563
int revertToLastCommit(void)
Returns to the last committed state.
Definition: Spring.cc:267
const Vector & getResistingForce(void) const
Returns the reaction of the element.
Definition: Spring.cc:445
~Spring(void)
destructor delete must be invoked on any objects created by the object and on the matertial object...
Definition: Spring.cc:116
const Matrix & getMass(void) const
Returns the mass matrix.
Definition: Spring.cc:380
Base class for truss elements.
Definition: ProtoTruss.h:45
int commitState(void)
Commits its state.
Definition: Spring.cc:256
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
const Matrix & getDamp(void) const
Returns the matrix de amortiguamiento.
Definition: Spring.cc:345
Matrix of floats.
Definition: Matrix.h:111
Spring & operator=(const Spring &)
Assignment operator.
Definition: Spring.cc:98
Base class for loads over elements.
Definition: ElementalLoad.h:79
void Print(std::ostream &s, int flag=0) const
Print spring data.
Definition: Spring.cc:502
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Spring(void)
constructor: invoked by a FEM_ObjectBroker - blank object that recvSelf needs to be invoked upon ...
Definition: Spring.cc:82
int addLoad(ElementalLoad *, double loadFactor)
Adds a load.
Definition: Spring.cc:402