xc
PathTimeSeries.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.6 $
49 // $Date: 2005/10/20 21:58:54 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/domain/load/pattern/PathTimeSeries.h,v $
51 
52 
53 #ifndef PathTimeSeries_h
54 #define PathTimeSeries_h
55 
56 // File: ~/domain/load/pattern/PathTimeSeries.h
57 //
58 // Written: fmk
59 // Created: 07/99
60 // Revision: A
61 //
62 // Description: This file contains the class definition for PathTimeSeries.
63 // PathTimeSeries is a CFactorSeries class which
64 // object.
65 //
66 // What: "@(#) PathTimeSeries.h, revA"
67 
68 #include "domain/load/pattern/time_series/PathSeriesBase.h"
69 
70 namespace XC {
71 class Vector;
72 
74 //
85  {
86  private:
87  Vector time;
88  mutable int currentTimeLoc;
89  protected:
90  int sendData(Communicator &comm);
91  int recvData(const Communicator &comm);
92 
93  public:
94  // constructors
95  PathTimeSeries(void);
96  PathTimeSeries(const Vector &thePath,const Vector &theTime, double cfactor = 1.0, bool useLast= false);
97  PathTimeSeries(const std::string &fileNamePath, const std::string &fileNameTime, double cfactor = 1.0, bool useLast= false);
98  PathTimeSeries(const std::string &fileName,double cfactor = 1.0, bool useLast= false);
99  TimeSeries *getCopy(void) const
100  { return new PathTimeSeries(*this); }
101 
102 
103  // method to get factor
104  double getFactor(double pseudoTime) const;
105  double getDuration(void) const;
106  double getTimeIncr(double pseudoTime) const;
107 
108  inline Vector getTime(void) const
109  { return time; }
110  inline void setTime(const Vector &d)
111  { time= d; }
112  inline int getCurrentTimeLoc(void) const
113  { return currentTimeLoc; }
114  inline void setCurrentTimeLoc(const int &d)
115  { currentTimeLoc= d; }
116 
117  bool readFromFile(const std::string &fileName);
118  bool readFromFiles(const std::string &filePathName,const std::string &fileTimeName);
119 
120  // methods for output
121  int sendSelf(Communicator &);
122  int recvSelf(const Communicator &);
123  void Print(std::ostream &s, int flag =0) const;
124  };
125 } // end of XC namespace
126 
127 #endif
128 
PathTimeSeries(void)
Default constructor.
Definition: PathTimeSeries.cpp:76
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: PathTimeSeries.cpp:384
Float vector abstraction.
Definition: Vector.h:94
double getDuration(void) const
Returns series duration.
Definition: PathTimeSeries.cpp:317
Communication parameters between processes.
Definition: Communicator.h:66
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: PathTimeSeries.cpp:334
double getFactor(double pseudoTime) const
Returns the value of the load factor at the specified time.
Definition: PathTimeSeries.cpp:253
TimeSeries * getCopy(void) const
Virtual constructor.
Definition: PathTimeSeries.h:99
Time-dependent function that linear interpolates the load factor using user specified control points ...
Definition: PathTimeSeries.h:84
double getTimeIncr(double pseudoTime) const
Returns the time increment at the pseudo-time.
Definition: PathTimeSeries.cpp:241
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: PathTimeSeries.cpp:352
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: PathTimeSeries.cpp:343
bool readFromFile(const std::string &fileName)
Read path from file.
Definition: PathTimeSeries.cpp:104
Vector thePath
vector containing the data points
Definition: PathSeriesBase.h:46
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: PathTimeSeries.cpp:367
Base class for time-dependent functions defined by a series of points (ti,fi).
Definition: PathSeriesBase.h:43
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Time variation of loads.
Definition: TimeSeries.h:85
bool readFromFiles(const std::string &filePathName, const std::string &fileTimeName)
Read path from TWO files.
Definition: PathTimeSeries.cpp:166