xc
Pnt.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 //Pnt.h
28 //Point entities (similar a los K points de ANSYS)
29 
30 #ifndef PNT_H
31 #define PNT_H
32 
33 #include "EntMdlr.h"
34 #include "xc_utils/src/geom/pos_vec/Pos3d.h"
35 
36 namespace XC {
37 class Edge;
38 class Face;
39 class Body;
40 class TrfGeom;
41 
45 //
49 class Pnt: public EntMdlr
50  {
51  friend class Edge;
52  private:
53  Pos3d p;
54  mutable std::set<const Edge *> lines_pt;
55  protected:
56 
57  virtual void update_topology(void);
58  void create_nodes(void);
59  public:
60  Pnt(Preprocessor *m,const Pos3d &pto= Pos3d());
61  Pnt(const std::string &nombre= "",Preprocessor *m= nullptr,const Pos3d &pto= Pos3d());
62 
63  SetEstruct *getCopy(void) const;
65  inline virtual unsigned short int GetDimension(void) const
66  { return 0; }
67  BND3d Bnd(void) const;
68  bool hasNode(void) const;
69  int getTagNode(void) const;
70  Node *getNode(void);
71  const Node *getNode(void) const;
72  virtual void genMesh(meshing_dir dm);
73 
75  const Pos3d &GetPos(void) const
76  { return p; }
78  Pos3d &Pos(void)
79  { return p; }
81  void setPos(const Pos3d &pos)
82  { p= pos; }
83  bool In(const GeomObj3d &, const double &tol= 0.0) const;
84  bool Out(const GeomObj3d &, const double &tol= 0.0) const;
85 
86  Vector3d VectorPos(void) const;
87 
88  void insert_line(Edge *l) const;
89  void erase_line(Edge *l) const;
90 
92  const std::set<const Edge *> &getConnectedEdges(void) const
93  { return lines_pt; }
94  const size_t getNLines(void) const
95  { return getConnectedEdges().size(); }
96  std::set<const Edge *> EdgesExtremo(void) const;
97 
98  const std::string &getConnectedEdgesNames(void) const;
99  bool isConnectedTo(const Edge &l) const;
100  bool Extremo(const Edge &l) const;
101  bool isConnectedTo(const Face &s) const;
102  bool isConnectedTo(const Body &b) const;
103  double getSquaredDistanceTo(const Pos3d &pt) const;
104 
105  void Mueve(const Vector3d &);
106  void Transforma(const TrfGeom &trf);
107  void Transforma(const size_t &indice_trf);
108 
109  std::set<SetBase *> get_sets(void) const;
110  void add_to_sets(std::set<SetBase *> &);
111 
112 
113  };
114 
115 Vector &operator-(const Pnt &b,const Pnt &a);
116 const Edge *find_connected_edge_const_ptr(const Pnt &,const Pnt &);
117 const Edge *find_connected_edge_const_ptr(const Pnt &,const Pnt &,const Pnt &);
118 Edge *find_connected_edge_ptr(const Pnt &,const Pnt &);
119 Edge *find_connected_edge_ptr(const Pnt &,const Pnt &,const Pnt &);
120 
121 Edge *busca_edge_ptr_extremos(const Pnt &pA,const Pnt &pB);
122 Edge *busca_edge_ptr_extremos(const Pnt &,const Pnt &,const Pnt &);
123 const Edge *busca_edge_const_ptr_extremos(const Pnt &pA,const Pnt &pB);
124 const Edge *busca_edge_const_ptr_extremos(const Pnt &,const Pnt &,const Pnt &);
125 
126 } //end of XC namespace
127 
128 #endif
int getTagNode(void) const
Return node&#39;s tag.
Definition: Pnt.cc:183
const std::string & getConnectedEdgesNames(void) const
Return the names of the lines that touch the point.
Definition: Pnt.cc:100
const Edge * find_connected_edge_const_ptr(const Pnt &, const Pnt &)
Search for a line that connects the points.
Definition: Pnt.cc:278
void Transforma(const TrfGeom &trf)
Applies to the point the transformation being passed as parameter.
Definition: Pnt.cc:254
double getSquaredDistanceTo(const Pos3d &pt) const
Return the squared distance to the position being passed as parameter.
Definition: Pnt.cc:143
bool In(const GeomObj3d &, const double &tol=0.0) const
Returns true if the point lies inside the geometric object.
Definition: Pnt.cc:148
Float vector abstraction.
Definition: Vector.h:93
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:58
Vector3d VectorPos(void) const
Return the position vector of the point.
Definition: Pnt.cc:71
std::set< const Edge * > EdgesExtremo(void) const
Return the lines that start o finish in this point.
Definition: Pnt.cc:83
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
bool Extremo(const Edge &l) const
Returns true if the point is an end of the edge.
Definition: Pnt.cc:122
void Mueve(const Vector3d &)
Moves the point (used by XC::Set only).
Definition: Pnt.cc:247
Finite element model generation tools.
Definition: Preprocessor.h:58
bool Out(const GeomObj3d &, const double &tol=0.0) const
Returns true if the point lies outside the geometric object.
Definition: Pnt.cc:153
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:63
const std::set< const Edge * > & getConnectedEdges(void) const
Return the list of the lines that begin or end at the point.
Definition: Pnt.h:92
virtual void update_topology(void)
Updates topology.
Definition: Pnt.cc:75
void create_nodes(void)
Creates nodes.
Definition: Pnt.cc:157
BND3d Bnd(void) const
Return the object BND.
Definition: Pnt.cc:79
Pos3d & Pos(void)
Returns the object position.
Definition: Pnt.h:78
bool hasNode(void) const
Returns true if the point owns a node (is meshed).
Definition: Pnt.cc:174
const Pos3d & GetPos(void) const
Returns the object position.
Definition: Pnt.h:75
void setPos(const Pos3d &pos)
Sets the object position.
Definition: Pnt.h:81
void add_to_sets(std::set< SetBase *> &)
Adds the point to the set being passed as parameters.
Definition: Pnt.cc:236
std::set< SetBase * > get_sets(void) const
Return the sets to which this point belongs.
Definition: Pnt.cc:220
Edge * find_connected_edge_ptr(const Pnt &, const Pnt &)
Search for a line that connects the points.
Definition: Pnt.cc:306
const Edge * busca_edge_const_ptr_extremos(const Pnt &pA, const Pnt &pB)
Search for a line that connects the points.
Definition: Pnt.cc:362
virtual unsigned short int GetDimension(void) const
Return the object dimension (0, 1, 2 or 3).
Definition: Pnt.h:65
Point (KPoint).
Definition: Pnt.h:49
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:54
Geometric transformation that can be applied to the components of a set.
Definition: TrfGeom.h:49
structured set, i.
Definition: SetEstruct.h:45
bool isConnectedTo(const Edge &l) const
Returns true if the line starts or ends in this point.
Definition: Pnt.cc:115
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
Pnt(Preprocessor *m, const Pos3d &pto=Pos3d())
Constructor.
Definition: Pnt.cc:45
Six-faced solid.
Definition: Body.h:64
Edge * busca_edge_ptr_extremos(const Pnt &pA, const Pnt &pB)
Search for a line that connects the points.
Definition: Pnt.cc:334
virtual void genMesh(meshing_dir dm)
Creates mesh.
Definition: Pnt.cc:168
SetEstruct * getCopy(void) const
Virtual constructor.
Definition: Pnt.cc:53
Mesh node.
Definition: Node.h:110
Node * getNode(void)
Return point&#39;s node.
Definition: Pnt.cc:198
Surface.
Definition: Face.h:41