xc
Edge.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 //Edge.h
28 
29 #ifndef EDGE_H
30 #define EDGE_H
31 
32 #include "EntMdlr.h"
33 
34 
35 class BND3d;
36 class Pos3dArray;
37 
38 namespace XC {
39 class Pnt;
40 class Face;
41 class Body;
42 
46 class Edge: public EntMdlr
47  {
48  friend class CmbEdge;
49  friend class Face;
50  private:
51  size_t ndiv;
52  std::set<const Face *> surfaces_line;
53  protected:
54 
55  void insert_surf(Face *s);
56 
57  virtual Pnt *P1(void);
58  virtual Pnt *P2(void);
59  void create_nodes_en_extremos(void);
60  public:
61  Edge(Preprocessor *m,const size_t &nd= 4);
62  Edge(const std::string &nombre= "",Preprocessor *m= nullptr,const size_t &nd= 4);
64  inline virtual unsigned short int GetDimension(void) const
65  { return 1; }
66 
67  virtual const Pnt *P1(void) const;
68  virtual const Pnt *P2(void) const;
69  bool In(const GeomObj3d &, const double &tol= 0.0) const;
70  bool Out(const GeomObj3d &, const double &tol= 0.0) const;
71  bool ExtremosEn(const Pnt *,const Pnt *) const;
73  virtual size_t getNumberOfVertices(void) const= 0;
74 
75  virtual double getLength(void) const= 0;
76 
77  virtual const Pnt *getVertex(const size_t &i) const= 0;
78  virtual void SetVertice(const size_t &,Pnt *)= 0;
79  std::vector<int> getIndicesVertices(void) const;
80  virtual ID getKPoints(void) const;
81 
82  virtual void SetNDiv(const size_t &);
83  inline virtual size_t NDiv(void) const
84  { return ndiv; }
85  void SetElemSize(const double &sz);
86  std::set<const XC::Edge *> getHomologousSides(const std::set<const XC::Edge *> &) const;
87  void update_topology(void);
88 
90  const std::set<const Face *> &getConnectedSurfaces(void) const
91  { return surfaces_line; }
93  const std::string &getConnectedSurfacesNames(void) const;
94  bool isConnectedTo(const Face &s) const;
95  bool isConnectedTo(const Body &b) const;
96  bool Extremo(const Pnt &) const;
97  virtual BND3d Bnd(void) const= 0;
98  virtual void create_nodes(void);
99  virtual void genMesh(meshing_dir dm);
100 
101  virtual Pos3dArray get_positions(void) const= 0;
102  virtual Pos3dArray get_nodes_pos(void) const;
103 
104  virtual Node *getNode(const size_t &i1,const size_t &j,const size_t &k=1);
105  virtual const Node *getNode(const size_t &i,const size_t &j,const size_t &k=1) const;
106  virtual Node *getNode(const size_t &i);
107  virtual const Node *getNode(const size_t &i) const;
108  Node *getNodeForward(const size_t &i);
109  const Node *getNodeForward(const size_t &i) const;
110  Node *getNodeReverse(const size_t &i);
111  const Node *getNodeReverse(const size_t &i) const;
112  Node *getFirstNode(void);
113  const Node *getFirstNode(void) const;
114  Node *getLastNode(void);
115  const Node *getLastNode(void) const;
116 
117  std::vector<int> getTagsNodesForward(void) const;
118  std::vector<int> getTagsNodesReverse(void) const;
119  Pos3dArray getNodePosForward(void) const;
120  Pos3dArray getNodePosReverse(void) const;
121 
122  std::set<SetBase *> get_sets(void) const;
123  void add_to_sets(std::set<SetBase *> &);
124 
125  virtual const Vector &getTang(const double &) const;
126  void divide(void);
127 
128  };
129 
130 std::set<const Edge *> getConnectedLines(const Pnt &p);
131 size_t calcula_ndiv_lados(const std::set<const XC::Edge *> &);
132 
133 } //end of XC namespace
134 #endif
Float vector abstraction.
Definition: Vector.h:93
void insert_surf(Face *s)
Insert a surface in contact with the line (neighbour).
Definition: Edge.cc:58
Node * getNodeReverse(const size_t &i)
Return the node whose ordinal index is passed as parameter, starting from the end.
Definition: Edge.cc:264
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
virtual Pnt * P1(void)
Return a pointer to the edge&#39;s start point.
Definition: Edge.cc:69
bool In(const GeomObj3d &, const double &tol=0.0) const
Returns true if the line lies inside the geometric object.
Definition: Edge.cc:126
bool Extremo(const Pnt &) const
Return true if it is an end point of the line.
Definition: Edge.cc:442
std::vector< int > getIndicesVertices(void) const
Return indices of the vertices.
Definition: Edge.cc:591
void create_nodes_en_extremos(void)
Create the nodes for both end points of the edge.
Definition: Edge.cc:454
virtual Node * getNode(const size_t &i1, const size_t &j, const size_t &k=1)
Return a pointer to node whose indices are passed as parameters.
Definition: Edge.cc:223
Finite element model generation tools.
Definition: Preprocessor.h:58
virtual void genMesh(meshing_dir dm)
Trigger mesh generation.
Definition: Edge.cc:545
std::set< SetBase * > get_sets(void) const
Return the sets to wich this edge belongs.
Definition: Edge.cc:565
bool isConnectedTo(const Face &s) const
Return true if the line touches the surface (neighbor).
Definition: Edge.cc:427
Vector of integers.
Definition: ID.h:93
bool ExtremosEn(const Pnt *, const Pnt *) const
Returns true if the points passed as parameters are the ends of the edge.
Definition: Edge.cc:109
Edge(Preprocessor *m, const size_t &nd=4)
Constructor.
Definition: Edge.cc:46
void SetElemSize(const double &sz)
Compute the number of divisions necessary to get the element size passed as parameter.
Definition: Edge.cc:204
std::vector< int > getTagsNodesForward(void) const
Return the IDs of the nodes in forward order.
Definition: Edge.cc:327
Node * getLastNode(void)
Return the last node of the line.
Definition: Edge.cc:314
void divide(void)
Create points along the line.
Definition: Edge.cc:212
virtual void create_nodes(void)
Create nodes on objects.
Definition: Edge.cc:492
void update_topology(void)
Update topology.
Definition: Edge.cc:62
Pos3dArray getNodePosReverse(void) const
Return the positions of the nodes in reverse order.
Definition: Edge.cc:357
std::set< const XC::Edge * > getHomologousSides(const std::set< const XC::Edge *> &) const
Return the homologous sides to that passed as a parameter.
Definition: Edge.cc:383
Pos3dArray getNodePosForward(void) const
Return the positions of the nodes in forward order.
Definition: Edge.cc:347
Compound line.
Definition: CmbEdge.h:42
const std::string & getConnectedSurfacesNames(void) const
Return the surface names that touch the line.
Definition: Edge.cc:367
const std::set< const Face * > & getConnectedSurfaces(void) const
Return the surfaces that touch the line.
Definition: Edge.h:90
Point (KPoint).
Definition: Pnt.h:49
virtual unsigned short int GetDimension(void) const
Return the object dimension (0, 1, 2 or 3).
Definition: Edge.h:64
virtual const Vector & getTang(const double &) const
Return a vector tangent to the line in point at parameter s.
Definition: Edge.cc:556
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:54
std::set< const Axis * > getConnectedLines(const Spot &p)
Return the set of lines that touch the point being passed as parameter.
Definition: Axis.cc:97
bool Out(const GeomObj3d &, const double &tol=0.0) const
Returns true if the line lies outside the geometric object.
Definition: Edge.cc:149
Node * getFirstNode(void)
Return the first node of the line.
Definition: Edge.cc:288
size_t calcula_ndiv_lados(const std::set< const XC::Edge *> &)
Compute the number of divisions for each line to make it compatible with adjacent surface meshing...
Definition: Edge.cc:418
virtual size_t getNumberOfVertices(void) const =0
Return the number of vertices.
virtual ID getKPoints(void) const
Return k-points.
Definition: Edge.cc:604
virtual void SetNDiv(const size_t &)
Assigns the number of of divisions.
Definition: Edge.cc:170
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
void add_to_sets(std::set< SetBase *> &)
Add the «edge» to the sets passed as parameters.
Definition: Edge.cc:581
Six-faced solid.
Definition: Body.h:64
Mesh node.
Definition: Node.h:110
std::vector< int > getTagsNodesReverse(void) const
Return the IDs of the nodes in reverse order.
Definition: Edge.cc:337
Surface.
Definition: Face.h:41
Node * getNodeForward(const size_t &i)
Returns the node whose ordinal index is passed as parameter, starting from the beginning.
Definition: Edge.cc:250
virtual Pnt * P2(void)
Return a pointer to the edge&#39;s start point.
Definition: Edge.cc:87
virtual Pos3dArray get_nodes_pos(void) const
Return a matrix of positions along the line.
Definition: Edge.cc:450