xc
PathSeriesBase.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 //PathSeriesBase.h
29 
30 #ifndef PathSeriesBase_h
31 #define PathSeriesBase_h
32 
33 #include <domain/load/pattern/time_series/CFactorSeries.h>
34 #include "utility/matrix/Vector.h"
35 
36 namespace XC {
37 class Vector;
38 
40 //
44  {
45  protected:
47  bool useLast;
48 
49  static size_t load_vector_from_file(Vector &v,std::istream &is);
50 
51  int sendData(Communicator &comm);
52  int recvData(const Communicator &comm);
53  public:
54  // constructors
55  PathSeriesBase(int classTag,const double &cf= 1.0, bool last= false);
56  PathSeriesBase(int classTag,const Vector &thePath,const double &cf= 1.0, bool last= false);
57 
58  size_t getNumDataPoints(void) const;
59  size_t getNumDataPointsOnFile(const std::string &) const;
60  double getPeakFactor(void) const;
61 
62  inline Vector getPath(void) const
63  { return thePath; }
64  inline void setPath(const Vector &d)
65  { thePath= d; }
66  inline void setUseLast(const bool &b)
67  { this->useLast= b; }
68  inline bool getUseLast(void) const
69  {return this->useLast;}
70 
71  void Print(std::ostream &s, int flag =0) const;
72  };
73 } // end of XC namespace
74 
75 #endif
76 
Float vector abstraction.
Definition: Vector.h:94
Communication parameters between processes.
Definition: Communicator.h:66
void Print(std::ostream &s, int flag=0) const
Printing stuff.
Definition: PathSeriesBase.cc:112
PathSeriesBase(int classTag, const double &cf=1.0, bool last=false)
Constructor.
Definition: PathSeriesBase.cc:38
size_t getNumDataPointsOnFile(const std::string &) const
Return the number of data en on the file with the name being passed as parameter. ...
Definition: PathSeriesBase.cc:53
Vector thePath
vector containing the data points
Definition: PathSeriesBase.h:46
size_t getNumDataPoints(void) const
Return the number of points that define the path.
Definition: PathSeriesBase.cc:49
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: PathSeriesBase.cc:120
Base class for constant factor time series.
Definition: CFactorSeries.h:39
static size_t load_vector_from_file(Vector &v, std::istream &is)
Read load vector from file.
Definition: PathSeriesBase.cc:76
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
double getPeakFactor(void) const
Return the peak value of the factor.
Definition: PathSeriesBase.cc:89
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: PathSeriesBase.cc:129