xc
Pnt.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 //Pnt.h
29 //Point entities (similar a los K points de ANSYS)
30 
31 #ifndef PNT_H
32 #define PNT_H
33 
34 #include "preprocessor/multi_block_topology/entities/EntMdlr.h"
35 #include "utility/geom/pos_vec/Pos3d.h"
36 
37 namespace XC {
38 class Edge;
39 class Face;
40 class Body;
41 class TrfGeom;
42 
46 //
50 class Pnt: public EntMdlr
51  {
52  friend class Edge;
53  private:
54  Pos3d p;
55  mutable std::set<const Edge *> lines_pt;
56  protected:
57 
58  virtual void update_topology(void);
59  void create_nodes(void);
60  public:
61  Pnt(Preprocessor *m,const Pos3d &pto= Pos3d());
62  Pnt(const std::string &name= "",Preprocessor *m= nullptr,const Pos3d &pto= Pos3d());
63  virtual bool operator==(const Pnt &) const;
64  SetEstruct *getCopy(void) const;
66  inline virtual unsigned short int GetDimension(void) const
67  { return 0; }
68  BND3d Bnd(void) const;
69  bool hasNode(void) const;
70  int getTagNode(void) const;
71  Node *getNode(void);
72  const Node *getNode(void) const;
73  const Node *setNode(Node *);
74  virtual void genMesh(meshing_dir dm= dirm_i);
75 
77  const Pos3d &getPos(void) const
78  { return p; }
80  Pos3d &Pos(void)
81  { return p; }
83  void setPos(const Pos3d &pos)
84  { p= pos; }
85  bool In(const GeomObj3d &, const double &tol= 0.0) const;
86  bool Out(const GeomObj3d &, const double &tol= 0.0) const;
87 
88  double getAverageElementSize(void) const;
89 
90  Vector3d VectorPos(void) const;
91 
92  void insert_line(Edge *l) const;
93  void erase_line(Edge *l) const;
94 
96  const size_t getNumConnectedEdges(void) const
97  { return lines_pt.size(); }
99  const std::set<const Edge *> &getConnectedEdges(void) const
100  { return lines_pt; }
101  boost::python::list getConnectedEdgesTags(void) const;
102  boost::python::list getConnectedEdgesPy(void);
103 
104  std::set<const Edge *> getEdgesThatEndOnThisPoint(void) const;
105 
106  const std::string &getConnectedEdgesNames(void) const;
107  bool isConnectedTo(const Edge &l) const;
108  bool isEndPoint(const Edge &l) const;
109  bool isConnectedTo(const Face &s) const;
110  bool isConnectedTo(const Body &b) const;
111  double getSquaredDistanceTo(const Pos3d &pt) const;
112 
113  const std::set<const Face *> getConnectedSurfaces(void) const;
114 
115  void Move(const Vector3d &);
116  void Transform(const TrfGeom &trf);
117 
118  std::set<SetBase *> get_sets(void) const;
119  void add_to_sets(std::set<SetBase *> &);
120 
121  boost::python::dict getPyDict(void) const;
122  void setPyDict(const boost::python::dict &);
123  };
124 
125 Vector &operator-(const Pnt &b,const Pnt &a);
126 const Edge *find_connected_edge_const_ptr(const Pnt &,const Pnt &);
127 const Edge *find_connected_edge_const_ptr(const Pnt &,const Pnt &,const Pnt &);
128 Edge *find_connected_edge_ptr(const Pnt &,const Pnt &);
129 Edge *find_connected_edge_ptr(const Pnt &,const Pnt &,const Pnt &);
130 
131 Edge *find_edge_ptr_by_endpoints(const Pnt &pA,const Pnt &pB);
132 Edge *find_edge_ptr_by_endpoints(const Pnt &,const Pnt &,const Pnt &);
133 const Edge *find_edge_const_ptr_by_endpoints(const Pnt &pA,const Pnt &pB);
134 const Edge *find_edge_const_ptr_by_endpoints(const Pnt &,const Pnt &,const Pnt &);
135 
136 Face *find_face_ptr_by_vertices(const Pnt &pA,const Pnt &pB,const Pnt &pC,const Pnt &pD);
137 const Face *find_face_const_ptr_by_vertices(const Pnt &pA,const Pnt &pB,const Pnt &pC,const Pnt &pD);
138 
139 } //end of XC namespace
140 
141 #endif
int getTagNode(void) const
Return node&#39;s tag.
Definition: Pnt.cc:264
const std::string & getConnectedEdgesNames(void) const
Return the names of the lines that touch the point.
Definition: Pnt.cc:169
const Edge * find_connected_edge_const_ptr(const Pnt &, const Pnt &)
Search for a line that connects the points.
Definition: Pnt.cc:381
double getSquaredDistanceTo(const Pos3d &pt) const
Return the squared distance to the position being passed as parameter.
Definition: Pnt.cc:224
bool In(const GeomObj3d &, const double &tol=0.0) const
Returns true if the point lies inside the geometric object.
Definition: Pnt.cc:229
Float vector abstraction.
Definition: Vector.h:94
void insert_line(Edge *l) const
Inserts the line being passed as parameter in the list of lines that begin or end in the point...
Definition: Pnt.cc:73
boost::python::list getConnectedEdgesPy(void)
Return the connected edges.
Definition: Pnt.cc:134
Vector3d VectorPos(void) const
Return the position vector of the point.
Definition: Pnt.cc:86
Base class for one-dimensional geometry objects.
Definition: Edge.h:48
double getAverageElementSize(void) const
Returnt the average of the elements sizes of the lines connected to the point.
Definition: Pnt.cc:99
Finite element model generation tools.
Definition: Preprocessor.h:59
bool Out(const GeomObj3d &, const double &tol=0.0) const
Returns true if the point lies outside the geometric object.
Definition: Pnt.cc:234
bool isEndPoint(const Edge &l) const
Returns true if the point is an end of the edge.
Definition: Pnt.cc:191
void Move(const Vector3d &)
Moves the point (used by XC::Set only).
Definition: Pnt.cc:359
const Pos3d & getPos(void) const
Returns the object position.
Definition: Pnt.h:77
void erase_line(Edge *l) const
Erases the line being passed as parameter in the list of lines that begin or end in the point...
Definition: Pnt.cc:78
const std::set< const Edge * > & getConnectedEdges(void) const
Return the list of the lines that begin or end at the point.
Definition: Pnt.h:99
virtual void update_topology(void)
Updates topology.
Definition: Pnt.cc:90
void create_nodes(void)
Creates nodes.
Definition: Pnt.cc:238
BND3d Bnd(void) const
Return the object BND.
Definition: Pnt.cc:94
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Pnt.cc:535
Pos3d & Pos(void)
Returns the object position.
Definition: Pnt.h:80
bool hasNode(void) const
Returns true if the point owns a node (is meshed).
Definition: Pnt.cc:255
const Edge * find_edge_const_ptr_by_endpoints(const Pnt &pA, const Pnt &pB)
Search for a line that connects the points.
Definition: Pnt.cc:465
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Pnt.cc:520
void setPos(const Pos3d &pos)
Sets the object position.
Definition: Pnt.h:83
void add_to_sets(std::set< SetBase *> &)
Adds the point to the set being passed as parameters.
Definition: Pnt.cc:348
boost::python::list getConnectedEdgesTags(void) const
Return the identifiers of the connected edges.
Definition: Pnt.cc:118
std::set< SetBase * > get_sets(void) const
Return the sets to which this point belongs.
Definition: Pnt.cc:332
const size_t getNumConnectedEdges(void) const
Return the number of connected edges.
Definition: Pnt.h:96
Edge * find_connected_edge_ptr(const Pnt &, const Pnt &)
Search for a line that connects the points.
Definition: Pnt.cc:409
virtual unsigned short int GetDimension(void) const
Return the object dimension (0, 1, 2 or 3).
Definition: Pnt.h:66
"boundary" en tres dimensiones.
Definition: BND3d.h:34
Point (KPoint).
Definition: Pnt.h:50
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:55
Geometric transformation that can be applied to the components of a set.
Definition: TrfGeom.h:48
structured set, i.
Definition: SetEstruct.h:47
const Node * setNode(Node *)
Set the point node.
Definition: Pnt.cc:301
Posición en tres dimensiones.
Definition: Pos3d.h:44
bool isConnectedTo(const Edge &l) const
Returns true if the line starts or ends in this point.
Definition: Pnt.cc:184
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
Pnt(Preprocessor *m, const Pos3d &pto=Pos3d())
Constructor.
Definition: Pnt.cc:45
Six-faced solid.
Definition: Body.h:71
Edge * find_edge_ptr_by_endpoints(const Pnt &pA, const Pnt &pB)
Search for a line that connects the points.
Definition: Pnt.cc:437
void Transform(const TrfGeom &trf)
Applies to the point the transformation being passed as parameter.
Definition: Pnt.cc:366
virtual void genMesh(meshing_dir dm=dirm_i)
Creates mesh.
Definition: Pnt.cc:249
SetEstruct * getCopy(void) const
Virtual constructor.
Definition: Pnt.cc:68
std::set< const Edge * > getEdgesThatEndOnThisPoint(void) const
Return the lines that start o finish in this point.
Definition: Pnt.cc:152
Mesh node.
Definition: Node.h:111
Node * getNode(void)
Return point&#39;s node.
Definition: Pnt.cc:279
Surface.
Definition: Face.h:45
const std::set< const Face * > getConnectedSurfaces(void) const
Returns the faces connected with the point.
Definition: Pnt.cc:211
Vector en tres dimensiones.
Definition: Vector3d.h:39
virtual bool operator==(const Pnt &) const
Comparison operator.
Definition: Pnt.cc:53
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43