xc
PathTimeSeries.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 /* ****************************************************************** **
28 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.6 $
48 // $Date: 2005/10/20 21:58:54 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/domain/load/pattern/PathTimeSeries.h,v $
50 
51 
52 #ifndef PathTimeSeries_h
53 #define PathTimeSeries_h
54 
55 // File: ~/domain/load/pattern/PathTimeSeries.h
56 //
57 // Written: fmk
58 // Created: 07/99
59 // Revision: A
60 //
61 // Description: This file contains the class definition for PathTimeSeries.
62 // PathTimeSeries is a CFactorSeries class which
63 // object.
64 //
65 // What: "@(#) PathTimeSeries.h, revA"
66 
67 #include "domain/load/pattern/time_series/PathSeriesBase.h"
68 
69 namespace XC {
70 class Vector;
71 
73 //
83  {
84  private:
85  Vector time;
86  mutable int currentTimeLoc;
87  protected:
88  int sendData(CommParameters &cp);
89  int recvData(const CommParameters &cp);
90 
91  public:
92  // constructors
93  PathTimeSeries(void);
94  PathTimeSeries(const Vector &thePath,const Vector &theTime, double cfactor = 1.0);
95  PathTimeSeries(const std::string &fileNamePath, const std::string &fileNameTime, double cfactor = 1.0);
96  PathTimeSeries(const std::string &fileName,double cfactor = 1.0);
97  TimeSeries *getCopy(void) const
98  { return new PathTimeSeries(*this); }
99 
100 
101  // method to get factor
102  double getFactor(double pseudoTime) const;
103  double getDuration(void) const;
104  double getTimeIncr(double pseudoTime) const;
105 
106  inline Vector getTime(void) const
107  { return time; }
108  inline void setTime(const Vector &d)
109  { time= d; }
110  inline int getCurrentTimeLoc(void) const
111  { return currentTimeLoc; }
112  inline void setCurrentTimeLoc(const int &d)
113  { currentTimeLoc= d; }
114 
115  void readFromFile(const std::string &fileName);
116  void readFromFiles(const std::string &filePathName,const std::string &fileTimeName);
117 
118  // methods for output
119  int sendSelf(CommParameters &);
120  int recvSelf(const CommParameters &);
121  void Print(std::ostream &s, int flag =0) const;
122  };
123 } // end of XC namespace
124 
125 #endif
126 
PathTimeSeries(void)
Default constructor.
Definition: PathTimeSeries.cpp:76
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: PathTimeSeries.cpp:353
Float vector abstraction.
Definition: Vector.h:93
double getDuration(void) const
Returns series duration.
Definition: PathTimeSeries.cpp:290
double getFactor(double pseudoTime) const
Returns the value of the load factor at the specified time.
Definition: PathTimeSeries.cpp:235
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: PathTimeSeries.cpp:336
TimeSeries * getCopy(void) const
Virtual constructor.
Definition: PathTimeSeries.h:97
Time-dependent function that linear interpolates the load factor using user specified control points ...
Definition: PathTimeSeries.h:82
double getTimeIncr(double pseudoTime) const
Returns the time increment at the pseudo-time.
Definition: PathTimeSeries.cpp:223
int recvData(const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: PathTimeSeries.cpp:312
Vector thePath
vector containg the data points
Definition: PathSeriesBase.h:45
void readFromFiles(const std::string &filePathName, const std::string &fileTimeName)
Lee el path desde DOS archivos.
Definition: PathTimeSeries.cpp:164
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: PathTimeSeries.cpp:321
Base class for time-dependent functions defined by a series of points (ti,fi).
Definition: PathSeriesBase.h:42
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Time variation of loads.
Definition: TimeSeries.h:81
Communication parameters between processes.
Definition: CommParameters.h:65
void readFromFile(const std::string &fileName)
Lee el path desde archivo.
Definition: PathTimeSeries.cpp:104
int sendData(CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: PathTimeSeries.cpp:303