xc
SetEstruct.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 //SetEstruct.h
29 
30 #ifndef SETESTRUCT_H
31 #define SETESTRUCT_H
32 
33 #include "SetBase.h"
34 #include <map>
35 #include <list>
36 #include "domain/mesh/node/NodeTopology.h"
37 
38 namespace XC {
39 class ElemPtrArray3d;
40 class Node;
41 class Element;
42 
47 class SetEstruct: public SetBase
48  {
49  protected:
50  friend class Preprocessor;
52 
53  NodePtrSet getNodePtrSet(void);
54  public:
55  SetEstruct(const std::string &nmb="",Preprocessor *preprocessor= nullptr);
56  SetEstruct(const SetEstruct &);
58  virtual SetEstruct *getCopy(void) const= 0;
59  virtual size_t getNumNodeLayers(void) const= 0;
60  virtual size_t getNumNodeRows(void) const= 0;
61  virtual size_t getNumNodeColumns(void) const= 0;
62  virtual size_t getNumElementLayers(void) const= 0;
63  virtual size_t getNumElementRows(void) const= 0;
64  virtual size_t getNumElementColumns(void) const= 0;
65  size_t getNumberOfNodes(void) const;
66  size_t getNumberOfElements(void) const;
67  bool In(const Node *) const;
68  bool In(const Element *) const;
69 
70  bool isIRow(void) const;
71  bool isJRow(void) const;
72  bool isKRow(void) const;
73  bool isIConstantLayer(void) const;
74  bool isJConstantLayer(void) const;
75  bool isKConstantLayer(void) const;
76  size_t Dimension(void) const;
77  std::string getStrType(void) const;
78 
79  virtual Node *getNode(const size_t &i=1,const size_t &j=1,const size_t &k=1)= 0;
80  virtual const Node *getNode(const size_t &i=1,const size_t &j=1,const size_t &k=1) const= 0;
81 
82  Node *getNodeI(const size_t &i);
83  Node *getNodeIJ(const size_t &i,const size_t &j);
84  inline Node *getNodeIJK(const size_t &i,const size_t &j,const size_t &k)
85  { return getNode(i,j,k); }
86 
87  virtual Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1)= 0;
88  virtual const Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1) const= 0;
89 
90  inline Element *getElementI(const size_t &i)
91  { return getElement(i,1,1); }
92  inline Element *getElementIJ(const size_t &i,const size_t &j)
93  { return getElement(i,j,1); }
94  inline Element *getElementIJK(const size_t &i,const size_t &j,const size_t &k)
95  { return getElement(i,j,k); }
96 
97  std::list<const Node *> getNodes(void) const;
98  std::list<Node *> getNodes(void);
99  std::set<int> getNodeTags(void) const;
100  boost::python::list getNodesPy(void);
101  std::list<const Element *> getElements(void) const;
102  std::list<Element *> getElements(void);
103  std::set<int> getElementTags(void) const;
104  boost::python::list getElementsPy(void);
105 
106  void createInertiaLoads(const Vector &);
107  };
108 } //end of XC namespace
109 #endif
boost::python::list getNodesPy(void)
Return the nodes of the set in a Python list.
Definition: SetEstruct.cc:191
void add_elements_to_handler(const ElemPtrArray3d &)
Adds the elements to the element handler.
Definition: SetEstruct.cc:129
Float vector abstraction.
Definition: Vector.h:94
void createInertiaLoads(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: SetEstruct.cc:263
std::list< const Node * > getNodes(void) const
Return the nodes of the set in a list.
Definition: SetEstruct.cc:147
bool isIRow(void) const
Returns true if only the I index varies.
Definition: SetEstruct.cc:57
Finite element model generation tools.
Definition: Preprocessor.h:59
size_t Dimension(void) const
Return the dimension of the range (0,1,2 or 3).
Definition: SetEstruct.cc:105
bool In(const Node *) const
Returns true if the node belongs to the set.
Definition: SetEstruct.cc:288
bool isKRow(void) const
Returns true if only the K index varies.
Definition: SetEstruct.cc:71
Three-dimensional array of pointers to elements.
Definition: ElemPtrArray3d.h:47
SetEstruct(const std::string &nmb="", Preprocessor *preprocessor=nullptr)
Constructor.
Definition: SetEstruct.cc:37
bool isKConstantLayer(void) const
Returns true if only I and J indices varies.
Definition: SetEstruct.cc:86
Base de las clases Set y SetEstruct.
Definition: SetBase.h:51
Base class for the finite elements.
Definition: Element.h:112
std::string getStrType(void) const
Returns the set type i_row, j_row, k_row, constantILayer,...
Definition: SetEstruct.cc:90
std::list< const Element * > getElements(void) const
Returns the elements in a list.
Definition: SetEstruct.cc:205
bool isIConstantLayer(void) const
Returns true if only J and K indices varies.
Definition: SetEstruct.cc:78
bool isJRow(void) const
Returns true if only the J index varies.
Definition: SetEstruct.cc:64
structured set, i.
Definition: SetEstruct.h:47
bool isJConstantLayer(void) const
Returns true if only J and K indices varies.
Definition: SetEstruct.cc:82
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
std::set< int > getNodeTags(void) const
Returns the tags of the nodes.
Definition: SetEstruct.cc:181
Mesh node.
Definition: Node.h:111
NodePtrSet getNodePtrSet(void)
Returns the pointers to the set nodes.
Definition: SetEstruct.cc:115
std::set< int > getElementTags(void) const
Returns the tags of the elements.
Definition: SetEstruct.cc:239
SetEstruct & operator=(const SetEstruct &)
Assignment operator.
Definition: SetEstruct.cc:45