XC Open source finite element analysis program
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 MatrizPos3d;
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 *> sups_linea;
53  protected:
54 
55  void inserta_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 ExtremosEn(const Pnt *,const Pnt *) const;
71  virtual size_t NumVertices(void) const= 0;
72 
73  virtual double getLongitud(void) const= 0;
74 
75  virtual const Pnt *GetVertice(const size_t &i) const= 0;
76  virtual void SetVertice(const size_t &,Pnt *)= 0;
77  std::vector<int> getIndicesVertices(void) const;
78  virtual ID getKPoints(void) const;
79 
80  virtual void SetNDiv(const size_t &);
81  inline virtual size_t NDiv(void) const
82  { return ndiv; }
83  void SetElemSize(const double &sz);
84  std::set<const XC::Edge *> GetLadosHomologos(const std::set<const XC::Edge *> &) const;
85  void actualiza_topologia(void);
86 
88  const std::set<const Face *> &SupsTocan(void) const
89  { return sups_linea; }
91  const std::string &NombresSupsTocan(void) const;
92  bool Toca(const Face &s) const;
93  bool Toca(const Body &b) const;
94  bool Extremo(const Pnt &) const;
95  virtual BND3d Bnd(void) const= 0;
96  virtual void create_nodes(void);
97  virtual void genMesh(meshing_dir dm);
98 
99  virtual MatrizPos3d get_posiciones(void) const= 0;
100  virtual MatrizPos3d get_pos_nodes(void) const;
101 
102  virtual Node *GetNodo(const size_t &i1,const size_t &j,const size_t &k=1);
103  virtual const Node *GetNodo(const size_t &i,const size_t &j,const size_t &k=1) const;
104  virtual Node *GetNodo(const size_t &i);
105  virtual const Node *GetNodo(const size_t &i) const;
106  Node *GetNodoDir(const size_t &i);
107  const Node *GetNodoDir(const size_t &i) const;
108  Node *GetNodoInv(const size_t &i);
109  const Node *GetNodoInv(const size_t &i) const;
110  Node *GetPrimerNodo(void);
111  const Node *GetPrimerNodo(void) const;
112  Node *GetUltimoNodo(void);
113  const Node *GetUltimoNodo(void) const;
114 
115  std::vector<int> GetTagsNodosDir(void) const;
116  std::vector<int> GetTagsNodosInv(void) const;
117  MatrizPos3d GetPosNodosDir(void) const;
118  MatrizPos3d GetPosNodosInv(void) const;
119 
120  std::set<SetBase *> get_sets(void) const;
121  void add_to_sets(std::set<SetBase *> &);
122 
123  virtual const Vector &getTang(const double &) const;
124  void divide(void);
125 
126  };
127 
128 std::set<const Edge *> GetLineasTocan(const Pnt &p);
129 size_t calcula_ndiv_lados(const std::set<const XC::Edge *> &);
130 
131 } //end of XC namespace
132 #endif
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
Surface.
Definition: Face.h:41
Six-faced solid.
Definition: Body.h:64
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:53
void add_to_sets(std::set< SetBase * > &)
Add the «edge» to the sets passed as parameters.
Definition: Edge.cc:488
const std::set< const Face * > & SupsTocan(void) const
Return the surfaces that touch the line.
Definition: Edge.h:88
virtual MatrizPos3d get_pos_nodes(void) const
Return a matrix of positions along the line.
Definition: Edge.cc:364
void divide(void)
Create points along the line.
Definition: Edge.cc:150
virtual void genMesh(meshing_dir dm)
Trigger mesh generation.
Definition: Edge.cc:453
Definition: Vector.h:82
std::set< SetBase * > get_sets(void) const
Return the sets to wich this edge belongs.
Definition: Edge.cc:472
bool Toca(const Face &s) const
Return true if the line touches the surface (neighbor).
Definition: Edge.cc:341
void inserta_surf(Face *s)
Insert a surface in contact with the line (neighbour).
Definition: Edge.cc:56
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:332
MatrizPos3d GetPosNodosDir(void) const
Return the positions of the nodes in forward order.
Definition: Edge.cc:261
Mesh node.
Definition: Node.h:99
std::set< const Eje * > GetLineasTocan(const Spot &p)
Returns the set of lines that touch the point being passed as parameter.
Definition: Eje.cc:92
MatrizPos3d GetPosNodosInv(void) const
Return the positions of the nodes in reverse order.
Definition: Edge.cc:271
virtual const Vector & getTang(const double &) const
Return a vector tangent to the line in point at parameter s.
Definition: Edge.cc:464
virtual Pnt * P2(void)
Return a pointer to the edge&#39;s start point.
Definition: Edge.cc:83
const std::string & NombresSupsTocan(void) const
Return the surface names that touch the line.
Definition: Edge.cc:281
bool Extremo(const Pnt &) const
Return true if it is an end point of the line.
Definition: Edge.cc:356
Finite element model generation tools.
Definition: Preprocessor.h:58
Definition: ID.h:77
Node * GetNodoDir(const size_t &i)
Returns the node whose ordinal index is passed as parameter, starting from the beginning.
Definition: Edge.cc:173
Punto (KPoint).
Definition: Pnt.h:49
Edge(Preprocessor *m, const size_t &nd=4)
Constructor.
Definition: Edge.cc:45
Node * GetPrimerNodo(void)
Return the first node of the line.
Definition: Edge.cc:202
Node * GetNodoInv(const size_t &i)
Return the node whose ordinal index is passed as parameter, starting from the end.
Definition: Edge.cc:181
Node * GetUltimoNodo(void)
Return the last node of the line.
Definition: Edge.cc:228
virtual void create_nodes(void)
Create nodes on objects.
Definition: Edge.cc:406
std::set< const XC::Edge * > GetLadosHomologos(const std::set< const XC::Edge * > &) const
Return the homologous sides to that passed as a parameter.
Definition: Edge.cc:297
std::vector< int > GetTagsNodosDir(void) const
Return the IDs of the nodes in forward order.
Definition: Edge.cc:241
virtual size_t NumVertices(void) const =0
Return the number of vertices.
void SetElemSize(const double &sz)
Compute the number of divisions necessary to get the element size passed as parameter.
Definition: Edge.cc:142
virtual Pnt * P1(void)
Return a pointer to the edge&#39;s start point.
Definition: Edge.cc:67
std::vector< int > GetTagsNodosInv(void) const
Return the IDs of the nodes in reverse order.
Definition: Edge.cc:251
void create_nodes_en_extremos(void)
Create the nodes for both end points of the edge.
Definition: Edge.cc:368
Compound line.
Definition: CmbEdge.h:42
bool ExtremosEn(const Pnt *, const Pnt *) const
Returns true if the points passed as parameters are the ends of the edge.
Definition: Edge.cc:100
virtual Node * GetNodo(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:157
void actualiza_topologia(void)
Update topology.
Definition: Edge.cc:60
================================================================================
Definition: ContinuaReprComponent.h:34
virtual unsigned short int GetDimension(void) const
Return the object dimension (0, 1, 2 or 3).
Definition: Edge.h:64
virtual void SetNDiv(const size_t &)
Assigns the number of of divisions.
Definition: Edge.cc:113
std::vector< int > getIndicesVertices(void) const
Return indices of the vertices.
Definition: Edge.cc:498
virtual ID getKPoints(void) const
Return k-points.
Definition: Edge.cc:511