xc
Fiber.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.5 $
49 // $Date: 2003/02/25 23:33:36 $
50 // $Source: material/section/fiber_section/fiber/Fiber.h,v $
51 
52 
53 // File: ~/fiber/Fiber.h
54 //
55 // Written: Remo Magalhaes de Souza
56 // Created: 10/98
57 // Revision:
58 //
59 // Description: This file contains the class definition for
60 // Fiber. Fiber is an abstract base class and thus no objects of
61 // it's type can be instatiated. It has pure virtual functions which
62 // must be implemented in it's derived classes.
63 //
64 // What: "@(#) Fiber.h, revA"
65 
66 
67 #ifndef Fiber_h
68 #define Fiber_h
69 
70 #include "utility/tagged/TaggedObject.h"
71 #include "utility/actor/actor/MovableObject.h"
72 
73 class Pos2d;
74 
75 namespace XC {
76 class Vector;
77 class Matrix;
78 class ResponseId;
79 class UniaxialMaterial;
80 class Information;
81 class Response;
82 
86 //
88 //
90 class Fiber: public TaggedObject, public MovableObject
91  {
92  bool dead;
93  protected:
94  int sendData(Communicator &);
95  int recvData(const Communicator &);
96 
97  public:
98  Fiber(int tag, int classTag);
99 
100  virtual int setTrialFiberStrain(const Vector &vs)=0;
101  virtual Vector &getFiberStressResultants(void) =0;
102  virtual Matrix &getFiberTangentStiffContr(void) =0;
103 
104  virtual int commitState(void)=0;
105  virtual int revertToLastCommit(void)=0;
106  virtual int revertToStart(void)=0;
107 
108  virtual Fiber *getCopy(void) const= 0;
109  virtual int getOrder(void) const= 0;
110  virtual const ResponseId &getResponseType(void) const= 0;
111 
112  virtual const bool isDead(void) const
113  { return dead; }
114  virtual const bool isAlive(void) const
115  { return !dead; }
116  virtual void kill(void)
117  { dead= true; }
118  virtual void alive(void)
119  { dead= false; }
120 
121  virtual Response *setResponse(const std::vector<std::string> &argv, Information &info);
122  virtual int getResponse(int responseID, Information &info);
123 
124  virtual void getFiberLocation(double &y, double &z) const=0;
125  virtual double getLocY(void) const= 0;
126  virtual double getLocZ(void) const
127  { return 0.0; }
128  Pos2d getPos(void) const;
129 
130  virtual UniaxialMaterial *getMaterial(void) =0;
131  virtual const UniaxialMaterial *getMaterial(void) const= 0;
133  virtual double getArea(void) const=0;
134  double getEquivalentDiameter(void) const;
135  double getStrain(void) const;
136  double getStress(void) const;
137  double getForce(void) const;
138  double getMz(const double &y0= 0.0) const;
139  double getMy(const double &z0= 0.0) const;
140  };
141 
144 inline double Fiber::getMz(const double &y0) const
145  { return getForce()*(getLocY() - y0); }
146 
149 inline double Fiber::getMy(const double &z0) const
150  { return getForce()*(getLocZ() - z0); }
151 
152 } // end of XC namespace
153 
154 
155 #endif
156 
Float vector abstraction.
Definition: Vector.h:94
int recvData(const Communicator &)
Receive data through the communicator argument.
Definition: Fiber.cpp:121
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
virtual Fiber * getCopy(void) const =0
Virtual constructor.
Base class response objects.
Definition: Response.h:81
Posición en dos dimensiones.
Definition: Pos2d.h:41
Object that can move between processes.
Definition: MovableObject.h:100
double getEquivalentDiameter(void) const
Return the diameter of the circle that has the same area of the fiber.
Definition: Fiber.cpp:104
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:93
Pos2d getPos(void) const
Returns fiber position.
Definition: Fiber.cpp:109
double getStrain(void) const
Returns fiber strain.
Definition: Fiber.cpp:90
Fiber(int tag, int classTag)
Constructor.
Definition: Fiber.cpp:71
double getMz(const double &y0=0.0) const
Returns the moment of the force of the fiber with respect to the axis parallel to "z" that passes thr...
Definition: Fiber.h:144
double getMy(const double &z0=0.0) const
Returns the moment of the force of the fiber with respect to the axis parallel to "y" that passes thr...
Definition: Fiber.h:149
Section fiber.
Definition: Fiber.h:90
virtual double getArea(void) const =0
Return the area of the fiber.
Stiffness material contribution response identifiers.
Definition: ResponseId.h:61
double getStress(void) const
Returns fiber stress.
Definition: Fiber.cpp:94
Object idenfied by an integer (tag).
Definition: TaggedObject.h:92
int sendData(Communicator &)
Send data through the communicator argument.
Definition: Fiber.cpp:113
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
double getForce(void) const
Return the force response of the fiber.
Definition: Fiber.cpp:81