xc
PathSeries.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.4 $
49 // $Date: 2003/02/25 23:32:41 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/domain/load/pattern/PathSeries.h,v $
51 
52 
53 #ifndef PathSeries_h
54 #define PathSeries_h
55 
56 // File: ~/analysis/integrator/PathSeries.h
57 //
58 // Written: fmk
59 // Created: 07/99
60 // Revision: A
61 //
62 //
63 // What: "@(#) PathSeries.h, revA"
64 
65 #include "PathSeriesBase.h"
66 #include <string>
67 
68 namespace XC {
69 class Vector;
70 
72 //
85  {
86  private:
87  double pathTimeIncr;
88  double startTime;
89  bool prependZero;
90  void prepend_zero_if_appropriate(void);
91  protected:
92  int sendData(Communicator &comm);
93  int recvData(const Communicator &comm);
94 
95  public:
96  // constructors
97  PathSeries(void);
98  PathSeries(const Vector &thePath,double pathTimeIncr = 1.0, double cf= 1.0, bool useLast = false, bool prependZero = false, double startTime = 0.0);
99  PathSeries(const std::string &fileName, double pathTimeIncr = 1.0, double cf= 1.0, bool useLast = false, bool prependZero = false, double startTime = 0.0);
100 
102  TimeSeries *getCopy(void) const
103  { return new PathSeries(*this); }
104 
105  // method to get factor
106  double getFactor(double pseudoTime) const;
107  double getDuration(void) const;
108  inline void setTimeIncr(const double &d)
109  { pathTimeIncr= d; }
110  inline double getTimeIncr(double) const
111  {return pathTimeIncr;}
112  inline double getTimeIncr(void) const
113  {return pathTimeIncr;}
114  inline void setStartTime(const double &d)
115  { this->startTime= d; }
116  inline double getStartTime(void) const
117  {return this->startTime;}
118  inline void setPrependZero(const bool &b)
119  { this->prependZero= b; }
120  inline bool getPrependZero(void) const
121  {return this->prependZero;}
122 
123  void readFromFile(const std::string &fileName);
124 
125  int sendSelf(Communicator &);
126  int recvSelf(const Communicator &);
127 
128 
129  void Print(std::ostream &s, int flag =0) const;
130  };
131 } // end of XC namespace
132 
133 #endif
134 
Float vector abstraction.
Definition: Vector.h:94
Communication parameters between processes.
Definition: Communicator.h:66
int sendData(Communicator &comm)
Sends object data.
Definition: PathSeries.cpp:188
int recvData(const Communicator &comm)
Receives object data.
Definition: PathSeries.cpp:196
void readFromFile(const std::string &fileName)
Read path from file.
Definition: PathSeries.cpp:124
Vector thePath
vector containing the data points
Definition: PathSeriesBase.h:46
double getDuration(void) const
Returns series duration.
Definition: PathSeries.cpp:184
double getFactor(double pseudoTime) const
Returns the value of the factor at the pseudo-time.
Definition: PathSeries.cpp:156
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: PathSeries.cpp:218
Base class for time-dependent functions defined by a series of points (ti,fi).
Definition: PathSeriesBase.h:43
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: PathSeries.cpp:204
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: PathSeries.cpp:233
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Time variation of loads.
Definition: TimeSeries.h:85
PathSeries(void)
Default constructor.
Definition: PathSeries.cpp:87
Time-dependent function that linear interpolates the load factor using user specified control points ...
Definition: PathSeries.h:84
TimeSeries * getCopy(void) const
Virtual constructor.
Definition: PathSeries.h:102