XC Open source finite element analysis program
DqPtrsElem.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 //DqPtrsElem.h
28 
29 
30 #ifndef DQPTRSELEM_H
31 #define DQPTRSELEM_H
32 
33 #include "DqPtrs.h"
34 #include "domain/mesh/element/utils/KDTreeElements.h"
35 
36 class Polilinea3d;
37 
38 namespace XC {
39 class TrfGeom;
40 
45 class DqPtrsElem: public DqPtrs<Element>
46  {
47  KDTreeElements kdtreeElements;
48  inline iterator begin(void)
49  { return DqPtrs<Element>::begin(); }
50  inline iterator end(void)
51  { return DqPtrs<Element>::end(); }
52  protected:
53  void create_arbol(void);
54  public:
55  typedef DqPtrs<Element>::const_iterator const_iterator;
56  typedef DqPtrs<Element>::iterator iterator;
57  typedef DqPtrs<Element>::reference reference;
58  typedef DqPtrs<Element>::const_reference const_reference;
59  typedef DqPtrs<Element>::size_type size_type;
60 
61  DqPtrsElem(EntCmd *owr= nullptr);
62  DqPtrsElem(const DqPtrsElem &otro);
63  explicit DqPtrsElem(const std::deque<Element *> &ts);
64  explicit DqPtrsElem(const std::set<const Element *> &ts);
66  void extend(const DqPtrsElem &);
67  //void extend_cond(const DqPtrsElem &otro,const std::string &cond);
68  bool push_back(Element *);
69  bool push_front(Element *);
70  void clearAll(void);
71  inline const_iterator begin(void) const
72  { return DqPtrs<Element>::begin(); }
73  inline const_iterator end(void) const
74  { return DqPtrs<Element>::end(); }
75 
76  size_t getNumLiveElements(void) const;
77  size_t getNumDeadElements(void) const;
78  void kill_elements(void);
79  void alive_elements(void);
80 
81  std::set<int> getTags(void) const;
82 
83  void calc_resisting_force(void);
84 
85  Element *findElement(const int &);
86  const Element *findElement(const int &) const;
87  Element *getNearestElement(const Pos3d &);
88  const Element *getNearestElement(const Pos3d &) const;
89  std::deque<Polilinea3d> getContours(bool undeformedGeometry= true) const;
90 
91  void numera(void);
92  };
93 
94 } //end of XC namespace
95 #endif
96 
Pointer to (nodes, elements, points, lines,...) container.
Definition: DqPtrs.h:57
std::deque< Polilinea3d > getContours(bool undeformedGeometry=true) const
Returns the element set contour.
Definition: DqPtrsElem.cc:263
void clearAll(void)
Clears out the list of pointers and erases the properties of the object (if any). ...
Definition: DqPtrsElem.cc:100
void alive_elements(void)
Activates the elements.
Definition: DqPtrsElem.cc:230
size_t getNumDeadElements(void) const
Returns the number of elements of the set which are inactive.
Definition: DqPtrsElem.cc:193
void extend(const DqPtrsElem &)
Extend this list with the elements of the container being passed as parameter.
Definition: DqPtrsElem.cc:80
void numera(void)
Set indices to the objects to allow its use in VTK.
Definition: DqPtrsElem.cc:207
void calc_resisting_force(void)
Calcula los esfuerzos en cada uno of the elements.
Definition: DqPtrsElem.cc:242
Base calass for the finite elements.
Definition: Element.h:104
DqPtrsElem(EntCmd *owr=nullptr)
Constructor.
Definition: DqPtrsElem.cc:47
Definition: KDTreeElements.h:59
void kill_elements(void)
Deactivates the elements.
Definition: DqPtrsElem.cc:218
Element * getNearestElement(const Pos3d &)
Returns the element closest to the point being passed as parameter.
Definition: DqPtrsElem.cc:123
Pointer to element container.
Definition: DqPtrsElem.h:45
std::set< int > getTags(void) const
Returns the tags of the elements.
Definition: DqPtrsElem.cc:254
Element * findElement(const int &)
Returns (if it exists) a pointer to the element identified by the tag being passed as parameter...
Definition: DqPtrsElem.cc:138
================================================================================
Definition: ContinuaReprComponent.h:34
DqPtrsElem & operator=(const DqPtrsElem &)
Assignment operator.
Definition: DqPtrsElem.cc:71
size_t getNumLiveElements(void) const
Returns the number of elements of the set which are active.
Definition: DqPtrsElem.cc:179