xc
NodePtrArray.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 //NodePtrArray.h
29 //Node matrix
30 
31 #ifndef NODEPTRARRAY_H
32 #define NODEPTRARRAY_H
33 
34 #include "PtrArrayBase.h"
35 #include "utility/matrices/m_int.h"
36 #include <vector>
37 #include <set>
38 
39 class Pos3d;
40 
41 namespace XC{
42 class Node;
43 class Element;
44 class SFreedom_Constraint;
45 
49 class NodePtrArray: public PtrArrayBase<Node>
50  {
51  public:
53  NodePtrArray(const size_t &f=0,const size_t &c=0)
54  : PtrArrayBase<Node>(f,c) {}
55  m_int getTags(void) const;
56  void fix(const SFreedom_Constraint &) const;
57 
58  Node *findNode(const int &tag);
59  const Node *findNode(const int &tag) const;
60  Node *getNearestNode(const Pos3d &p);
61  const Node *getNearestNode(const Pos3d &p) const;
62  bool removeNode(Node *);
63  bool removeNode(const int &);
64 
65  std::set<const Element *> getConnectedElements(void) const;
66  std::set<Element *> getConnectedElements(void);
67  boost::python::list getConnectedElementsPy(void);
68 
69  std::deque<const Node *> getNodePtrs(void) const;
70  std::deque<Node *> getNodePtrs(void);
71  boost::python::list getPyNodeList(void) const;
72  };
73 
74 } //end of XC namespace
75 
76 #endif
boost::python::list getConnectedElementsPy(void)
Return the elements connected to any of the nodes of this entity.
Definition: NodePtrArray.cc:252
Matrix which element type has estructura de anillo respecto a las operaciones + y *...
Definition: ZMatrix.h:37
boost::python::list getPyNodeList(void) const
Returns a Python list containing the nodes of this array.
Definition: NodePtrArray.cc:198
std::deque< const Node * > getNodePtrs(void) const
Returns the pointers to the nodes of this array.
Definition: NodePtrArray.cc:162
NodePtrArray(const size_t &f=0, const size_t &c=0)
Constructor.
Definition: NodePtrArray.h:53
m_int getTags(void) const
Returns an array with the identifiers of the nodes.
Definition: NodePtrArray.cc:277
Two-dimensional array of pointers to nodes.
Definition: NodePtrArray.h:49
Single freedom constraint.
Definition: SFreedom_Constraint.h:85
Node * getNearestNode(const Pos3d &p)
Returns the node closest to the point being passed as parameter.
Definition: NodePtrArray.cc:89
bool removeNode(Node *)
Remove the given node from the array (set the corresponding pointer to null).
Definition: NodePtrArray.cc:126
void fix(const SFreedom_Constraint &) const
Impone desplazamiento nulo en the nodes de this set.
Definition: NodePtrArray.cc:266
Posición en tres dimensiones.
Definition: Pos3d.h:44
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Base class for matrices of pointers to nodes, elements and points.
Definition: PtrArrayBase.h:50
Node * findNode(const int &tag)
Returns (if it exists) a pointer to the node which tag is being passed as parameter.
Definition: NodePtrArray.cc:42
Mesh node.
Definition: Node.h:112
std::set< const Element * > getConnectedElements(void) const
Return the elements connected to any of the nodes of this entity.
Definition: NodePtrArray.cc:215