xc
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 "DqPtrsKDTree.h"
34 #include "domain/mesh/element/utils/KDTreeElements.h"
35 
36 class Polyline3d;
37 class GeomObj3d;
38 class BND3d;
39 
40 namespace XC {
41 class TrfGeom;
42 
47 class DqPtrsElem: public DqPtrsKDTree<Element,KDTreeElements>
48  {
49  KDTreeElements kdtreeElements;
50  public:
51  DqPtrsElem(CommandEntity *owr= nullptr);
52  DqPtrsElem(const DqPtrsElem &);
53  explicit DqPtrsElem(const std::deque<Element *> &ts);
54  explicit DqPtrsElem(const std::set<const Element *> &ts);
56 
57  size_t getNumLiveElements(void) const;
58  size_t getNumDeadElements(void) const;
59  void kill_elements(void);
60  void alive_elements(void);
61 
62  std::set<int> getTags(void) const;
63 
64  void calc_resisting_force(void);
65 
66  Element *findElement(const int &);
67  const Element *findElement(const int &) const;
68  BND3d Bnd(const double &) const;
69  std::deque<Polyline3d> getContours(const double &factor= 0.0) const;
70  DqPtrsElem pickElemsInside(const GeomObj3d &, const double &tol= 0.0);
71  std::set<std::string> getMaterialNames(void) const;
72  boost::python::list getMaterialNamesPy(void) const;
73  std::set<std::string> getTypes(void) const;
74  boost::python::list getTypesPy(void) const;
75  std::set<size_t> getDimensions(void) const;
76  boost::python::list getDimensionsPy(void) const;
77  DqPtrsElem pickElemsOfType(const std::string &);
78  DqPtrsElem pickElemsOfDimension(const size_t &);
79  DqPtrsElem pickElemsOfMaterial(const std::string &);
80  void numera(void);
81  };
82 
83 DqPtrsElem operator+(const DqPtrsElem &a,const DqPtrsElem &b);
84 DqPtrsElem operator-(const DqPtrsElem &a,const DqPtrsElem &b);
85 DqPtrsElem operator*(const DqPtrsElem &a,const DqPtrsElem &b);
86 
87 } //end of XC namespace
88 #endif
89 
std::set< std::string > getMaterialNames(void) const
Return the names of the materials.
Definition: DqPtrsElem.cc:252
std::set< int > getTags(void) const
Returns the tags of the elements.
Definition: DqPtrsElem.cc:183
DqPtrsElem & operator=(const DqPtrsElem &)
Assignment operator.
Definition: DqPtrsElem.cc:58
Element * findElement(const int &)
Returns (if it exists) a pointer to the element identified by the tag being passed as parameter...
Definition: DqPtrsElem.cc:67
FiberSet operator*(const FiberSet &, const FiberSet &)
Return the fibers in a that are also in b.
Definition: FiberSet.cc:87
boost::python::list getDimensionsPy(void) const
Return the dimensions of the elements.
Definition: DqPtrsElem.cc:329
DqPtrsElem pickElemsOfDimension(const size_t &)
Return a container with the elements of the specified dimension.
Definition: DqPtrsElem.cc:360
std::set< size_t > getDimensions(void) const
Return the dimensions of the elements.
Definition: DqPtrsElem.cc:316
Base class for the finite elements.
Definition: Element.h:109
FiberSet operator+(const FiberSet &, const FiberSet &)
Return the union of both containers.
Definition: FiberSet.cc:65
BND3d Bnd(const double &) const
Returns the boundary of the element set.
Definition: DqPtrsElem.cc:192
void alive_elements(void)
Activates the elements.
Definition: DqPtrsElem.cc:159
std::set< std::string > getTypes(void) const
Return the types (class names) of the elements.
Definition: DqPtrsElem.cc:292
void calc_resisting_force(void)
Calcula los esfuerzos on each uno of the elements.
Definition: DqPtrsElem.cc:171
size_t getNumLiveElements(void) const
Returns the number of elements of the set which are active.
Definition: DqPtrsElem.cc:108
DqPtrsElem(CommandEntity *owr=nullptr)
Constructor.
Definition: DqPtrsElem.cc:39
void kill_elements(void)
Deactivates the elements.
Definition: DqPtrsElem.cc:147
boost::python::list getTypesPy(void) const
Return the types (class names) of the elements.
Definition: DqPtrsElem.cc:305
boost::python::list getMaterialNamesPy(void) const
Return the names of the materials in a python list.
Definition: DqPtrsElem.cc:282
Container with a KDTree.
Definition: DqPtrsKDTree.h:47
void numera(void)
Set indices to the objects to allow its use in VTK.
Definition: DqPtrsElem.cc:136
size_t getNumDeadElements(void) const
Returns the number of elements of the set which are inactive.
Definition: DqPtrsElem.cc:122
Definition: KDTreeElements.h:59
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
FiberSet operator-(const FiberSet &, const FiberSet &)
Return the fibers in a that are not in b.
Definition: FiberSet.cc:73
DqPtrsElem pickElemsOfMaterial(const std::string &)
Return a container with the elements whose material(s) name(s) contains the string.
Definition: DqPtrsElem.cc:267
std::deque< Polyline3d > getContours(const double &factor=0.0) const
Returns the element set contour.
Definition: DqPtrsElem.cc:212
Pointer to element container.
Definition: DqPtrsElem.h:47
DqPtrsElem pickElemsOfType(const std::string &)
Return a container with the elements whose class name contains the string.
Definition: DqPtrsElem.cc:342
DqPtrsElem pickElemsInside(const GeomObj3d &, const double &tol=0.0)
Return a container with the elements that lie inside the geometric object.
Definition: DqPtrsElem.cc:238