xc
DbTagData.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 
30 #ifndef DbTagData_h
31 #define DbTagData_h
32 
33 #include "utility/matrix/ID.h"
34 #include <set>
35 
36 namespace XC {
37 
38 class Communicator;
39 class CommMetaData;
40 
42 //
44 class DbTagData
45  {
46  private:
47  ID data;
48  mutable std::set<size_t> visitados;
49 
50  friend class Communicator;
51  int sendIdData(Communicator &,const int &) const;
52  int receiveIdData(const Communicator &,const int &);
53  public:
54  DbTagData(const int &dataSize= 0);
55  explicit DbTagData(const ID &);
56  void inicComm(const int &dataSize);
57 
58  inline int Size(void) const
59  { return data.Size(); }
60  inline int resize(const int &newSize)
61  { return data.resize(newSize); }
62  const int &getDbTagDataPos(const size_t &i) const;
63  void setDbTagDataPos(const size_t &i,const int &v);
64  int send(DbTagData &,Communicator &, const CommMetaData &) const;
65  int receive(DbTagData &,const Communicator &,const CommMetaData &);
66  void Print(std::ostream &os) const;
67  };
68 
69 std::ostream &operator<<(std::ostream &,const DbTagData &);
70 
71 } // end of XC namespace
72 
73 #endif
DbTagData(const int &dataSize=0)
Constructor.
Definition: DbTagData.cc:34
Communication parameters between processes.
Definition: Communicator.h:66
const int & getDbTagDataPos(const size_t &i) const
Returns the integer in the position being passed as parameter.
Definition: DbTagData.cc:58
int resize(const int &newSize, const int &fill_value=0)
Changes the size of the array.
Definition: ID.cpp:187
int send(DbTagData &, Communicator &, const CommMetaData &) const
Sends the object.
Definition: DbTagData.cc:102
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
Vector of integers.
Definition: ID.h:95
Data about the index, size,,...
Definition: CommMetaData.h:39
int receive(DbTagData &, const Communicator &, const CommMetaData &)
Receive the object.
Definition: DbTagData.cc:106
void inicComm(const int &dataSize)
Parameter initialization to communicate sz objects.
Definition: DbTagData.cc:42
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
void setDbTagDataPos(const size_t &i, const int &v)
Sets the integer in the position being passed as parameter.
Definition: DbTagData.cc:77
void Print(std::ostream &os) const
Print stuff.
Definition: DbTagData.cc:110
int Size(void) const
Returns the vector size.
Definition: ID.h:115