xc
RowSet.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 //RowSet.h
29 
30 #ifndef ROWSET_H
31 #define ROWSET_H
32 
33 #include "SetEstruct.h"
34 #include "utility/matrices/3d_arrays/Array3dRange.h"
35 
36 namespace XC {
37 
38 class SFreedom_Constraint;
39 
48 template <class ROWTTZNOD,class ROWTTZELEM>
49 class RowSet: public SetEstruct
50  {
51  ROWTTZNOD node_row;
52  ROWTTZELEM element_row;
53  public:
54  typedef typename ROWTTZNOD::reference reference_nod;
55  typedef typename ROWTTZNOD::const_reference const_reference_nod;
56 
57  typedef typename ROWTTZELEM::reference reference_elem;
58  typedef typename ROWTTZELEM::const_reference const_reference_elem;
59  public:
60  RowSet(const ROWTTZNOD &fn,const ROWTTZELEM &fe,const std::string &nmb="",Preprocessor *preprocessor= nullptr);
61  RowSet(const RowSet &);
62  RowSet &operator=(const RowSet &);
63  virtual SetEstruct *getCopy(void) const;
64  reference_nod Node(const size_t &i)
65  { return node_row(i); }
66  const reference_nod Node(const size_t &i) const
67  { return node_row(i); }
68  reference_elem Element(const size_t &i)
69  { return element_row(i); }
70  const reference_elem Element(const size_t &i) const
71  { return element_row(i); }
72 
73  Array3dRange NodeRange(void) const
74  { return Array3dRange(node_row); }
75  Array3dRange ElementRange(void) const
76  { return Array3dRange(element_row); }
77 
78  virtual size_t getNumNodeLayers(void) const
79  { return node_row.getNumberOfLayers(); }
80  virtual size_t getNumNodeRows(void) const
81  { return node_row.getNumberOfRows(); }
82  virtual size_t getNumNodeColumns(void) const
83  { return node_row.getNumberOfColumns(); }
84  virtual size_t getNumElementLayers(void) const
85  { return element_row.getNumberOfLayers(); }
86  virtual size_t getNumElementRows(void) const
87  { return element_row.getNumberOfRows(); }
88  virtual size_t getNumElementColumns(void) const
89  { return element_row.getNumberOfColumns(); }
90 
91  virtual XC::Node *getNode(const size_t &i=1,const size_t &j=1,const size_t &k=1)
92  { return node_row(i,j,k); }
93  virtual const XC::Node *getNode(const size_t &i=1,const size_t &j=1,const size_t &k=1) const
94  { return node_row(i,j,k); }
95  virtual XC::Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1)
96  { return element_row(i,j,k); }
97  virtual const XC::Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1) const
98  { return element_row(i,j,k); }
99 
100  //void fix(int &tag_fix,const SFreedom_Constraint &);
101 
102  };
103 
104 template <class ROWTTZNOD,class ROWTTZELEM>
105 RowSet<ROWTTZNOD,ROWTTZELEM>::RowSet(const ROWTTZNOD &fn,const ROWTTZELEM &fe,const std::string &nmb,Preprocessor *preprocessor)
106  : SetEstruct(nmb,preprocessor), node_row(fn), element_row(fe) {}
107 
108 template <class ROWTTZNOD,class ROWTTZELEM>
110  : SetEstruct(other), node_row(other.node_row), element_row(other.element_row) {}
111 
113 template <class ROWTTZNOD,class ROWTTZELEM>
115  {
116  SetEstruct::operator=(other);
117  node_row= other.node_row;
118  element_row= other.element_row;
119  return *this;
120  }
121 
123 template <class ROWTTZNOD,class ROWTTZELEM>
125  { return new RowSet<ROWTTZNOD,ROWTTZELEM>(*this); }
126 
127 
128 /* //! @brief Impone desplazamiento nulo en the nodes de this set. */
129 /* template <class ROWTTZNOD,class ROWTTZELEM> */
130 /* void XC::RowSet<ROWTTZNOD,ROWTTZELEM>::fix(const SFreedom_Constraint &spc) */
131 /* { fix(node_row,spc); } */
132 
133 
134 } //end of XC namespace
135 #endif
virtual SetEstruct * getCopy(void) const
Virtual constructor.
Definition: RowSet.h:124
Set of objects in a row.
Definition: RowSet.h:49
Finite element model generation tools.
Definition: Preprocessor.h:59
SetEstruct(const std::string &nmb="", Preprocessor *preprocessor=nullptr)
Constructor.
Definition: SetEstruct.cc:37
Base class for the finite elements.
Definition: Element.h:112
RowSet & operator=(const RowSet &)
Assignment operator.
Definition: RowSet.h:114
structured set, i.
Definition: SetEstruct.h:47
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Rangos de variación de tres índices, se emplea en BoxConstRef.
Definition: Array3dRange.h:32
Mesh node.
Definition: Node.h:111
SetEstruct & operator=(const SetEstruct &)
Assignment operator.
Definition: SetEstruct.cc:45