xc
DqMeshRegion.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 //DqMeshRegion.h
29 
30 #ifndef DqMeshRegion_h
31 #define DqMeshRegion_h
32 
33 #include <deque>
34 #include <iostream>
35 #include <boost/python/dict.hpp>
36 
37 namespace XC {
38 
39 class MeshRegion;
40 
42 //
44 class DqMeshRegion: protected std::deque<MeshRegion *>
45  {
46  public:
47  typedef std::deque<MeshRegion *> dq_Reg;
48  typedef dq_Reg::reference reference;
49  typedef dq_Reg::const_reference const_reference;
50  typedef dq_Reg::iterator iterator;
51  typedef dq_Reg::const_iterator const_iterator;
52  private:
53  void free_mem(void);
54  inline reference operator[](const size_t i)
55  { return dq_Reg::operator[](i); }
56  public:
57 
58  DqMeshRegion(void);
59  DqMeshRegion(const DqMeshRegion &);
61  ~DqMeshRegion(void);
62 
63  inline size_t size(void) const
64  { return dq_Reg::size(); }
65 
66  void resize(const size_t sz);
67 
68  void add(const MeshRegion &c);
69  inline const_reference operator[](const size_t i) const
70  { return dq_Reg::operator[](i); }
71 
72  inline void clearAll(void)
73  { free_mem(); }
74 
75  MeshRegion *getRegion(int tag);
76 
77  boost::python::dict getPyDict(void) const;
78  void setPyDict(const boost::python::dict &);
79 
80  void Print(std::ostream &s) const;
81  };
82 
83 } // end of XC namespace
84 
85 
86 #endif
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: DqMeshRegion.cc:106
DqMeshRegion & operator=(const DqMeshRegion &)
Assignment operator.
Definition: DqMeshRegion.cc:62
void resize(const size_t sz)
Changes the container size.
Definition: DqMeshRegion.cc:81
DqMeshRegion(void)
Constructor.
Definition: DqMeshRegion.cc:45
~DqMeshRegion(void)
Destructor.
Definition: DqMeshRegion.cc:76
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Dinamically allocated mesh region deque container.
Definition: DqMeshRegion.h:44
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: DqMeshRegion.cc:121
Nodes and elements of a mesh region.
Definition: MeshRegion.h:78