XC Open source finite element analysis program
Face.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 //Face.h
28 //Face entities.
29 
30 #ifndef FACE_H
31 #define FACE_H
32 
33 #include "CmbEdge.h"
34 
35 namespace XC {
36 class Body;
37 
41 class Face: public CmbEdge
42  {
43  friend class Edge;
44  friend class Body;
45  std::set<const Body *> cuerpos_sup;
46 
47  void inserta_body(Body *b);
48  Node *GetNodo(const size_t &i);
49  const Node *GetNodo(const size_t &i) const;
50  protected:
51  size_t ndivj; //number of divisions en el eje j.
52  virtual const Edge *get_lado_homologo(const Edge *l) const= 0;
53 
54  public:
55  Face(void);
56  Face(Preprocessor *m,const size_t &ndivI= 4, const size_t &ndivJ= 4);
57  Face(const std::string &nombre,Preprocessor *m,const size_t &ndivI= 4, const size_t &ndivJ= 4);
59  inline virtual unsigned short int GetDimension(void) const
60  { return 2; }
61  void actualiza_topologia(void);
62  inline size_t NDivI(void) const
63  { return ndiv; }
64  virtual void SetNDivI(const size_t &ndi);
65  inline size_t NDivJ(void) const
66  { return ndivj; }
67  virtual void SetNDivJ(const size_t &ndj);
68  virtual void ConciliaNDivIJ(void)= 0;
70  size_t NumVertices(void) const
71  { return NumEdges(); }
72  virtual const Pnt *GetVertice(const size_t &i) const;
73  Polilinea3d getContour(void) const;
75  const std::set<const Body *> &CuerposTocan(void) const
76  { return cuerpos_sup; }
77  size_t BordeComun(const Face &otra) const;
78  int SentidoBorde(const Edge *l,const Face &otra) const;
79  bool Toca(const Body &b) const;
80  virtual bool checkNDivs(void) const= 0;
81 
82  virtual Node *GetNodo(const size_t &i1,const size_t &j,const size_t &k);
83  virtual const Node *GetNodo(const size_t &i,const size_t &j,const size_t &k) const;
84  virtual Node *GetNodo(const size_t &i,const size_t &j);
85  virtual const Node *GetNodo(const size_t &i,const size_t &j) const;
86 
87  std::set<SetBase *> get_sets(void) const;
88  void add_to_sets(std::set<SetBase *> &);
89 
90  int getVtkCellType(void) const;
91  int getMEDCellType(void) const;
92  };
93 
94 std::set<const Face *> GetSupsTocan(const Edge &l);
95 
96 } //end of XC namespace.
97 
98 #endif
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
Surface.
Definition: Face.h:41
void actualiza_topologia(void)
Updates topology.
Definition: Face.cc:70
Six-faced solid.
Definition: Body.h:64
size_t BordeComun(const Face &otra) const
Returns the index of the edge in common with the surface being passed as parameter (if it exists)...
Definition: Face.cc:78
int getVtkCellType(void) const
Interfaz con VTK.
Definition: Face.cc:206
size_t NumVertices(void) const
Returns the number of vertices.
Definition: Face.h:70
virtual unsigned short int GetDimension(void) const
Returns the dimension of the object.
Definition: Face.h:59
bool Toca(const Body &b) const
Returns true if the lines touches the body (neighbor).
Definition: Face.cc:133
Mesh node.
Definition: Node.h:99
std::set< const Face * > GetSupsTocan(const Edge &l)
Return the surfaces that touch the line.
Definition: Face.cc:129
Polilinea3d getContour(void) const
Returns the contour of the face as a 3D polyline.
Definition: Face.cc:125
virtual const Pnt * GetVertice(const size_t &i) const
Returns the i-th vertex.
Definition: Face.cc:121
int getMEDCellType(void) const
Interfaz con el formato MED de Salome.
Definition: Face.cc:227
Finite element model generation tools.
Definition: Preprocessor.h:58
size_t NumEdges(void) const
Return the number of edges.
Definition: CmbEdge.h:129
Punto (KPoint).
Definition: Pnt.h:49
std::set< SetBase * > get_sets(void) const
Returns the sets that contains this surface.
Definition: Face.cc:140
virtual void SetNDivJ(const size_t &ndj)
Asigna el number of divisions en el eje j.
Definition: Face.cc:61
Compound line.
Definition: CmbEdge.h:42
const std::set< const Body * > & CuerposTocan(void) const
Return the bodies that touch this surface (neighbors).
Definition: Face.h:75
int SentidoBorde(const Edge *l, const Face &otra) const
Definition: Face.cc:94
virtual void SetNDivI(const size_t &ndi)
Asigna el number of divisions en el eje i.
Definition: Face.cc:57
================================================================================
Definition: ContinuaReprComponent.h:34
void add_to_sets(std::set< SetBase * > &)
Appends the surface to each of the sets being passed as parameter.
Definition: Face.cc:156
Face(void)
Constructor.
Definition: Face.cc:42