xc
DqPtrsNode.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 //DqPtrsNode.h
29 //deque de pointers to node.
30 
31 
32 #ifndef DQPTRSNODE_H
33 #define DQPTRSNODE_H
34 
35 #include "DqPtrsKDTree.h"
36 #include "domain/mesh/node/KDTreeNodes.h"
37 #include "utility/geom/GeomObj.h"
38 
39 class Vector3d;
40 class ExprAlgebra;
41 class GeomObj3d;
42 class GeomObj2d;
43 class BND3d;
44 class Plane;
45 class PrincipalAxes3D;
46 
47 namespace XC {
48 class TrfGeom;
49 
54 class DqPtrsNode: public DqPtrsKDTree<Node,KDTreeNodes>
55  {
56  public:
57  DqPtrsNode(CommandEntity *owr= nullptr);
58  DqPtrsNode(const DqPtrsNode &);
59  explicit DqPtrsNode(const std::deque<Node *> &);
60  explicit DqPtrsNode(const std::set<const Node *> &);
63  void move(const Vector3d &);
64  void transforma(const TrfGeom &trf);
65 
66  size_t getNumLiveNodes(void) const;
67  size_t getNumDeadNodes(void) const;
68 
69  bool InNodeTag(const int ) const;
70  bool InNodeTags(const ID &) const;
71  std::set<int> getTags(void) const;
72  bool isCloserThan(const Pos3d &, const double &) const;
73  bool isCloserThan(const GeomObj::list_Pos3d &, const double &) const;
74  DqPtrsNode pickNodesInside(const GeomObj3d &, const double &tol= 0.0);
75  DqPtrsNode pickNodesInside(const GeomObj2d &, const double &tol= 0.0);
76  BND3d Bnd(const double &) const;
77  Pos3d getCentroid(const double &) const;
78  Plane getRegressionPlane(const double &) const;
79  PrincipalAxes3D getOrientation(const double &) const;
80 
81  Node *findNode(const int &tag);
82  const Node *findNode(const int &tag) const;
83  void numerate(void);
84 
85  boost::python::list createInertiaLoads(const Vector &);
86 
87  // mass distribution
88  Matrix getTotalMass(void) const;
89  double getTotalMassComponent(const int &) const;
90  };
91 
92 DqPtrsNode operator+(const DqPtrsNode &a,const DqPtrsNode &b);
93 DqPtrsNode operator-(const DqPtrsNode &a,const DqPtrsNode &b);
94 DqPtrsNode operator*(const DqPtrsNode &a,const DqPtrsNode &b);
95 
96 } //end of XC namespace
97 #endif
98 
std::set< int > getTags(void) const
Returns the tags de los nodes.
Definition: DqPtrsNode.cc:237
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:228
Pointers to node container.
Definition: DqPtrsNode.h:54
Float vector abstraction.
Definition: Vector.h:94
double getTotalMassComponent(const int &) const
Return the total mass matrix component for the DOF argument.
Definition: DqPtrsNode.cc:205
BND3d Bnd(const double &) const
Return the nodes current position boundary.
Definition: DqPtrsNode.cc:328
void numerate(void)
Set indices to the objects to allow its use in VTK.
Definition: DqPtrsNode.cc:162
Pos3d getCentroid(const double &) const
Returns the centroid of the nodes.
Definition: DqPtrsNode.cc:352
DqPtrsNode pickNodesInside(const GeomObj3d &, const double &tol=0.0)
Return a container with the nodes that lie inside the geometric object.
Definition: DqPtrsNode.cc:293
Vector of integers.
Definition: ID.h:95
Plane in a three-dimensional space.
Definition: Plane.h:49
PrincipalAxes3D getOrientation(const double &) const
Return the orientation of the node cloud.
Definition: DqPtrsNode.cc:400
void transforma(const TrfGeom &trf)
Applies the transformation to the elements of the set.
Definition: DqPtrsNode.cc:83
Node * findNode(const int &tag)
Returns (if it exists) a pointer to the node cuyo tag is being passed as parameter.
Definition: DqPtrsNode.cc:93
FiberSet operator+(const FiberSet &, const FiberSet &)
Return the union of both containers.
Definition: FiberSet.cc:65
boost::python::list createInertiaLoads(const Vector &)
Creates the inertia load that correspond to the acceleration argument.
Definition: DqPtrsNode.cc:174
DqPtrsNode & operator=(const DqPtrsNode &)
Assignment operator.
Definition: DqPtrsNode.cc:61
Base class for the two-dimensional geometric objects.
Definition: GeomObj2d.h:37
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:219
DqPtrsNode(CommandEntity *owr=nullptr)
Constructor.
Definition: DqPtrsNode.cc:42
size_t getNumLiveNodes(void) const
Returns the number of nodes of the set which are active.
Definition: DqPtrsNode.cc:134
bool isCloserThan(const Pos3d &, const double &) const
Return true if the distance to the given point is smaller than the given one.
Definition: DqPtrsNode.cc:249
Objet that can execute python scripts.
Definition: CommandEntity.h:40
"boundary" en tres dimensiones.
Definition: BND3d.h:34
Geometric transformation that can be applied to the components of a set.
Definition: TrfGeom.h:48
Container with a KDTree.
Definition: DqPtrsKDTree.h:48
void move(const Vector3d &)
Desplaza los nodes of the set.
Definition: DqPtrsNode.cc:75
Posición en tres dimensiones.
Definition: Pos3d.h:44
Expresión algebraica.
Definition: ExprAlgebra.h:32
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
Principals axes of inertia in planar geometry.
Definition: PrincipalAxes3D.h:34
Matrix of floats.
Definition: Matrix.h:111
Plane getRegressionPlane(const double &) const
Returns the regression plane from the positions of the nodes.
Definition: DqPtrsNode.cc:374
size_t getNumDeadNodes(void) const
Returns the number of nodes of the set which are inactive.
Definition: DqPtrsNode.cc:148
Mesh node.
Definition: Node.h:112
Matrix getTotalMass(void) const
Return the total mass matrix.
Definition: DqPtrsNode.cc:190
Vector en tres dimensiones.
Definition: Vector3d.h:39
DqPtrsNode & operator+=(const DqPtrsNode &)
+= operator.
Definition: DqPtrsNode.cc:68
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43