XC Open source finite element analysis program
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 //
78  {
79  private:
80  Vector time;
81  mutable int currentTimeLoc;
82  protected:
83  int sendData(CommParameters &cp);
84  int recvData(const CommParameters &cp);
85 
86  public:
87  // constructors
88  PathTimeSeries(void);
89  PathTimeSeries(const Vector &thePath,const Vector &theTime, double cfactor = 1.0);
90  PathTimeSeries(const std::string &fileNamePath, const std::string &fileNameTime, double cfactor = 1.0);
91  PathTimeSeries(const std::string &fileName,double cfactor = 1.0);
92  TimeSeries *getCopy(void) const
93  { return new PathTimeSeries(*this); }
94 
95 
96  // method to get factor
97  double getFactor(double pseudoTime) const;
98  double getDuration(void) const;
99  double getTimeIncr(double pseudoTime) const;
100 
101  inline Vector getTime(void) const
102  { return time; }
103  inline void setTime(const Vector &d)
104  { time= d; }
105  inline int getCurrentTimeLoc(void) const
106  { return currentTimeLoc; }
107  inline void setCurrentTimeLoc(const int &d)
108  { currentTimeLoc= d; }
109 
110  void readFromFile(const std::string &fileName);
111  void readFromFiles(const std::string &filePathName,const std::string &fileTimeName);
112 
113  // methods for output
114  int sendSelf(CommParameters &);
115  int recvSelf(const CommParameters &);
116  void Print(std::ostream &s, int flag =0) const;
117  };
118 } // end of XC namespace
119 
120 #endif
121 
Definition: Vector.h:82
PathTimeSeries(void)
Default constructor.
Definition: PathTimeSeries.cpp:76
double getDuration(void) const
Returns series duration.
Definition: PathTimeSeries.cpp:270
Base class for time-dependent functions defined by a series of points (ti,fi).
Definition: PathSeriesBase.h:42
int sendData(CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: PathTimeSeries.cpp:282
void Print(std::ostream &s, int flag=0) const
Imprime el objeto.
Definition: PathTimeSeries.cpp:330
double getFactor(double pseudoTime) const
Returns the valor correspondiente al instante being passed as parameter.
Definition: PathTimeSeries.cpp:215
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: PathTimeSeries.cpp:300
int recvData(const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: PathTimeSeries.cpp:291
void readFromFile(const std::string &fileName)
Lee el path desde archivo.
Definition: PathTimeSeries.cpp:96
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: PathTimeSeries.cpp:314
Time-dependent function that linear interpolates the load factor using user specified control points ...
Definition: PathTimeSeries.h:77
void readFromFiles(const std::string &filePathName, const std::string &fileTimeName)
Lee el path desde DOS archivos.
Definition: PathTimeSeries.cpp:154
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34
Time variation of loads.A TimeSeries object is used to determine the load factor to be applied to the...
Definition: TimeSeries.h:81
Vector thePath
vector containg the data points
Definition: PathSeriesBase.h:45