xc
MotionHistory.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 //MotionHistory.h
29 
30 #ifndef MotionHistory_h
31 #define MotionHistory_h
32 
33 #include "utility/kernel/CommandEntity.h"
34 #include <vector>
35 
36 namespace XC {
37  class TimeSeries;
38  class TimeSeriesIntegrator;
39  class Parameter;
40  class Information;
41  class Vector;
42 
44 //
48  {
49  private:
50  mutable TimeSeries *theAccelSeries;
51  mutable TimeSeries *theVelSeries;
52  mutable TimeSeries *theDispSeries;
53  mutable TimeSeriesIntegrator *theIntegrator;
54  double delta;
55 
56  void calcAccel(void) const;
57  void calcVel(void) const;
58  void calcDisp(void) const;
59  void clearSeries(void);
60  void clearIntegrator(void);
61  public:
62  MotionHistory(const double &dt= 0.0);
63  MotionHistory(TimeSeries *dispSeries,
64  TimeSeries *velSeries,
65  TimeSeries *accelSeries,
66  TimeSeriesIntegrator *theIntegrator = 0,
67  double dTintegration = 0.01);
69  MotionHistory &operator=(const MotionHistory &);
70 
71  virtual ~MotionHistory(void);
72 
73  inline double getDelta(void) const
74  { return delta; }
75  inline void setDelta(const double &dT)
76  { delta= dT; }
77  void setAccelHistory(const TimeSeries *);
79  void setVelHistory(const TimeSeries *);
81  void setDispHistory(const TimeSeries *);
83 
84  size_t getNumDataPoints(void) const;
85  double getDuration(void) const;
86 
87  double getPeakAccel(void) const;
88  double getPeakVel(void) const;
89  double getPeakDisp(void) const;
90 
91  double getAccel(double time) const;
92  double getVel(double time) const;
93  double getDisp(double time) const;
94  const Vector &getDispVelAccel(Vector &data,const double &time) const;
95 
96  void setIntegrator(const std::string &integratorType= "trapezoidal");
97  void setIntegrator(const TimeSeriesIntegrator *integrator);
98  TimeSeriesIntegrator *getIntegrator(void);
99  TimeSeries *integrate(TimeSeries *theSeries) const;
100  TimeSeries *differentiate(TimeSeries *theSeries) const;
101 
102  // AddingSensitivity:BEGIN //////////////////////////////////////////
103  double getAccelSensitivity(double time);
104  int setParameter(const std::vector<std::string> &argv, Parameter &param);
105  int updateParameter(int parameterID, Information &info);
106  int activateParameter(int parameterID);
107  // AddingSensitivity:END ///////////////////////////////////////////
108  void loadAccelFile(const std::string &fileNameAccel,const double &timeStep,const double &theFactor);
109  void loadAccelTimeFile(const std::string &fileNameAccel, const std::string &fileNameTime,const double &theFactor);
110 
111  boost::python::dict getPyDict(void) const;
112  void setPyDict(const boost::python::dict &);
113  };
114 } // end of XC namespace
115 
116 #endif
117 
double getAccel(double time) const
Return acceleration at specified time.
Definition: MotionHistory.cc:385
Float vector abstraction.
Definition: Vector.h:94
double getDuration(void) const
Return the duration of the motion history.
Definition: MotionHistory.cc:302
Information about an element.
Definition: Information.h:81
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: MotionHistory.cc:490
double getPeakVel(void) const
Return the peak value of the velocity.
Definition: MotionHistory.cc:365
void setDispHistory(const TimeSeries *)
Set displacements history.
Definition: MotionHistory.cc:127
TimeSeries * getDispHistory(void)
Return the displacement history.
Definition: MotionHistory.cc:134
Data that define acceleration, velocities and displacements due to a earthquake.
Definition: MotionHistory.h:47
double getDisp(double time) const
Return displacement at specified time.
Definition: MotionHistory.cc:428
Objet that can execute python scripts.
Definition: CommandEntity.h:40
Time integration of time series.
Definition: TimeSeriesIntegrator.h:75
double getPeakDisp(void) const
Return the peak value of the displacement.
Definition: MotionHistory.cc:375
TimeSeries * getAccelHistory(void)
Return the acceleration history.
Definition: MotionHistory.cc:104
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Time variation of loads.
Definition: TimeSeries.h:85
double getAccelSensitivity(double time)
Return acceleration sensitivity at specified time.
Definition: MotionHistory.cc:399
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: MotionHistory.cc:500
Parameter.
Definition: Parameter.h:68
void setAccelHistory(const TimeSeries *)
Set acceleration history.
Definition: MotionHistory.cc:97
TimeSeries * getVelHistory(void)
Return the acceleration history.
Definition: MotionHistory.cc:119
void setVelHistory(const TimeSeries *)
Set velocities history.
Definition: MotionHistory.cc:112
double getPeakAccel(void) const
Return the peak value of the acceleration.
Definition: MotionHistory.cc:331
double getVel(double time) const
Return velocity at specified time.
Definition: MotionHistory.cc:413