xc
MotionHistory.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 //MotionHistory.h
28 
29 #ifndef MotionHistory_h
30 #define MotionHistory_h
31 
32 #include "xc_utils/src/kernel/CommandEntity.h"
33 #include <vector>
34 
35 namespace XC {
36  class TimeSeries;
37  class TimeSeriesIntegrator;
38  class Parameter;
39  class Information;
40  class Vector;
41 
43 //
46 class MotionHistory: public CommandEntity
47  {
48  private:
49  TimeSeries *theAccelSeries;
50  mutable TimeSeries *theVelSeries;
51  mutable TimeSeries *theDispSeries;
52  mutable TimeSeriesIntegrator *theIntegrator;
53  double delta;
54 
55  void calcVel(void) const;
56  void calcDisp(void) const;
57  void clearSeries(void);
58  public:
59  MotionHistory(const double &dt= 0.0);
61  MotionHistory &operator=(const MotionHistory &);
62 
63  virtual ~MotionHistory(void);
64 
65  inline double getDelta(void) const
66  { return delta; }
67  inline void setDelta(const double &dT)
68  { delta= dT; }
69  void setAccelHistory(const TimeSeries *);
70  TimeSeries *getAccelHistory(void);
71 
72  size_t getNumDataPoints(void) const;
73  double getDuration(void) const;
74 
75  double getPeakAccel(void) const;
76  double getPeakVel(void) const;
77  double getPeakDisp(void) const;
78 
79  double getAccel(double time) const;
80  double getVel(double time) const;
81  double getDisp(double time) const;
82  const Vector &getDispVelAccel(Vector &data,const double &time) const;
83 
84  void setIntegrator(TimeSeriesIntegrator *integrator);
85  TimeSeries *integrate(TimeSeries *theSeries) const;
86 
87  // AddingSensitivity:BEGIN //////////////////////////////////////////
88  double getAccelSensitivity(double time);
89  int setParameter(const std::vector<std::string> &argv, Parameter &param);
90  int updateParameter(int parameterID, Information &info);
91  int activateParameter(int parameterID);
92  // AddingSensitivity:END ///////////////////////////////////////////
93  void loadAccelFile(const std::string &fileNameAccel,const double &timeStep,const double &theFactor);
94  void loadAccelTimeFile(const std::string &fileNameAccel, const std::string &fileNameTime,const double &theFactor);
95 
96  };
97 } // end of XC namespace
98 
99 #endif
100 
double getAccel(double time) const
Return acceleration at specified time.
Definition: MotionHistory.cc:224
Float vector abstraction.
Definition: Vector.h:93
Information about an element.
Definition: Information.h:80
Data that define acceleration, velocities and displacements due to a earthquake.
Definition: MotionHistory.h:46
double getDisp(double time) const
Return displacement at specified time.
Definition: MotionHistory.cc:258
Time integration of time series.
Definition: TimeSeriesIntegrator.h:74
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Time variation of loads.
Definition: TimeSeries.h:81
Definition: Parameter.h:65
void setAccelHistory(const TimeSeries *)
Set acceleration history.
Definition: MotionHistory.cc:76
double getVel(double time) const
Return velocity at specified time.
Definition: MotionHistory.cc:246