xc
MapSet.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 //MapSet.h
28 //Sets container.
29 
30 #ifndef MAPSET_H
31 #define MAPSET_H
32 
33 #include "preprocessor/PreprocessorContainer.h"
34 #include "utility/actor/actor/MovableObject.h"
35 #include "MapSetBase.h"
36 #include <map>
37 #include <deque>
38 
39 
40 namespace XC {
41 
42 class Domain;
43 
48  class MapSet: public PreprocessorContainer, public MovableObject, public MapSetBase
49  {
50  static ID setsDbTags;
51  public:
52  typedef std::map<std::string,EntMdlr *> map_ent_mdlr;
53  private:
54  map_ent_mdlr entities;
55  Set *total;
56  map_sets open_sets;
57 
58  friend class EntMdlr;
59 
60  bool is_open(const std::string &) const;
61  Set *create_set(const std::string &);
62  Set *alloc_set(const Set &);
63  SetBase *broke_set(const std::string &,const std::string &);
64 
65  SetBase *busca_set(const std::string &nmb);
66  SetEstruct *busca_set_estruct(const std::string &nmb);
67  void setup_total(void);
68  void clearSets(void);
69  void clearAll(void);
70  void reset(void);
71  friend class MultiBlockTopology;
72  friend class SetMeshComp;
73  friend class SetEntities;
74  friend class Set;
75  void abre_set(const std::string &nmb);
76  void cierra_set(const std::string &nmb);
77 
78  MapSet(const MapSet &);
79  MapSet &operator=(const MapSet &);
80  protected:
81  DbTagData &getDbTagData(void) const;
82  int sendSetsDbTags(int posDbTag,CommParameters &cp);
83  int sendSetsClassNames(int posDbTag,CommParameters &cp);
84  int receiveSetsDbTags(int posDbTag,int size,const CommParameters &cp);
85  int receiveSetsClassNames(int pDbTg,int sz,const CommParameters &cp);
86  int sendSets(int posDbTag1, int posDbTag2, int posDbTag3,CommParameters &cp);
87  int receiveSets(int posDbTag1, int posDbTag2, int posDbTag3,const int &,const CommParameters &cp);
88  int sendOpenSets(int posDbTag1, int posDbTag2,CommParameters &cp);
89  int receiveOpenSets(int posDbTag1, int posDbTag2,const CommParameters &cp);
90 
91  int sendData(CommParameters &);
92  int recvData(const CommParameters &);
93 
94  friend class Preprocessor;
95  MapSet(Preprocessor *preprocessor= nullptr);
96  public:
97 
98  virtual ~MapSet(void);
99 
100  EntMdlr *insert_ent_mdlr(EntMdlr *ent_mdlr);
101 
102  Set *get_set_total(void)
103  { return total; }
104  const Set *get_set_total(void) const
105  { return total; }
106  inline const map_sets &get_open_sets(void) const
107  { return open_sets; }
108  inline map_sets &get_open_sets(void)
109  { return open_sets; }
110  Set *defSet(const std::string &);
111  void removeSet(const std::string &);
112 
113  const SetBase *busca_set(const std::string &nmb) const;
114  SetBase &getSet(const std::string &nmb);
115 
116  int sendSelf(CommParameters &);
117  int recvSelf(const CommParameters &);
118  };
119 } // end of XC namespace
120 
121 #endif
virtual ~MapSet(void)
Destructor.
Definition: MapSet.cc:268
int recvData(const CommParameters &)
Receives members through the channel being passed as parameter.
Definition: MapSet.cc:418
int receiveSetsClassNames(int pDbTg, int sz, const CommParameters &cp)
Recibe los nombres de clase of the sets through the channel being passed as parameter.
Definition: MapSet.cc:325
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: MapSet.cc:273
Sets container.
Definition: MapSet.h:48
std::map< std::string, EntMdlr * > map_ent_mdlr
dbTags para the sets.
Definition: MapSet.h:52
Finite element model generation tools.
Definition: Preprocessor.h:58
Object that can move between processes.
Definition: MovableObject.h:99
Model geometry manager.
Definition: MultiBlockTopology.h:68
SetBase & getSet(const std::string &nmb)
Return the set which name is being passed as parameter.
Definition: MapSet.cc:69
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
Vector of integers.
Definition: ID.h:93
Sets container.
Definition: MapSetBase.h:55
Base de las clases Set y SetEstruct.
Definition: SetBase.h:49
Set of mesh components (nodes, elements and constraints).
Definition: SetMeshComp.h:58
int sendSets(int posDbTag1, int posDbTag2, int posDbTag3, CommParameters &cp)
Send the sets through the channel being passed as parameter.
Definition: MapSet.cc:338
Object set.
Definition: Set.h:56
EntMdlr * insert_ent_mdlr(EntMdlr *ent_mdlr)
Inserts, as a set, a preprocessor entity.
Definition: MapSet.cc:172
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: MapSet.cc:432
Set * defSet(const std::string &)
Creates a new set with the name which is passed as a parameter.
Definition: MapSet.cc:229
int sendOpenSets(int posDbTag1, int posDbTag2, CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: MapSet.cc:375
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:54
void removeSet(const std::string &)
Deletes the set and removes it from the sets map.
Definition: MapSet.cc:233
Base class for preprocessor containers i.
Definition: PreprocessorContainer.h:43
structured set, i.
Definition: SetEstruct.h:45
int sendSetsClassNames(int posDbTag, CommParameters &cp)
Envía los nombres de clase of the sets través del canal being passed as parameter.
Definition: MapSet.cc:296
int sendSetsDbTags(int posDbTag, CommParameters &cp)
Envía los dbTags of the sets través del canal being passed as parameter.
Definition: MapSet.cc:280
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: MapSet.cc:447
int receiveSets(int posDbTag1, int posDbTag2, int posDbTag3, const int &, const CommParameters &cp)
Receives the sets through the channel being passed as parameter.
Definition: MapSet.cc:355
int receiveSetsDbTags(int posDbTag, int size, const CommParameters &cp)
Recibe los dbTags of the sets through the channel being passed as parameter.
Definition: MapSet.cc:312
int receiveOpenSets(int posDbTag1, int posDbTag2, const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: MapSet.cc:389
int sendData(CommParameters &)
Send members through the channel being passed as parameter.
Definition: MapSet.cc:404
Object set.
Definition: SetEntities.h:63