XC Open source finite element analysis program
VectorCells.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 //VectorCells.h
28 
29 #ifndef VectorCells_h
30 #define VectorCells_h
31 
32 #include <vector>
33 #include <iostream>
34 
35 namespace XC {
36 
37  class Cell;
38 
40 //
42 class VectorCells: protected std::vector<Cell *>
43  {
44  public:
45  typedef std::vector<Cell *> v_cell;
46  typedef v_cell::reference reference;
47  typedef v_cell::const_reference const_reference;
48  typedef v_cell::iterator iterator;
49  typedef v_cell::const_iterator const_iterator;
50  private:
51  void libera(void);
52  void libera(const size_t i);
53  void alloc(const size_t i,const Cell &c);
54  inline reference operator[](const size_t i)
55  { return v_cell::operator[](i); }
56  public:
57 
58  VectorCells(const size_t &sz= 0);
59  VectorCells(const VectorCells &otro);
60  VectorCells &operator=(const VectorCells &otro);
61  ~VectorCells(void);
62 
63  inline size_t size(void) const
64  { return v_cell::size(); }
65 
66  void resize(const size_t sz);
67 
68  void put(const size_t i,const Cell &c);
69  inline const_reference operator[](const size_t i) const
70  { return v_cell::operator[](i); }
71 
72  void Print(std::ostream &s) const;
73  };
74 
75 } // end of XC namespace
76 
77 
78 #endif
~VectorCells(void)
Destructor.
Definition: VectorCells.cc:87
Cells vector.
Definition: VectorCells.h:42
VectorCells(const size_t &sz=0)
Constructor.
Definition: VectorCells.cc:56
Base class for cells (cross-section discretization).
Definition: Cell.h:74
VectorCells & operator=(const VectorCells &otro)
Assignment operator.
Definition: VectorCells.cc:73
================================================================================
Definition: ContinuaReprComponent.h:34
void resize(const size_t sz)
Destructor.
Definition: VectorCells.cc:92