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 class Constraint;
43 
48 class SetEstruct: public SetBase
49  {
50  protected:
51  friend class Preprocessor;
53 
54  NodePtrSet getNodePtrSet(void);
55  public:
56  SetEstruct(const std::string &nmb="",Preprocessor *preprocessor= nullptr);
57  SetEstruct(const SetEstruct &);
59  virtual SetEstruct *getCopy(void) const= 0;
60  virtual size_t getNumNodeLayers(void) const= 0;
61  virtual size_t getNumNodeRows(void) const= 0;
62  virtual size_t getNumNodeColumns(void) const= 0;
63  virtual size_t getNumElementLayers(void) const= 0;
64  virtual size_t getNumElementRows(void) const= 0;
65  virtual size_t getNumElementColumns(void) const= 0;
66  size_t getNumberOfNodes(void) const;
67  size_t getNumberOfElements(void) const;
68  bool In(const Node *) const;
69  bool In(const Element *) const;
70  bool In(const Constraint *) const;
71 
72  bool isIRow(void) const;
73  bool isJRow(void) const;
74  bool isKRow(void) const;
75  bool isIConstantLayer(void) const;
76  bool isJConstantLayer(void) const;
77  bool isKConstantLayer(void) const;
78  size_t Dimension(void) const;
79  std::string getStrType(void) const;
80 
81  virtual Node *getNode(const size_t &i=1,const size_t &j=1,const size_t &k=1)= 0;
82  virtual const Node *getNode(const size_t &i=1,const size_t &j=1,const size_t &k=1) const= 0;
83 
84  Node *getNodeI(const size_t &i);
85  Node *getNodeIJ(const size_t &i,const size_t &j);
86  inline Node *getNodeIJK(const size_t &i,const size_t &j,const size_t &k)
87  { return getNode(i,j,k); }
88 
89  virtual Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1)= 0;
90  virtual const Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1) const= 0;
91 
92  inline Element *getElementI(const size_t &i)
93  { return getElement(i,1,1); }
94  inline Element *getElementIJ(const size_t &i,const size_t &j)
95  { return getElement(i,j,1); }
96  inline Element *getElementIJK(const size_t &i,const size_t &j,const size_t &k)
97  { return getElement(i,j,k); }
98 
99  std::list<const Node *> getNodes(void) const;
100  std::list<Node *> getNodes(void);
101  std::set<int> getNodeTags(void) const;
102  boost::python::list getNodesPy(void);
103  std::list<const Element *> getElements(void) const;
104  std::list<Element *> getElements(void);
105  std::set<int> getElementTags(void) const;
106  boost::python::list getElementsPy(void);
107 
108  boost::python::list createInertiaLoads(const Vector &);
109  };
110 } //end of XC namespace
111 #endif
boost::python::list getNodesPy(void)
Return the nodes of the set in a Python list.
Definition: SetEstruct.cc:194
void add_elements_to_handler(const ElemPtrArray3d &)
Adds the elements to the element handler.
Definition: SetEstruct.cc:132
Float vector abstraction.
Definition: Vector.h:94
std::list< const Node * > getNodes(void) const
Return the nodes of the set in a list.
Definition: SetEstruct.cc:150
bool isIRow(void) const
Returns true if only the I index varies.
Definition: SetEstruct.cc:60
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:108
bool In(const Node *) const
Returns true if the node belongs to the set.
Definition: SetEstruct.cc:326
boost::python::list createInertiaLoads(const Vector &)
Creates the inertia loads that corresponds to the acceleration argument.
Definition: SetEstruct.cc:266
bool isKRow(void) const
Returns true if only the K index varies.
Definition: SetEstruct.cc:74
Three-dimensional array of pointers to elements.
Definition: ElemPtrArray3d.h:47
SetEstruct(const std::string &nmb="", Preprocessor *preprocessor=nullptr)
Constructor.
Definition: SetEstruct.cc:40
bool isKConstantLayer(void) const
Returns true if only I and J indices varies.
Definition: SetEstruct.cc:89
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:93
std::list< const Element * > getElements(void) const
Returns the elements in a list.
Definition: SetEstruct.cc:208
bool isIConstantLayer(void) const
Returns true if only J and K indices varies.
Definition: SetEstruct.cc:81
bool isJRow(void) const
Returns true if only the J index varies.
Definition: SetEstruct.cc:67
structured set, i.
Definition: SetEstruct.h:48
bool isJConstantLayer(void) const
Returns true if only J and K indices varies.
Definition: SetEstruct.cc:85
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:184
Base class for model constraints.
Definition: Constraint.h:48
Mesh node.
Definition: Node.h:112
NodePtrSet getNodePtrSet(void)
Returns the pointers to the set nodes.
Definition: SetEstruct.cc:118
std::set< int > getElementTags(void) const
Returns the tags of the elements.
Definition: SetEstruct.cc:242
SetEstruct & operator=(const SetEstruct &)
Assignment operator.
Definition: SetEstruct.cc:48