xc
ElemPtrArray.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 //ElemPtrArray.h
29 //Point matrix
30 
31 #ifndef MATRIZPTRELEM_H
32 #define MATRIZPTRELEM_H
33 
34 #include "PtrArrayBase.h"
35 #include <vector>
36 #include <set>
37 
38 class Pos3d;
39 
40 namespace XC{
41 
42  class Element;
43  class Node;
44 
48 //
50 //
52 class ElemPtrArray: public PtrArrayBase<Element>
53  {
54  public:
56  ElemPtrArray(const size_t &f=0,const size_t &c=0)
57  : PtrArrayBase<Element>(f,c) {}
58 
59  Element *findElement(const int &);
60  const Element *findElement(const int &) const;
61  Element *getNearestElement(const Pos3d &p);
62  const Element *getNearestElement(const Pos3d &p) const;
63  bool removeElement(Element *);
64  bool removeElement(const int &);
65  boost::python::list getPyElementList(void) const;
66 
67  std::set<const Element *> getConnectedElements(const Node *) const;
68  std::set<Element *> getConnectedElements(const Node *);
69  boost::python::list getConnectedElementsPy(const Node *);
70  };
71 
72 } //end of XC namespace
73 
74 #endif
std::set< const Element * > getConnectedElements(const Node *) const
Return the elements connected to the node being passed as parameter.
Definition: ElemPtrArray.cc:176
bool removeElement(Element *)
Remove the given element from the array (set the corresponding pointer to null).
Definition: ElemPtrArray.cc:86
Element * getNearestElement(const Pos3d &p)
Returns the node closest to the point being passed as parameter.
Definition: ElemPtrArray.cc:122
boost::python::list getConnectedElementsPy(const Node *)
Return the elements connected to the node being passed as parameter.
Definition: ElemPtrArray.cc:204
Matrix of pointers to elements.
Definition: ElemPtrArray.h:52
Base class for the finite elements.
Definition: Element.h:112
boost::python::list getPyElementList(void) const
Returns a Python list containing the elements of this array.
Definition: ElemPtrArray.cc:157
ElemPtrArray(const size_t &f=0, const size_t &c=0)
Constructor.
Definition: ElemPtrArray.h:56
Posición en tres dimensiones.
Definition: Pos3d.h:44
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Element * findElement(const int &)
Returns (if it exists) a pointer to the element identified by the tag being passed as parameter...
Definition: ElemPtrArray.cc:37
Base class for matrices of pointers to nodes, elements and points.
Definition: PtrArrayBase.h:50
Mesh node.
Definition: Node.h:111