XC Open source finite element analysis program
SetFila.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 //SetFila.h
28 
29 #ifndef SETFILA_H
30 #define SETFILA_H
31 
32 #include "SetEstruct.h"
33 #include "xc_utils/src/geom/pos_vec/RangoTritriz.h"
34 
35 namespace XC {
36 
37 class SFreedom_Constraint;
38 
47 template <class FILATTZNOD,class FILATTZELEM>
48 class SetFila: public SetEstruct
49  {
50  FILATTZNOD fila_nod;
51  FILATTZELEM fila_elem;
52  public:
53  typedef typename FILATTZNOD::reference reference_nod;
54  typedef typename FILATTZNOD::const_reference const_reference_nod;
55 
56  typedef typename FILATTZELEM::reference reference_elem;
57  typedef typename FILATTZELEM::const_reference const_reference_elem;
58  public:
59  SetFila(const FILATTZNOD &fn,const FILATTZELEM &fe,const std::string &nmb="",Preprocessor *preprocessor= nullptr);
60  SetFila(const SetFila &otro);
61  SetFila &operator=(const SetFila &otro);
62  virtual SetEstruct *getCopy(void) const;
63  reference_nod Nodo(const size_t &i)
64  { return fila_nod(i); }
65  const reference_nod Nodo(const size_t &i) const
66  { return fila_nod(i); }
67  reference_elem Element(const size_t &i)
68  { return fila_elem(i); }
69  const reference_elem Element(const size_t &i) const
70  { return fila_elem(i); }
71 
72  RangoTritriz RangoNodos(void) const
73  { return RangoTritriz(fila_nod); }
74  RangoTritriz ElementRange(void) const
75  { return RangoTritriz(fila_elem); }
76 
77  virtual size_t getNumNodeLayers(void) const
78  { return fila_nod.GetCapas(); }
79  virtual size_t getNumNodeRows(void) const
80  { return fila_nod.getNumFilas(); }
81  virtual size_t getNumNodeColumns(void) const
82  { return fila_nod.getNumCols(); }
83  virtual size_t getNumElementLayers(void) const
84  { return fila_elem.GetCapas(); }
85  virtual size_t getNumElementRows(void) const
86  { return fila_elem.getNumFilas(); }
87  virtual size_t getNumElementColumns(void) const
88  { return fila_elem.getNumCols(); }
89 
90  virtual XC::Node *GetNodo(const size_t &i=1,const size_t &j=1,const size_t &k=1)
91  { return fila_nod(i,j,k); }
92  virtual const XC::Node *GetNodo(const size_t &i=1,const size_t &j=1,const size_t &k=1) const
93  { return fila_nod(i,j,k); }
94  virtual XC::Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1)
95  { return fila_elem(i,j,k); }
96  virtual const XC::Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1) const
97  { return fila_elem(i,j,k); }
98 
99  //void fix(int &tag_fix,const SFreedom_Constraint &);
100 
101  };
102 
103 template <class FILATTZNOD,class FILATTZELEM>
104 SetFila<FILATTZNOD,FILATTZELEM>::SetFila(const FILATTZNOD &fn,const FILATTZELEM &fe,const std::string &nmb,Preprocessor *preprocessor)
105  : SetEstruct(nmb,preprocessor), fila_nod(fn), fila_elem(fe) {}
106 
107 template <class FILATTZNOD,class FILATTZELEM>
109  : SetEstruct(otro), fila_nod(otro.fila_nod), fila_elem(otro.fila_elem) {}
110 
112 template <class FILATTZNOD,class FILATTZELEM>
114  {
115  SetEstruct::operator=(otro);
116  fila_nod= otro.fila_nod;
117  fila_elem= otro.fila_elem;
118  return *this;
119  }
120 
122 template <class FILATTZNOD,class FILATTZELEM>
124  { return new SetFila<FILATTZNOD,FILATTZELEM>(*this); }
125 
126 
127 /* //! @brief Impone desplazamiento nulo en los nodos de this set. */
128 /* template <class FILATTZNOD,class FILATTZELEM> */
129 /* void XC::SetFila<FILATTZNOD,FILATTZELEM>::fix(const SFreedom_Constraint &spc) */
130 /* { fix(fila_nod,spc); } */
131 
132 
133 } //end of XC namespace
134 #endif
SetEstruct & operator=(const SetEstruct &otro)
Assignment operator.
Definition: SetEstruct.cc:49
Mesh node.
Definition: Node.h:99
Set of objects in a row.
Definition: SetFila.h:48
Base calass for the finite elements.
Definition: Element.h:104
Finite element model generation tools.
Definition: Preprocessor.h:58
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
SetFila & operator=(const SetFila &otro)
Assignment operator.
Definition: SetFila.h:113
SetEstruct(const std::string &nmb="", Preprocessor *preprocessor=nullptr)
Constructor.
Definition: SetEstruct.cc:41
virtual SetEstruct * getCopy(void) const
Virtual constructor.
Definition: SetFila.h:123
================================================================================
Definition: ContinuaReprComponent.h:34