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 
46 namespace XC {
47 class TrfGeom;
48 
53 class DqPtrsNode: public DqPtrsKDTree<Node,KDTreeNodes>
54  {
55  public:
56  DqPtrsNode(CommandEntity *owr= nullptr);
57  DqPtrsNode(const DqPtrsNode &);
58  explicit DqPtrsNode(const std::deque<Node *> &);
59  explicit DqPtrsNode(const std::set<const Node *> &);
62  void move(const Vector3d &);
63  void transforma(const TrfGeom &trf);
64 
65  size_t getNumLiveNodes(void) const;
66  size_t getNumDeadNodes(void) const;
67 
68  bool InNodeTag(const int ) const;
69  bool InNodeTags(const ID &) const;
70  std::set<int> getTags(void) const;
71  bool isCloserThan(const Pos3d &, const double &) const;
72  bool isCloserThan(const GeomObj::list_Pos3d &, const double &) const;
73  DqPtrsNode pickNodesInside(const GeomObj3d &, const double &tol= 0.0);
74  DqPtrsNode pickNodesInside(const GeomObj2d &, const double &tol= 0.0);
75  BND3d Bnd(const double &) const;
76  Pos3d getCentroid(const double &) const;
77  Plane getRegressionPlane(const double &) const;
78 
79  Node *findNode(const int &tag);
80  const Node *findNode(const int &tag) const;
81  void numerate(void);
82 
83  void createInertiaLoads(const Vector &);
84 
85  // mass distribution
86  Matrix getTotalMass(void) const;
87  double getTotalMassComponent(const int &) const;
88  };
89 
90 DqPtrsNode operator+(const DqPtrsNode &a,const DqPtrsNode &b);
91 DqPtrsNode operator-(const DqPtrsNode &a,const DqPtrsNode &b);
92 DqPtrsNode operator*(const DqPtrsNode &a,const DqPtrsNode &b);
93 
94 } //end of XC namespace
95 #endif
96 
std::set< int > getTags(void) const
Returns the tags de los nodes.
Definition: DqPtrsNode.cc:224
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:215
Pointers to node container.
Definition: DqPtrsNode.h:53
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:192
Base class for position lists.
Definition: PolyPos.h:35
BND3d Bnd(const double &) const
Return the nodes current position boundary.
Definition: DqPtrsNode.cc:315
void numerate(void)
Set indices to the objects to allow its use in VTK.
Definition: DqPtrsNode.cc:158
Pos3d getCentroid(const double &) const
Returns the centroid of the nodes.
Definition: DqPtrsNode.cc:339
DqPtrsNode pickNodesInside(const GeomObj3d &, const double &tol=0.0)
Return a container with the nodes that lie inside the geometric object.
Definition: DqPtrsNode.cc:280
Vector of integers.
Definition: ID.h:95
Plane in a three-dimensional space.
Definition: Plane.h:49
void transforma(const TrfGeom &trf)
Applies the transformation to the elements of the set.
Definition: DqPtrsNode.cc:79
Node * findNode(const int &tag)
Returns (if it exists) a pointer to the node cuyo tag is being passed as parameter.
Definition: DqPtrsNode.cc:89
FiberSet operator+(const FiberSet &, const FiberSet &)
Return the union of both containers.
Definition: FiberSet.cc:65
DqPtrsNode & operator=(const DqPtrsNode &)
Assignment operator.
Definition: DqPtrsNode.cc:57
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:206
DqPtrsNode(CommandEntity *owr=nullptr)
Constructor.
Definition: DqPtrsNode.cc:38
size_t getNumLiveNodes(void) const
Returns the number of nodes of the set which are active.
Definition: DqPtrsNode.cc:130
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:236
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:71
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
Matrix of floats.
Definition: Matrix.h:111
void createInertiaLoads(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: DqPtrsNode.cc:170
Plane getRegressionPlane(const double &) const
Returns the regression plane from the positions of the nodes.
Definition: DqPtrsNode.cc:361
size_t getNumDeadNodes(void) const
Returns the number of nodes of the set which are inactive.
Definition: DqPtrsNode.cc:144
Mesh node.
Definition: Node.h:111
Matrix getTotalMass(void) const
Return the total mass matrix.
Definition: DqPtrsNode.cc:177
Vector en tres dimensiones.
Definition: Vector3d.h:39
DqPtrsNode & operator+=(const DqPtrsNode &)
+= operator.
Definition: DqPtrsNode.cc:64
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43