XC Open source finite element analysis program
FE_Datastore.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.8 $
48 // $Date: 2005/11/08 00:04:32 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/utility/database/FE_Datastore.h,v $
50 
51 
52 #ifndef FE_Datastore_h
53 #define FE_Datastore_h
54 
55 // File: ~/utility/database/FE_Datastore.h
56 //
57 // Written: fmk
58 // Created: 10/98
59 // Revision: A
60 //
61 // Description: This file contains the class definition for FE_Datastore.
62 // FE_Datastore is an abstract base class. An FE_datastore object is used
63 // in the program to store/restore the geometry and state information in
64 // a model at a particular instance in the analysis.
65 //
66 // What: "@(#) FE_Datastore.h, revA"
67 
68 #include "utility/actor/channel/Channel.h"
69 
70 namespace XC {
71 class Preprocessor;
72 class FEM_ObjectBroker;
73 
75 //
76 class FE_Datastore: public Channel
77  {
78  private:
79  FEM_ObjectBroker *theObjectBroker;
80  Preprocessor *preprocessor;
81  static int lastDbTag;
82  std::set<int> savedStates;
83  protected:
84  FEM_ObjectBroker *getObjectBroker(void);
85  const Preprocessor *get_preprocessor(void) const
86  { return preprocessor; }
87  public:
89  inline virtual ~FE_Datastore(void) {}
90 
91  // methods defined in the Channel class interface which mean nothing for a Datastore
92  char *addToProgram(void);
93  int setUpConnection(void);
94  int setNextAddress(const ChannelAddress &otherChannelAddress);
95  ChannelAddress *getLastSendersAddress(void);
96 
97  // methods defined in the Channel class interface which can be implemented here
98  int sendObj(int commitTag,MovableObject &theObject, ChannelAddress *theAddress =0);
99 
100  int recvObj(int commitTag,MovableObject &theObject, FEM_ObjectBroker &theBroker,ChannelAddress *theAddress =0);
101 
102  // pure virtual functions in addition to those defined
103  // in the ModelBuilder and Channel classes for database applications
104  int getDbTag(void) const;
105  virtual bool isDatastore(void) const;
106 
107  virtual int commitState(int commitTag);
108  virtual int restoreState(int commitTag);
109  bool isSaved(int commitTag) const;
110 
111  virtual int createTable(const std::string &tableName, const std::vector<std::string> &);
112  virtual int insertData(const std::string &tableName,const std::vector<std::string> &, int commitTag, const Vector &data);
113  virtual int getData(const std::string &tableName,const std::vector<std::string> &, int commitTag, Vector &data);
114 
115  int save(const int &commitTag);
116  int restore(const int &commitTag);
117 
118  };
119 } // end of XC namespace
120 
121 
122 #endif
123 
Definition: Vector.h:82
Definition: FE_Datastore.h:76
FEM_ObjectBroker is is an object broker class for the finite element method. All methods are virtual ...
Definition: FEM_ObjectBroker.h:138
virtual int commitState(int commitTag)
Salva el estado en la database.
Definition: FE_Datastore.cpp:106
Definition: ChannelAddress.h:69
Object that can move between processes.
Definition: MovableObject.h:91
Finite element model generation tools.
Definition: Preprocessor.h:58
Channel is an abstract base class which defines the channel interface. A channel is a point of commun...
Definition: Channel.h:85
FE_Datastore(Preprocessor &, FEM_ObjectBroker &theBroker)
Constructor.
Definition: FE_Datastore.cpp:75
bool isSaved(int commitTag) const
Returns true if the estado se salvó
Definition: FE_Datastore.cpp:134
================================================================================
Definition: ContinuaReprComponent.h:34