XC Open source finite element analysis program
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 
43 //
45 //
49 class Pnt: public EntMdlr
50  {
51  friend class Edge;
52  private:
53  Pos3d p;
54  mutable std::set<const Edge *> lineas_pt;
55  protected:
56 
57  virtual void actualiza_topologia(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 tieneNodo(void) const;
69  int getTagNode(void) const;
70  Node *getNode(void);
71  virtual void genMesh(meshing_dir dm);
72 
74  const Pos3d &GetPos(void) const
75  { return p; }
77  Pos3d &Pos(void)
78  { return p; }
80  void setPos(const Pos3d &pos)
81  { p= pos; }
82  Vector3d VectorPos(void) const;
83 
84  void inserta_linea(Edge *l) const;
85  void borra_linea(Edge *l) const;
86 
88  const std::set<const Edge *> &EdgesTocan(void) const
89  { return lineas_pt; }
90  const size_t getNLines(void) const
91  { return EdgesTocan().size(); }
92  std::set<const Edge *> EdgesExtremo(void) const;
94  const std::string &NombresEdgesTocan(void) const;
95  bool Toca(const Edge &l) const;
96  bool Extremo(const Edge &l) const;
97  bool Toca(const Face &s) const;
98  bool Toca(const Body &b) const;
99  double DistanciaA2(const Pos3d &pt) const;
100 
101  void Mueve(const Vector3d &);
102  void Transforma(const TrfGeom &trf);
103  void Transforma(const size_t &indice_trf);
104 
105  std::set<SetBase *> get_sets(void) const;
106  void add_to_sets(std::set<SetBase *> &);
107 
108 
109  };
110 
111 Vector &operator-(const Pnt &b,const Pnt &a);
112 const Edge *busca_edge_const_ptr_toca(const Pnt &,const Pnt &);
113 const Edge *busca_edge_const_ptr_toca(const Pnt &,const Pnt &,const Pnt &);
114 Edge *busca_edge_ptr_toca(const Pnt &,const Pnt &);
115 Edge *busca_edge_ptr_toca(const Pnt &,const Pnt &,const Pnt &);
116 
117 Edge *busca_edge_ptr_extremos(const Pnt &pA,const Pnt &pB);
118 Edge *busca_edge_ptr_extremos(const Pnt &,const Pnt &,const Pnt &);
119 const Edge *busca_edge_const_ptr_extremos(const Pnt &pA,const Pnt &pB);
120 const Edge *busca_edge_const_ptr_extremos(const Pnt &,const Pnt &,const Pnt &);
121 
122 } //end of XC namespace
123 
124 #endif
const Edge * busca_edge_const_ptr_extremos(const Pnt &pA, const Pnt &pB)
Search for a line that connects the points.
Definition: Pnt.cc:339
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
Surface.
Definition: Face.h:41
std::set< const Edge * > EdgesExtremo(void) const
Returns the lines that start o finish in this point.
Definition: Pnt.cc:83
const std::string & NombresEdgesTocan(void) const
Returns the names of the surfaces that touch the line (neighbors).
Definition: Pnt.cc:100
Six-faced solid.
Definition: Body.h:64
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:53
int getTagNode(void) const
Return node&#39;s tag.
Definition: Pnt.cc:173
Definition: Vector.h:82
void inserta_linea(Edge *l) const
Definition: Pnt.cc:58
void Mueve(const Vector3d &)
Moves the point (used by XC::Set only).
Definition: Pnt.cc:224
void borra_linea(Edge *l) const
Definition: Pnt.cc:63
Mesh node.
Definition: Node.h:99
Pnt(Preprocessor *m, const Pos3d &pto=Pos3d())
Constructor.
Definition: Pnt.cc:45
void create_nodes(void)
Creates nodes.
Definition: Pnt.cc:147
Finite element model generation tools.
Definition: Preprocessor.h:58
void setPos(const Pos3d &pos)
Sets the object position.
Definition: Pnt.h:80
structured set, i. e. a set that can return a pointer a to a node or an element from its indices i...
Definition: SetEstruct.h:45
void add_to_sets(std::set< SetBase * > &)
Adds the point to the set being passed as parameters.
Definition: Pnt.cc:213
Edge * busca_edge_ptr_extremos(const Pnt &pA, const Pnt &pB)
Search for a line that connects the points.
Definition: Pnt.cc:311
Punto (KPoint).
Definition: Pnt.h:49
Definition: TrfGeom.h:49
bool tieneNodo(void) const
Returns true if the point owns a node (is meshed).
Definition: Pnt.cc:164
Pos3d & Pos(void)
Returns the object position.
Definition: Pnt.h:77
virtual void actualiza_topologia(void)
Updates topology.
Definition: Pnt.cc:75
void Transforma(const TrfGeom &trf)
Applies to the point the transformation being passed as parameter.
Definition: Pnt.cc:231
SetEstruct * getCopy(void) const
Virtual constructor.
Definition: Pnt.cc:53
Edge * busca_edge_ptr_toca(const Pnt &, const Pnt &)
Search for a line that connects the points.
Definition: Pnt.cc:283
const Pos3d & GetPos(void) const
Returns the object position.
Definition: Pnt.h:74
std::set< SetBase * > get_sets(void) const
Returns the sets a los que pertenece este punto.
Definition: Pnt.cc:197
bool Extremo(const Edge &l) const
Returns true if the point is an end of the edge.
Definition: Pnt.cc:122
virtual void genMesh(meshing_dir dm)
Creates mesh.
Definition: Pnt.cc:158
double DistanciaA2(const Pos3d &pt) const
Returns the squared distance to the position being passed as parameter.
Definition: Pnt.cc:143
================================================================================
Definition: ContinuaReprComponent.h:34
virtual unsigned short int GetDimension(void) const
Return the object dimension (0, 1, 2 or 3).
Definition: Pnt.h:65
bool Toca(const Edge &l) const
Returns true if the line starts or ends in this point.
Definition: Pnt.cc:115
const Edge * busca_edge_const_ptr_toca(const Pnt &, const Pnt &)
Search for a line that connects the points.
Definition: Pnt.cc:255
Node * getNode(void)
Return point&#39;s node.
Definition: Pnt.cc:187
BND3d Bnd(void) const
Returns the object BND.
Definition: Pnt.cc:79
const std::set< const Edge * > & EdgesTocan(void) const
Return the list of the lines that begin or end at the point.
Definition: Pnt.h:88
Vector3d VectorPos(void) const
Returns the position vector of the point.
Definition: Pnt.cc:71