XC Open source finite element analysis program
CmbEdge.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 //CmbEdge.h
28 //Compound line.
29 
30 #ifndef CMBEDGE_H
31 #define CMBEDGE_H
32 
33 #include <deque>
34 #include "Edge.h"
35 
36 class Polilinea3d;
37 
38 namespace XC {
42 class CmbEdge: public Edge
43  {
44 
45  public:
46 
57  class Lado: public EntCmd
58  {
59  Edge *edge;
60  bool directo;
61  protected:
62 
63  public:
64  Lado(Edge *ptr= nullptr,const bool &s=true);
65  Edge *Borde(void);
66  const Edge *Borde(void) const;
67  void SetEdge(Edge *l);
68  const Pnt *P1(void) const;
69  const Pnt *P2(void) const;
70  bool ExtremosEn(const Pnt *,const Pnt *) const;
71  const std::string &GetNombre(void) const;
72  inline bool esDirecto(void) const
73  { return directo; }
74  inline void reverse(void)
75  { directo= !directo; }
76  void SetNDiv(const size_t &nd);
77  size_t NDiv(void) const;
78  size_t GetTag(void) const;
79  MatrizPos3d get_posiciones(void) const;
80  std::vector<int> GetTagsNodosDir(void) const;
81  std::vector<int> GetTagsNodosInv(void) const;
82  MatrizPos3d GetPosNodosDir(void) const;
83  MatrizPos3d GetPosNodosInv(void) const;
84  double getLongitud(void) const;
85  const Vector &getTang(const double &) const;
86  Node *GetNodoDir(const size_t &i);
87  Node *GetNodoInv(const size_t &i);
88  Node *GetNodo(const size_t &i);
89  const Node *GetNodo(const size_t &i) const;
90  void genMesh(meshing_dir dm);
91  friend bool operator==(const Lado &il1,const Lado &il2);
92 
93  };
94  protected:
95  std::deque<Lado> lineas;
96  MatrizPos3d get_posiciones(void) const;
97 
98  Lado *primera_linea(void);
99  const Lado *primera_linea(void) const;
100  Lado *ultima_linea(void);
101  const Lado *ultima_linea(void) const;
102 
103 
104  const Pnt *first_point(void) const;
105  const Pnt *last_point(void) const;
106 
107  protected:
108 
109  void create_nodes_lineas(void);
110  void line_meshing(meshing_dir dm);
111  Pnt *P1(void);
112  Pnt *P2(void);
113  void cierra(void);
114  public:
115  CmbEdge(void);
116  CmbEdge(Preprocessor *m,const size_t &nd= 4);
117  CmbEdge(const std::string &nombre,Preprocessor *m,const size_t &nd);
118  virtual SetEstruct *getCopy(void) const;
119  virtual void inserta(Edge *l);
120  void inserta(const size_t &i);
121  Edge *NuevaLinea(Pnt *,Pnt *);
122  Edge *NuevaLinea(Pnt *,Pnt *,Pnt *);
123  void addPoints(const ID &);
124  void addLines(const ID &);
125  size_t NDiv(void) const;
126  void SetNDiv(const size_t &nd);
127 
129  size_t NumEdges(void) const
130  { return lineas.size(); }
131  inline std::deque<Lado> &getLados(void)
132  { return lineas; }
133  void reverse(void);
134 
135  double getLongitud(void) const;
136 
138  virtual size_t NumVertices(void) const
139  { return NumEdges()+1; }
140 
141  const Pnt *P1(void) const;
142  const Pnt *P2(void) const;
143 
144  size_t IndiceEdge(const Edge *l) const;
145  const Lado *GetLado(const size_t &i) const;
146  Lado *GetLado(const size_t &i);
147  const Lado *GetLadoPorPuntos(const Pnt *,const Pnt *) const;
148  Lado *GetLadoPorPuntos(const Pnt *,const Pnt *);
149  const Lado *GetLadoPorPuntos(const size_t &,const size_t &) const;
150  Lado *GetLadoPorPuntos(const size_t &,const size_t &);
151  std::deque<Edge *> GetEdges(void);
152  virtual const Pnt *GetVertice(const size_t &i) const;
153  virtual void SetVertice(const size_t &,Pnt *);
154  virtual ID getKPoints(void) const;
155  Polilinea3d getPolyline(void) const;
156 
157  BND3d Bnd(void) const;
158  void genMesh(meshing_dir dm);
159 
160  friend bool operator==(const Lado &il1,const Lado &il2);
161 
162 
163  };
164 
165 bool operator==(const CmbEdge::Lado &il1,const CmbEdge::Lado &il2);
166 
167 } //end of XC namespace
168 
169 #endif
void create_nodes_lineas(void)
Triggers node creation on the edges.
Definition: CmbEdge.cc:377
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
const Pnt * P2(void) const
Returns a constant pointer to point destino of the line.
Definition: CmbEdge.cc:65
std::deque< Lado > lineas
Lines that compose the object.
Definition: CmbEdge.h:95
void addLines(const ID &)
Creates and inserts the edges from the indexes being passed as parameter.
Definition: CmbEdge.cc:419
const std::string & GetNombre(void) const
Returns the nombre of the line.
Definition: CmbEdge.cc:92
virtual const Pnt * GetVertice(const size_t &i) const
Returns the i-th vertex.
Definition: CmbEdge.cc:633
Definition: Vector.h:82
Node * GetNodo(const size_t &i)
Returns the nodo which index is being passed as parameter.
Definition: CmbEdge.cc:172
Lado(Edge *ptr=nullptr, const bool &s=true)
Constructor.
Definition: CmbEdge.cc:43
virtual size_t NumVertices(void) const
Return the number of vertices.
Definition: CmbEdge.h:138
MatrizPos3d GetPosNodosInv(void) const
Returns the posiciones of the nodes en sentido inverso.
Definition: CmbEdge.cc:139
void SetNDiv(const size_t &nd)
Asigna el number of divisions of the line.
Definition: CmbEdge.cc:204
std::vector< int > GetTagsNodosDir(void) const
Returns the identificadores of the nodes en sentido directo.
Definition: CmbEdge.cc:113
size_t IndiceEdge(const Edge *l) const
Searchs the line l from those of this compound line.
Definition: CmbEdge.cc:556
size_t GetTag(void) const
Returns the identificador of the line.
Definition: CmbEdge.cc:212
Mesh node.
Definition: Node.h:99
const Pnt * P1(void) const
Returns a constant pointer to point origen of the line.
Definition: CmbEdge.cc:56
Component of a compound line.
Definition: CmbEdge.h:57
const Lado * GetLadoPorPuntos(const Pnt *, const Pnt *) const
Returns the lado que tiene por extremos los puntos being passed as parameters.
Definition: CmbEdge.cc:579
Node * GetNodoDir(const size_t &i)
Returns the nodo which index is being passed as parameter empezando por el principio.
Definition: CmbEdge.cc:148
Finite element model generation tools.
Definition: Preprocessor.h:58
size_t NumEdges(void) const
Return the number of edges.
Definition: CmbEdge.h:129
virtual void inserta(Edge *l)
Inserts the line which pointer is being passed as parameter.
Definition: CmbEdge.cc:524
Definition: ID.h:77
virtual void SetVertice(const size_t &, Pnt *)
Sets the i-th vertex.
Definition: CmbEdge.cc:643
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
BND3d Bnd(void) const
Returns object BND.
Definition: CmbEdge.cc:669
Punto (KPoint).
Definition: Pnt.h:49
const Pnt * last_point(void) const
Returns a pointer to the último punto.
Definition: CmbEdge.cc:287
void line_meshing(meshing_dir dm)
Triggers meshing of lines.
Definition: CmbEdge.cc:384
const Lado * GetLado(const size_t &i) const
Returns a lado of the line compuesta.
Definition: CmbEdge.cc:570
Node * GetNodoInv(const size_t &i)
Returns the nodo which index is being passed as parameter empezando por el final. ...
Definition: CmbEdge.cc:160
Edge * NuevaLinea(Pnt *, Pnt *)
Creates a new line between the points being passed as parameters and inserts it on the edge set set...
Definition: CmbEdge.cc:471
virtual ID getKPoints(void) const
Returns object k-points.
Definition: CmbEdge.cc:649
void SetEdge(Edge *l)
Assigns the line.
Definition: CmbEdge.cc:53
virtual SetEstruct * getCopy(void) const
Virtual constructor.
Definition: CmbEdge.cc:239
size_t NDiv(void) const
Returns the number of divisions of the line.
Definition: CmbEdge.cc:208
Lado * ultima_linea(void)
Returns a pointer to the último lado.
Definition: CmbEdge.cc:260
MatrizPos3d get_posiciones(void) const
Returns the posiciones de la linea.
Definition: CmbEdge.cc:104
void addPoints(const ID &)
Creates and inserts the the edges that link the points from the indexes being passed as parameter...
Definition: CmbEdge.cc:428
Lado * primera_linea(void)
Returns a pointer to the first lado.
Definition: CmbEdge.cc:244
void cierra(void)
Closes the line.
Definition: CmbEdge.cc:451
CmbEdge(void)
Constructor.
Definition: CmbEdge.cc:224
Edge * Borde(void)
Returns a pointer to the la linea.
Definition: CmbEdge.cc:47
Compound line.
Definition: CmbEdge.h:42
double getLongitud(void) const
Return the longitud del lado.
Definition: CmbEdge.cc:96
std::deque< Edge * > GetEdges(void)
Return the deque of lines that define the edges.
Definition: CmbEdge.cc:624
void genMesh(meshing_dir dm)
Genertes a mesh from the corresponding line.
Definition: CmbEdge.cc:200
const Vector & getTang(const double &) const
Returns a vector tangente al lado en el punto s.
Definition: CmbEdge.cc:100
================================================================================
Definition: ContinuaReprComponent.h:34
const Pnt * first_point(void) const
Returns a pointer to the first punto.
Definition: CmbEdge.cc:277
bool ExtremosEn(const Pnt *, const Pnt *) const
Returns true if the points being passed as parameters son los extremos del lado.
Definition: CmbEdge.cc:77
MatrizPos3d GetPosNodosDir(void) const
Returns the posiciones of the nodes en sentido directo.
Definition: CmbEdge.cc:130