XC Open source finite element analysis program
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 "xc_utils/src/nucleo/EntCmd.h"
34 #include "utility/actor/actor/MovableObject.h"
35 #include <map>
36 #include <deque>
37 
38 
39 namespace XC {
40 
41 class Domain;
42 class SetBase;
43 class Set;
44 class SetEstruct;
45 class EntMdlr;
46 class Preprocessor;
47 class Pnt;
48 class Edge;
49 class Face;
50 class Body;
51 class UniformGrid;
52 
57 class MapSet: public EntCmd, public MovableObject
58  {
59  static ID setsDbTags;
60  static std::deque<std::string> setsClassNames;
61  public:
62  typedef std::map<std::string,SetBase *> map_sets;
63  typedef map_sets::iterator iterator;
64  typedef map_sets::const_iterator const_iterator;
65  typedef std::map<std::string,EntMdlr *> map_ent_mdlr;
66  private:
67  Preprocessor *preprocessor;
68 
69  map_sets sets;
70  map_ent_mdlr entidades;
71  Set *total;
72  map_sets abiertos;
73 
74  bool existe(const std::string &nmb) const;
75  friend class EntMdlr;
76 
77  Set *create_set(const std::string &);
78  SetEstruct *create_set_estruct(const SetEstruct &);
79  SetBase *broke_set(const std::string &,const std::string &);
80 
81  SetBase *busca_set(const std::string &nmb);
82  SetEstruct *busca_set_estruct(const std::string &nmb);
83  void setup_total(void);
84  void clearSets(void);
85  void clearAll(void);
86  void reset(void);
87  friend class Cad;
88  friend class SetMeshComp;
89  friend class Set;
90  void abre_set(const std::string &nmb);
91  void cierra_set(const std::string &nmb);
92  iterator begin(void);
93  iterator end(void);
94 
95  MapSet(const MapSet &otro);
96  MapSet &operator=(const MapSet &otro);
97  protected:
98  const ID &getSetsDBTags(CommParameters &cp);
99  const std::deque<std::string> &getSetsClassNames(void);
100  DbTagData &getDbTagData(void) const;
101  int sendSetsDbTags(int posDbTag,CommParameters &cp);
102  int sendSetsClassNames(int posDbTag,CommParameters &cp);
103  int receiveSetsDbTags(int posDbTag,int size,const CommParameters &cp);
104  int receiveSetsClassNames(int pDbTg,int sz,const CommParameters &cp);
105  int sendSets(int posDbTag1, int posDbTag2, int posDbTag3,CommParameters &cp);
106  int receiveSets(int posDbTag1, int posDbTag2, int posDbTag3,const int &,const CommParameters &cp);
107  int sendAbiertos(int posDbTag1, int posDbTag2,CommParameters &cp);
108  int receiveAbiertos(int posDbTag1, int posDbTag2,const CommParameters &cp);
109 
110  int sendData(CommParameters &);
111  int recvData(const CommParameters &);
112 
113  friend class Preprocessor;
114  MapSet(Preprocessor *preprocessor= nullptr);
115  public:
116 
117  virtual ~MapSet(void);
118 
119  EntMdlr *inserta_ent_mdlr(EntMdlr *ent_mdlr);
120 
121  Set *get_set_total(void)
122  { return total; }
123  const Set *get_set_total(void) const
124  { return total; }
125  inline const map_sets &get_sets_abiertos(void) const
126  { return abiertos; }
127  inline map_sets &get_sets_abiertos(void)
128  { return abiertos; }
129  Set *defSet(const std::string &);
130  void removeSet(const std::string &);
131 
132  const SetBase *busca_set(const std::string &nmb) const;
133  SetBase &getSet(const std::string &nmb);
134  const_iterator begin(void) const;
135  const_iterator end(void) const;
136  std::set<SetBase *> get_sets(const Node *);
137  std::set<SetBase *> get_sets(const Element *);
138  std::set<SetBase *> get_sets(const Pnt *);
139  std::set<SetBase *> get_sets(const Edge *);
140  std::set<SetBase *> get_sets(const Face *);
141  std::set<SetBase *> get_sets(const Body *);
142  std::set<SetBase *> get_sets(const UniformGrid *);
143 
144  int sendSelf(CommParameters &);
145  int recvSelf(const CommParameters &);
146  };
147 } // end of XC namespace
148 
149 #endif
std::set< SetBase * > get_sets(const Node *)
Returns the sets que contienen the pointer a nodo being passed as parameter.
Definition: MapSet.cc:512
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
int sendData(CommParameters &)
Send members through the channel being passed as parameter.
Definition: MapSet.cc:450
Surface.
Definition: Face.h:41
Set * defSet(const std::string &)
Creates a new set with the name which is passed as a parameter.
Definition: MapSet.cc:236
std::map< std::string, SetBase * > map_sets
sets class names.
Definition: MapSet.h:62
Six-faced solid.
Definition: Body.h:64
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:53
int sendSetsDbTags(int posDbTag, CommParameters &cp)
Envía los dbTags of the sets través del canal being passed as parameter.
Definition: MapSet.cc:331
void removeSet(const std::string &)
Deletes the set and removes it from the sets map.
Definition: MapSet.cc:240
Vector que almacena los dbTags de los miembros de la clase.
Definition: DbTagData.h:43
const ID & getSetsDBTags(CommParameters &cp)
Returns the DBTags of the sets.
Definition: MapSet.cc:286
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:346
int receiveAbiertos(int posDbTag1, int posDbTag2, const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: MapSet.cc:435
virtual ~MapSet(void)
Destructor.
Definition: MapSet.cc:282
Mesh node.
Definition: Node.h:99
int sendAbiertos(int posDbTag1, int posDbTag2, CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: MapSet.cc:421
SetBase & getSet(const std::string &nmb)
Returns the set which name is being passed as parameter.
Definition: MapSet.cc:75
Base calass for the finite elements.
Definition: Element.h:104
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: MapSet.cc:478
Object that can move between processes.
Definition: MovableObject.h:91
Finite element model generation tools.
Definition: Preprocessor.h:58
EntMdlr * inserta_ent_mdlr(EntMdlr *ent_mdlr)
Inserts, as a set, a preprocessor entity.
Definition: MapSet.cc:182
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:361
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:373
Definition: ID.h:77
structured set, i. e. a set that can return a pointer a to a node or an element from its indices i...
Definition: SetEstruct.h:45
Punto (KPoint).
Definition: Pnt.h:49
Model geometry manager. Management of geometry entities: points, lines, surfaces, bodies...
Definition: Cad.h:69
Set of mesh components (nodes, elements and constraints).
Definition: SetMeshComp.h:58
int receiveSets(int posDbTag1, int posDbTag2, int posDbTag3, const int &, const CommParameters &cp)
Recibe the sets definidos through the channel being passed as parameter.
Definition: MapSet.cc:402
int recvData(const CommParameters &)
Receives members through the channel being passed as parameter.
Definition: MapSet.cc:464
Object set.
Definition: Set.h:63
const std::deque< std::string > & getSetsClassNames(void)
Returns the nombres de clase of the sets.
Definition: MapSet.cc:305
Uniform mesh. Uniform node distributionn on x, y and z.
Definition: UniformGrid.h:40
Communication parameters between processes.
Definition: CommParameters.h:65
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: MapSet.cc:492
================================================================================
Definition: ContinuaReprComponent.h:34
Sets container.
Definition: MapSet.h:57
int sendSets(int posDbTag1, int posDbTag2, int posDbTag3, CommParameters &cp)
Envía the sets definidos through the channel being passed as parameter.
Definition: MapSet.cc:385
DbTagData & getDbTagData(void) const
Returns a vector para almacenar los dbTags de los miembros de la clase.
Definition: MapSet.cc:324
Base de las clases Set y SetEstruct.
Definition: SetBase.h:50