xc
SetEstruct.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 //SetEstruct.h
28 
29 #ifndef SETESTRUCT_H
30 #define SETESTRUCT_H
31 
32 #include "SetBase.h"
33 #include <map>
34 #include "domain/mesh/node/NodeTopology.h"
35 
36 namespace XC {
37 class ElemPtrArray3d;
38 class Node;
39 class Element;
40 
45 class SetEstruct: public SetBase
46  {
47  protected:
48  friend class Preprocessor;
49  void add_elements(const ElemPtrArray3d &);
50 
51  NodePtrSet getNodePtrSet(void);
52  public:
53  SetEstruct(const std::string &nmb="",Preprocessor *preprocessor= nullptr);
54  SetEstruct(const SetEstruct &);
56  virtual SetEstruct *getCopy(void) const= 0;
57  virtual size_t getNumNodeLayers(void) const= 0;
58  virtual size_t getNumNodeRows(void) const= 0;
59  virtual size_t getNumNodeColumns(void) const= 0;
60  virtual size_t getNumElementLayers(void) const= 0;
61  virtual size_t getNumElementRows(void) const= 0;
62  virtual size_t getNumElementColumns(void) const= 0;
63  size_t getNumberOfNodes(void) const;
64  size_t getNumberOfElements(void) const;
65  bool In(const Node *) const;
66  bool In(const Element *) const;
67 
68  bool isIRow(void) const;
69  bool isJRow(void) const;
70  bool isKRow(void) const;
71  bool isIConstantLayer(void) const;
72  bool isJConstantLayer(void) const;
73  bool isKConstantLayer(void) const;
74  size_t Dimension(void) const;
75  std::string getStrType(void) const;
76 
77  virtual Node *getNode(const size_t &i=1,const size_t &j=1,const size_t &k=1)= 0;
78  virtual const Node *getNode(const size_t &i=1,const size_t &j=1,const size_t &k=1) const= 0;
79 
80  Node *getNodeI(const size_t &i);
81  Node *getNodeIJ(const size_t &i,const size_t &j);
82  inline Node *getNodeIJK(const size_t &i,const size_t &j,const size_t &k)
83  { return getNode(i,j,k); }
84 
85  virtual Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1)= 0;
86  virtual const Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1) const= 0;
87 
88  inline Element *getElementI(const size_t &i)
89  { return getElement(i,1,1); }
90  inline Element *getElementIJ(const size_t &i,const size_t &j)
91  { return getElement(i,j,1); }
92  inline Element *getElementIJK(const size_t &i,const size_t &j,const size_t &k)
93  { return getElement(i,j,k); }
94 
95  std::set<int> getNodeTags(void) const;
96  boost::python::list getNodes(void);
97  std::set<int> getElementTags(void) const;
98  boost::python::list getElements(void);
100  };
101 } //end of XC namespace
102 #endif
bool isIRow(void) const
Returns true if only the I index varies.
Definition: SetEstruct.cc:61
Finite element model generation tools.
Definition: Preprocessor.h:58
size_t Dimension(void) const
Return the dimension of the range (0,1,2 or 3).
Definition: SetEstruct.cc:109
void add_elements(const ElemPtrArray3d &)
Adds to the model the elements being passed as parameters.
Definition: SetEstruct.cc:141
bool In(const Node *) const
Returns true if the node belongs to the set.
Definition: SetEstruct.cc:229
bool isKRow(void) const
Returns true if only the K index varies.
Definition: SetEstruct.cc:75
Three-dimensional array of pointers to elements.
Definition: ElemPtrArray3d.h:43
SetEstruct(const std::string &nmb="", Preprocessor *preprocessor=nullptr)
Constructor.
Definition: SetEstruct.cc:41
bool isKConstantLayer(void) const
Returns true if only I and J indices varies.
Definition: SetEstruct.cc:90
Base de las clases Set y SetEstruct.
Definition: SetBase.h:49
Base class for the finite elements.
Definition: Element.h:109
std::string getStrType(void) const
Returns the set type i_row, j_row, k_row, constantILayer,...
Definition: SetEstruct.cc:94
bool isIConstantLayer(void) const
Returns true if only J and K indices varies.
Definition: SetEstruct.cc:82
bool isJRow(void) const
Returns true if only the J index varies.
Definition: SetEstruct.cc:68
structured set, i.
Definition: SetEstruct.h:45
bool isJConstantLayer(void) const
Returns true if only J and K indices varies.
Definition: SetEstruct.cc:86
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Element edge container.
Definition: ElementEdges.h:44
std::set< int > getNodeTags(void) const
Returns the tags of the nodes.
Definition: SetEstruct.cc:154
ElementEdges getElementEdges(void)
Returns the element edges with both end nodes belong to the nodes of the set.
Definition: SetEstruct.cc:134
Mesh node.
Definition: Node.h:110
NodePtrSet getNodePtrSet(void)
Returns the pointers to the set nodes.
Definition: SetEstruct.cc:119
std::set< int > getElementTags(void) const
Returns the tags of the elements.
Definition: SetEstruct.cc:192
SetEstruct & operator=(const SetEstruct &)
Assignment operator.
Definition: SetEstruct.cc:49