xc
CyclicModel.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 #ifndef CyclicModel_H
29 #define CyclicModel_H
30 
31 #include <utility/tagged/TaggedObject.h>
32 #include <utility/actor/actor/MovableObject.h>
33 
34 namespace XC {
39 class CyclicModel: public TaggedObject, public MovableObject
40  {
41  private:
42  int initNewTask();
43  protected:
44  double resFactor;
45  mutable double cycFactor;
46  double cycFactor_hist;
47  double f_hist, d_hist;
48  double f_curr, d_curr;
49  double delT_curr, delT_hist;
50  double f_bgn, d_bgn;
51  double f_end, d_end;
52 
53  bool initYieldPos, initYieldNeg;
54  bool initCyc;
55  bool yielding, yielding_hist;
56  double initFpos,initDpos;
57  double initFneg,initDneg;
58  double initFMag,initDMag;
59  double k_init;
60  double k_hist, k_curr;
61  double fpeakPos, fpeakNeg;
62  double dpeakPos, dpeakNeg;
63  int state_hist, state_curr;
64 
65  const static int Loading,Unloading, Crossover;
66  const static double Tol, delK;
67  public:
68  CyclicModel(int tag, int classTag);
69 
70  int commitState(double newResidual);
71  void update(double f, double d, bool yield);
72  virtual CyclicModel *getCopy()=0;
73 
74  virtual double getFactor(void) const;
75  // for now ignore
76  virtual int sendSelf(Communicator &)
77  {return -1;}
78  virtual int recvSelf(const Communicator &)
79  {return -1;}
80  virtual void Print(std::ostream &s, int flag=0) const;
81  protected:
82 // virtual methods
83  virtual int createFullCycleTask();
84  virtual int createHalfCycleTask();
85  virtual double getTaskFactor()=0;
86 
87 // protected:
88  int setCurrent(double f, double d);
89  int dir(double x);
90 
91  int taskStatus(void);
92  double rationalize(double x1, double y1, double x2, double y2);
93  bool contains(double x1, double x2, double x);
94  };
95 } // end of XC namespace
96 
97 #endif
98 
Communication parameters between processes.
Definition: Communicator.h:66
Object that can move between processes.
Definition: MovableObject.h:100
virtual int sendSelf(Communicator &)
Send the object.
Definition: CyclicModel.h:76
virtual int recvSelf(const Communicator &)
Receive the object.
Definition: CyclicModel.h:78
Base class for object that model the cyclic behavior of semi-rigid connectors.
Definition: CyclicModel.h:39
Object idenfied by an integer (tag).
Definition: TaggedObject.h:92
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
virtual CyclicModel * getCopy()=0
Virtual constructor.
virtual void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: CyclicModel.cpp:350