XC Open source finite element analysis program
ObjWithRecorders.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 //ObjWithRecorders.h
28 
29 
30 #ifndef ObjWithRecorders_h
31 #define ObjWithRecorders_h
32 
33 #include "xc_utils/src/nucleo/EntCmd.h"
34 #include "utility/handler/DataOutputHandler.h"
35 #include <list>
36 
37 namespace XC {
38 class Recorder;
39  class Domain;
40 
42 //
44 class ObjWithRecorders: public EntCmd
45  {
46  public:
47  typedef std::list<Recorder *> lista_recorders;
48  typedef lista_recorders::iterator recorder_iterator;
49  typedef lista_recorders::const_iterator const_recorder_iterator;
50  private:
51  lista_recorders theRecorders;
52  DataOutputHandler::map_output_handlers *output_handlers;
53 
54  protected:
55  int sendData(CommParameters &cp);
56  int recvData(const CommParameters &cp);
57 
59  inline size_t getNumRecorders(void) const
60  { return theRecorders.size(); }
61  virtual Domain *get_domain_ptr(void)= 0;
62  public:
63  ObjWithRecorders(EntCmd *owr,DataOutputHandler::map_output_handlers *oh= nullptr);
64  virtual ~ObjWithRecorders(void);
65 
66  Recorder *newRecorder(const std::string &,DataOutputHandler *oh= nullptr);
67  virtual int addRecorder(Recorder &theRecorder);
68  inline recorder_iterator recorder_begin(void)
69  { return theRecorders.begin(); }
70  inline const_recorder_iterator recorder_begin(void) const
71  { return theRecorders.begin(); }
72  inline recorder_iterator recorder_end(void)
73  { return theRecorders.end(); }
74  inline const_recorder_iterator recorder_end(void) const
75  { return theRecorders.end(); }
76  virtual int record(int track, double timeStamp= 0.0);
77  void restart(void);
78  virtual int removeRecorders(void);
79  void setLinks(Domain *dom);
80  void SetOutputHandlers(DataOutputHandler::map_output_handlers *oh);
81  };
82 } // end of XC namespace
83 
84 #endif
85 
86 
virtual ~ObjWithRecorders(void)
Destructor.
Definition: ObjWithRecorders.cc:163
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
void restart(void)
Rearranca los recorders.
Definition: ObjWithRecorders.cc:186
virtual int record(int track, double timeStamp=0.0)
Ejecuta los recorders sobre el tag being passed as parameter.
Definition: ObjWithRecorders.cc:178
virtual int addRecorder(Recorder &theRecorder)
Adds a recorder.
Definition: ObjWithRecorders.cc:171
Objeto capaz de gestionar Recorders.
Definition: ObjWithRecorders.h:44
void SetOutputHandlers(DataOutputHandler::map_output_handlers *oh)
Asigna el almacén de gestores de salida.
Definition: ObjWithRecorders.cc:218
An Recorder object is used in the program to store/restore information at each commit().
Definition: Recorder.h:79
Recorder * newRecorder(const std::string &, DataOutputHandler *oh=nullptr)
Lee un objeto Recorder desde archivo.
Definition: ObjWithRecorders.cc:76
size_t getNumRecorders(void) const
Returns the number of recorders already defined.
Definition: ObjWithRecorders.h:59
virtual int removeRecorders(void)
Elimina los recorders.
Definition: ObjWithRecorders.cc:193
void setLinks(Domain *dom)
Asigna el domain a los recorders.
Definition: ObjWithRecorders.cc:202
Definition: DataOutputHandler.h:61
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34