xc
DqPtrsElem.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 //DqPtrsElem.h
29 
30 
31 #ifndef DQPTRSELEM_H
32 #define DQPTRSELEM_H
33 
34 #include "DqPtrsKDTree.h"
35 #include "domain/mesh/element/utils/KDTreeElements.h"
36 #include "utility/geom/GeomObj.h"
37 
38 class Polyline3d;
39 class GeomObj3d;
40 class GeomObj2d;
41 class BND3d;
42 
43 namespace XC {
44 class TrfGeom;
45 class Element1D;
46 
51 class DqPtrsElem: public DqPtrsKDTree<Element,KDTreeElements>
52  {
53  Element1D *get_nearest_element_1d(const Vector &, const std::string &);
54  public:
55  DqPtrsElem(CommandEntity *owr= nullptr);
56  DqPtrsElem(const DqPtrsElem &);
57  explicit DqPtrsElem(const std::deque<Element *> &ts);
58  explicit DqPtrsElem(const std::set<const Element *> &ts);
60 
61  size_t getNumLiveElements(void) const;
62  size_t getNumDeadElements(void) const;
63  void kill_elements(void);
64  void alive_elements(void);
65 
66  std::set<int> getTags(void) const;
67  std::set<const Element *> getConstPtrSet(void) const;
68 
69  void calc_resisting_force(void);
70 
71  Element *findElement(const int &);
72  const Element *findElement(const int &) const;
73  BND3d Bnd(const double &) const;
74  std::deque<Polyline3d> getContours(const double &factor= 0.0) const;
75  DqPtrsElem pickElemsInside(const GeomObj3d &, const double &tol= 0.0);
76  DqPtrsElem pickElemsInside(const GeomObj2d &, const double &tol= 0.0);
77  DqPtrsElem pickElemsCrossing(const GeomObj3d &, const double &tol= 0.0);
78  DqPtrsElem pickElemsCrossing(const GeomObj2d &, const double &tol= 0.0);
79  std::set<std::string> getMaterialNames(void) const;
80  boost::python::list getMaterialNamesPy(void) const;
81  std::set<std::string> getTypes(void) const;
82  boost::python::list getTypesPy(void) const;
83  std::set<size_t> getDimensions(void) const;
84  boost::python::list getDimensionsPy(void) const;
85  DqPtrsElem pickElemsOfType(const std::string &);
86  DqPtrsElem pickElemsOfDimension(const size_t &);
87  DqPtrsElem pickElemsOfMaterial(const std::string &);
88  void numerate(void);
89  double getAverageSize(bool initialGeometry= true) const;
90  bool isCloserThan(const Pos3d &, const double &) const;
91  bool isCloserThan(const GeomObj::list_Pos3d &, const double &) const;
92 
93  // Loads on elements.
94  void createInertiaLoads(const Vector &);
95  void vector2dPointLoadGlobal(const Vector &,const Vector &);
96  void vector2dPointLoadLocal(const Vector &,const Vector &);
97  void vector3dPointLoadGlobal(const Vector &,const Vector &);
98  void vector3dPointLoadLocal(const Vector &,const Vector &);
99 
100  // mass distribution
101  Matrix getTotalMass(void) const;
102  double getTotalMassComponent(const int &) const;
103  };
104 
105 DqPtrsElem operator+(const DqPtrsElem &a,const DqPtrsElem &b);
106 DqPtrsElem operator-(const DqPtrsElem &a,const DqPtrsElem &b);
107 DqPtrsElem operator*(const DqPtrsElem &a,const DqPtrsElem &b);
108 
109 } //end of XC namespace
110 #endif
111 
Float vector abstraction.
Definition: Vector.h:94
std::set< std::string > getMaterialNames(void) const
Return the names of the materials.
Definition: DqPtrsElem.cc:473
void numerate(void)
Set indices to the objects to allow its use in VTK.
Definition: DqPtrsElem.cc:136
std::set< int > getTags(void) const
Returns the tags of the elements.
Definition: DqPtrsElem.cc:341
Base class for position lists.
Definition: PolyPos.h:35
DqPtrsElem & operator=(const DqPtrsElem &)
Assignment operator.
Definition: DqPtrsElem.cc:59
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
boost::python::list getDimensionsPy(void) const
Return the dimensions of the elements.
Definition: DqPtrsElem.cc:550
DqPtrsElem pickElemsOfDimension(const size_t &)
Return a container with the elements of the specified dimension.
Definition: DqPtrsElem.cc:624
std::set< size_t > getDimensions(void) const
Return the dimensions of the elements.
Definition: DqPtrsElem.cc:537
Polyline in a three-dimensional space.
Definition: Polyline3d.h:37
DqPtrsElem pickElemsCrossing(const GeomObj3d &, const double &tol=0.0)
Return a container with the elements that cross (i.e.
Definition: DqPtrsElem.cc:441
Base class for the finite elements.
Definition: Element.h:112
FiberSet operator+(const FiberSet &, const FiberSet &)
Return the union of both containers.
Definition: FiberSet.cc:65
void createInertiaLoads(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: DqPtrsElem.cc:176
Base class for one-dimensional elements (beam,truss,...)
Definition: Element1D.h:52
Base class for the two-dimensional geometric objects.
Definition: GeomObj2d.h:37
BND3d Bnd(const double &) const
Returns the boundary of the element set.
Definition: DqPtrsElem.cc:359
std::set< const Element * > getConstPtrSet(void) const
Returns the element pointers in a set.
Definition: DqPtrsElem.cc:350
void alive_elements(void)
Activates the elements.
Definition: DqPtrsElem.cc:317
void vector3dPointLoadGlobal(const Vector &, const Vector &)
Define an elemental concentrated load at position p with value v expressed in global coordinates...
Definition: DqPtrsElem.cc:250
Matrix getTotalMass(void) const
Return the total mass matrix.
Definition: DqPtrsElem.cc:277
double getAverageSize(bool initialGeometry=true) const
Return the average size of the elements.
Definition: DqPtrsElem.cc:147
void vector3dPointLoadLocal(const Vector &, const Vector &)
Define an elemental concentrated load at position p with value v expressed in local (element) coordin...
Definition: DqPtrsElem.cc:265
void vector2dPointLoadGlobal(const Vector &, const Vector &)
Define an elemental concentrated load at position p with value v expressed in global coordinates...
Definition: DqPtrsElem.cc:220
Objet that can execute python scripts.
Definition: CommandEntity.h:40
bool isCloserThan(const Pos3d &, const double &) const
Return true if the distance to the given point is smaller than the given one.
Definition: DqPtrsElem.cc:563
std::set< std::string > getTypes(void) const
Return the types (class names) of the elements.
Definition: DqPtrsElem.cc:513
void vector2dPointLoadLocal(const Vector &, const Vector &)
Define an elemental concentrated load at position p with value v expressed in local (element) coordin...
Definition: DqPtrsElem.cc:235
"boundary" en tres dimensiones.
Definition: BND3d.h:34
void calc_resisting_force(void)
Calcula los esfuerzos on each uno of the elements.
Definition: DqPtrsElem.cc:329
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:40
void kill_elements(void)
Deactivates the elements.
Definition: DqPtrsElem.cc:305
boost::python::list getTypesPy(void) const
Return the types (class names) of the elements.
Definition: DqPtrsElem.cc:526
boost::python::list getMaterialNamesPy(void) const
Return the names of the materials in a python list.
Definition: DqPtrsElem.cc:503
Container with a KDTree.
Definition: DqPtrsKDTree.h:48
double getTotalMassComponent(const int &) const
Return the total mass matrix component for the DOF argument.
Definition: DqPtrsElem.cc:292
Posición en tres dimensiones.
Definition: Pos3d.h:44
size_t getNumDeadElements(void) const
Returns the number of elements of the set which are inactive.
Definition: DqPtrsElem.cc:122
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
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:488
Matrix of floats.
Definition: Matrix.h:111
std::deque< Polyline3d > getContours(const double &factor=0.0) const
Returns the element set contour.
Definition: DqPtrsElem.cc:379
Pointer to element container.
Definition: DqPtrsElem.h:51
DqPtrsElem pickElemsOfType(const std::string &)
Return a container with the elements whose class name contains the string.
Definition: DqPtrsElem.cc:606
DqPtrsElem pickElemsInside(const GeomObj3d &, const double &tol=0.0)
Return a container with the elements that lie inside the geometric object.
Definition: DqPtrsElem.cc:405
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43