XC Open source finite element analysis program
NEESData.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.3 $
48 // $Date: 2006/01/10 18:16:20 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/utility/database/NEESData.h,v $
50 
51 
52 #ifndef NeesData_h
53 #define NeesData_h
54 
55 // Written: fmk
56 // Created: 03/04
57 //
58 // Description: This file contains the class definition for NeesData.
59 // NeesData is a concretes subclass of FE_Datastore. NEESData datastore
60 // is used to store data from the recorders in a file format that can
61 // be stored in the NEES data repository.
62 //
63 // What: "@(#) NeesData.h, revA"
64 
65 #include "FE_Datastore.h"
66 #include <fstream>
67 
68 namespace XC {
69 
71  {
72  public:
73  std::string name;
74  std::vector<std::string> columns;
75  NEES_table *next;
76  bool hasOutExtension;
77  inline size_t getNumColumns(void) const
78  { return columns.size(); }
79  };
80 
81 class FEM_ObjectBroker;
82 
84 //
85 class NEESData: public FE_Datastore
86  {
87  private:
88  std::string dataBase;
89  NEES_table *tables;
90  int numTables;
91  public:
100  NEESData(const std::string &dataBase,Preprocessor &preprocessor, FEM_ObjectBroker &theBroker);
101  ~NEESData(void);
102 
103  // method to get a database tag
104  int getDbTag(void) const;
105 
106  // methods for sending and receiving the data
107  int sendMsg(int dbTag, int commitTag, const Message &, ChannelAddress *theAddress= nullptr);
108  int recvMsg(int dbTag, int commitTag, Message &, ChannelAddress *theAddress= nullptr);
109 
110  int sendMatrix(int dbTag, int commitTag,const Matrix &, ChannelAddress *theAddress= nullptr);
111  int recvMatrix(int dbTag, int commitTag,Matrix &, ChannelAddress *theAddress= nullptr);
112 
113  int sendVector(int dbTag, int commitTag,const Vector &, ChannelAddress *theAddress= nullptr);
114  int recvVector(int dbTag, int commitTag,Vector &, ChannelAddress *theAddress= nullptr);
115 
116  int sendID(int dbTag, int commitTag,const ID &, ChannelAddress *theAddress= nullptr);
117  int recvID(int dbTag, int commitTag,ID &, ChannelAddress *theAddress= nullptr);
118 
119  int createTable(const std::string &tableName,const std::vector<std::string> &columns);
120  int insertData(const std::string &tableName,const std::vector<std::string> &columns, int commitTag, const Vector &data);
121  int getData(const std::string &tableName,const std::vector<std::string> &columns, int commitTag, Vector &data);
122 
123  // the commitState method
124  int commitState(int commitTag);
125  };
126 } // end of XC namespace
127 
128 
129 
130 #endif
131 
Definition: Vector.h:82
Definition: FE_Datastore.h:76
Definition: NEESData.h:70
FEM_ObjectBroker is is an object broker class for the finite element method. All methods are virtual ...
Definition: FEM_ObjectBroker.h:138
Definition: ChannelAddress.h:69
Definition: NEESData.h:85
Finite element model generation tools.
Definition: Preprocessor.h:58
Definition: ID.h:77
Definition: Matrix.h:82
Message between processes.
Definition: Message.h:67
================================================================================
Definition: ContinuaReprComponent.h:34