XC Open source finite element analysis program
DqPtrsNode.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 //DqPtrsNode.h
28 //deque de pointers to node.
29 
30 
31 #ifndef DQPTRSNODE_H
32 #define DQPTRSNODE_H
33 
34 #include "DqPtrs.h"
35 #include "domain/mesh/node/KDTreeNodes.h"
36 
37 class Vector3d;
38 class ExprAlgebra;
39 
40 namespace XC {
41 class TrfGeom;
42 
47 class DqPtrsNode: public DqPtrs<Node>
48  {
49  KDTreeNodes kdtreeNodos;
50  protected:
51  void create_arbol(void);
52  public:
53  typedef DqPtrs<Node>::const_iterator const_iterator;
54  typedef DqPtrs<Node>::iterator iterator;
55  typedef DqPtrs<Node>::reference reference;
56  typedef DqPtrs<Node>::const_reference const_reference;
57  typedef DqPtrs<Node>::size_type size_type;
58 
59  DqPtrsNode(EntCmd *owr= nullptr);
60  DqPtrsNode(const DqPtrsNode &otro);
61  explicit DqPtrsNode(const std::deque<Node *> &ts);
62  explicit DqPtrsNode(const std::set<const Node *> &ts);
63  DqPtrsNode &operator=(const DqPtrsNode &otro);
64  void extend(const DqPtrsNode &otro);
65  //void extend_cond(const DqPtrsNode &otro,const std::string &cond);
66  bool push_back(Node *);
67  bool push_front(Node *);
68  void clearAll(void);
69  inline iterator begin(void)
70  { return DqPtrs<Node>::begin(); }
71  inline iterator end(void)
72  { return DqPtrs<Node>::end(); }
73  inline const_iterator begin(void) const
74  { return DqPtrs<Node>::begin(); }
75  inline const_iterator end(void) const
76  { return DqPtrs<Node>::end(); }
77  void mueve(const Vector3d &);
78  void transforma(const TrfGeom &trf);
79 
80  size_t getNumLiveNodes(void) const;
81  size_t getNumDeadNodes(void) const;
82 
83  bool InNodeTag(const int ) const;
84  bool InNodeTags(const ID &) const;
85  std::set<int> getTags(void) const;
86 
87  Node *buscaNodo(const int &tag);
88  const Node *buscaNodo(const int &tag) const;
89  Node *getNearestNode(const Pos3d &p);
90  const Node *getNearestNode(const Pos3d &p) const;
91 
92  void numera(void);
93  };
94 
95 } //end of XC namespace
96 #endif
97 
Pointer to (nodes, elements, points, lines,...) container.
Definition: DqPtrs.h:57
void mueve(const Vector3d &)
Desplaza los nodes of the set.
Definition: DqPtrsNode.cc:135
size_t getNumLiveNodes(void) const
Returns the number of nodes of the set which are active.
Definition: DqPtrsNode.cc:194
Mesh node.
Definition: Node.h:99
Definition: KDTreeNodes.h:58
Node * buscaNodo(const int &tag)
Returns (if it exists) a pointer to the node cuyo tag is being passed as parameter.
Definition: DqPtrsNode.cc:153
Node * getNearestNode(const Pos3d &p)
Returns the node closest to the point being passed as parameter.
Definition: DqPtrsNode.cc:121
DqPtrsNode & operator=(const DqPtrsNode &otro)
Assignment operator.
Definition: DqPtrsNode.cc:69
Definition: ID.h:77
void extend(const DqPtrsNode &otro)
Extend this container with the elements of the container being passed as parameter.
Definition: DqPtrsNode.cc:78
Definition: TrfGeom.h:49
DqPtrsNode(EntCmd *owr=nullptr)
Constructor.
Definition: DqPtrsNode.cc:45
std::set< int > getTags(void) const
Returns the tags de los nodes.
Definition: DqPtrsNode.cc:252
Contenedor de pointers to nodes.
Definition: DqPtrsNode.h:47
bool InNodeTags(const ID &) const
Returns true if the nodes, with the tags are being passed as parameter, belong to the set...
Definition: DqPtrsNode.cc:243
void transforma(const TrfGeom &trf)
Applies the transformation to the elements of the set.
Definition: DqPtrsNode.cc:143
size_t getNumDeadNodes(void) const
Returns the number of nodes of the set which are inactive.
Definition: DqPtrsNode.cc:208
================================================================================
Definition: ContinuaReprComponent.h:34
bool InNodeTag(const int) const
Returns true if the node identified by the tag being passed as parameter, belongs to the set...
Definition: DqPtrsNode.cc:234
void clearAll(void)
Clears out the list of pointers and erases the properties of the object (if any). ...
Definition: DqPtrsNode.cc:98
void numera(void)
Set indices to the objects to allow its use in VTK.
Definition: DqPtrsNode.cc:222