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 class EdgeContainer;
43 
47 //
51 class Pnt: public EntMdlr
52  {
53  friend class Edge;
54  private:
55  Pos3d p;
56  mutable std::set<const Edge *> lines_pt;
57  protected:
58 
59  virtual void update_topology(void);
60  void create_nodes(void);
61  public:
62  Pnt(Preprocessor *m,const Pos3d &pto= Pos3d());
63  Pnt(const std::string &name= "",Preprocessor *m= nullptr,const Pos3d &pto= Pos3d());
64  virtual bool operator==(const Pnt &) const;
65  SetEstruct *getCopy(void) const;
67  inline virtual unsigned short int GetDimension(void) const
68  { return 0; }
69  BND3d Bnd(void) const;
70  bool hasNode(void) const;
71  int getTagNode(void) const;
72  Node *getNode(void);
73  const Node *getNode(void) const;
74  const Node *setNode(Node *);
75  virtual void genMesh(meshing_dir dm= dirm_i);
76 
78  const Pos3d &getPos(void) const
79  { return p; }
81  Pos3d &Pos(void)
82  { return p; }
84  void setPos(const Pos3d &pos)
85  { p= pos; }
86  bool In(const GeomObj3d &, const double &tol= 0.0) const;
87  bool Out(const GeomObj3d &, const double &tol= 0.0) const;
88 
89  double getAverageElementSize(void) const;
90 
91  Vector3d VectorPos(void) const;
92 
93  void insert_line(Edge *l) const;
94  void erase_line(Edge *l) const;
95 
97  size_t getNumConnectedEdges(void) const
98  { return lines_pt.size(); }
100  const std::set<const Edge *> &getConnectedEdges(void) const
101  { return lines_pt; }
102  boost::python::list getConnectedEdgesTags(void) const;
103  boost::python::list getConnectedEdgesPy(void) const;
104  size_t getNumConnectedEdges(const SetBase *) const;
105  std::set<const Edge *> getConnectedEdges(const SetBase *) const;
106  boost::python::list getConnectedEdgesPy(const SetBase *) const;
107 
108  std::set<const Edge *> getEdgesThatEndOnThisPoint(void) const;
109 
110  const std::string &getConnectedEdgesNames(void) const;
111  bool isConnectedTo(const Edge &l) const;
112  bool isEndPoint(const Edge &l) const;
113  bool isConnectedTo(const Face &s) const;
114  bool isConnectedTo(const Body &b) const;
115  double getSquaredDistanceTo(const Pos3d &pt) const;
116 
117  std::set<const Face *> getConnectedSurfaces(void) const;
118  boost::python::list getConnectedSurfacesPy(void) const;
119  std::set<const Face *> getConnectedSurfaces(const SetBase *) const;
120  boost::python::list getConnectedSurfacesPy(const SetBase *) const;
121 
122  const Edge *next(const EdgeContainer &, const std::set<const Edge *> &) const;
123 
124  void Move(const Vector3d &);
125  void Transform(const TrfGeom &trf);
126 
127  std::set<SetBase *> get_sets(void) const;
128  void add_to_sets(std::set<SetBase *> &);
129 
130  boost::python::dict getPyDict(void) const;
131  void setPyDict(const boost::python::dict &);
132  };
133 
134 Vector &operator-(const Pnt &b,const Pnt &a);
135 const Edge *find_connected_edge_const_ptr(const Pnt &,const Pnt &);
136 const Edge *find_connected_edge_const_ptr(const Pnt &,const Pnt &,const Pnt &);
137 Edge *find_connected_edge_ptr(const Pnt &,const Pnt &);
138 Edge *find_connected_edge_ptr(const Pnt &,const Pnt &,const Pnt &);
139 
140 Edge *find_edge_ptr_by_endpoints(const Pnt &pA,const Pnt &pB);
141 Edge *find_edge_ptr_by_endpoints(const Pnt &,const Pnt &,const Pnt &);
142 const Edge *find_edge_const_ptr_by_endpoints(const Pnt &pA,const Pnt &pB);
143 const Edge *find_edge_const_ptr_by_endpoints(const Pnt &,const Pnt &,const Pnt &);
144 
145 Face *find_face_ptr_by_vertices(const Pnt &pA,const Pnt &pB,const Pnt &pC,const Pnt &pD);
146 const Face *find_face_const_ptr_by_vertices(const Pnt &pA,const Pnt &pB,const Pnt &pC,const Pnt &pD);
147 
148 } //end of XC namespace
149 
150 #endif
int getTagNode(void) const
Return node&#39;s tag.
Definition: Pnt.cc:401
const std::string & getConnectedEdgesNames(void) const
Return the names of the lines that touch the point.
Definition: Pnt.cc:235
const Edge * find_connected_edge_const_ptr(const Pnt &, const Pnt &)
Search for a line that connects the points.
Definition: Pnt.cc:518
double getSquaredDistanceTo(const Pos3d &pt) const
Return the squared distance to the position being passed as parameter.
Definition: Pnt.cc:361
bool In(const GeomObj3d &, const double &tol=0.0) const
Returns true if the point lies inside the geometric object.
Definition: Pnt.cc:366
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:74
Vector3d VectorPos(void) const
Return the position vector of the point.
Definition: Pnt.cc:87
boost::python::list getConnectedEdgesPy(void) const
Return the connected edges.
Definition: Pnt.cc:135
Base class for one-dimensional geometry objects.
Definition: Edge.h:49
double getAverageElementSize(void) const
Returnt the average of the elements sizes of the lines connected to the point.
Definition: Pnt.cc:100
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:371
bool isEndPoint(const Edge &l) const
Returns true if the point is an end of the edge.
Definition: Pnt.cc:257
void Move(const Vector3d &)
Moves the point (used by XC::Set only).
Definition: Pnt.cc:496
const Pos3d & getPos(void) const
Returns the object position.
Definition: Pnt.h:78
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:79
Edge container.
Definition: EdgeContainer.h:40
const std::set< const Edge * > & getConnectedEdges(void) const
Return the list of the lines that begin or end at the point.
Definition: Pnt.h:100
virtual void update_topology(void)
Updates topology.
Definition: Pnt.cc:91
void create_nodes(void)
Creates nodes.
Definition: Pnt.cc:375
BND3d Bnd(void) const
Return the object BND.
Definition: Pnt.cc:95
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Pnt.cc:672
Pos3d & Pos(void)
Returns the object position.
Definition: Pnt.h:81
bool hasNode(void) const
Returns true if the point owns a node (is meshed).
Definition: Pnt.cc:392
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:602
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Pnt.cc:657
Base de las clases Set y SetEstruct.
Definition: SetBase.h:51
std::set< const Face * > getConnectedSurfaces(void) const
Returns the faces connected with this point (neighbors).
Definition: Pnt.cc:277
void setPos(const Pos3d &pos)
Sets the object position.
Definition: Pnt.h:84
void add_to_sets(std::set< SetBase *> &)
Adds the point to the set being passed as parameters.
Definition: Pnt.cc:485
boost::python::list getConnectedEdgesTags(void) const
Return the identifiers of the connected edges.
Definition: Pnt.cc:119
boost::python::list getConnectedSurfacesPy(void) const
Return the surfaces that touch this point (neighbors).
Definition: Pnt.cc:289
std::set< SetBase * > get_sets(void) const
Return the sets to which this point belongs.
Definition: Pnt.cc:469
Edge * find_connected_edge_ptr(const Pnt &, const Pnt &)
Search for a line that connects the points.
Definition: Pnt.cc:546
virtual unsigned short int GetDimension(void) const
Return the object dimension (0, 1, 2 or 3).
Definition: Pnt.h:67
"boundary" en tres dimensiones.
Definition: BND3d.h:34
Point (KPoint).
Definition: Pnt.h:51
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:55
const Edge * next(const EdgeContainer &, const std::set< const Edge *> &) const
Returns an edge that has its origin in this point (and is not in visited).
Definition: Pnt.cc:342
Geometric transformation that can be applied to the components of a set.
Definition: TrfGeom.h:48
structured set, i.
Definition: SetEstruct.h:48
const Node * setNode(Node *)
Set the point node.
Definition: Pnt.cc:438
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:250
size_t getNumConnectedEdges(void) const
Return the number of connected edges.
Definition: Pnt.h:97
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:46
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:574
void Transform(const TrfGeom &trf)
Applies to the point the transformation being passed as parameter.
Definition: Pnt.cc:503
virtual void genMesh(meshing_dir dm=dirm_i)
Creates mesh.
Definition: Pnt.cc:386
SetEstruct * getCopy(void) const
Virtual constructor.
Definition: Pnt.cc:69
std::set< const Edge * > getEdgesThatEndOnThisPoint(void) const
Return the lines that start o finish in this point.
Definition: Pnt.cc:153
Mesh node.
Definition: Node.h:112
Node * getNode(void)
Return point&#39;s node.
Definition: Pnt.cc:416
Surface.
Definition: Face.h:45
Vector en tres dimensiones.
Definition: Vector3d.h:39
virtual bool operator==(const Pnt &) const
Comparison operator.
Definition: Pnt.cc:54
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43