xc
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 insert_body(Body *b);
48  Node *getNode(const size_t &i);
49  const Node *getNode(const size_t &i) const;
50  protected:
51  size_t ndivj; //number of divisions in the j axis.
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 update_topology(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 getNumberOfVertices(void) const
71  { return getNumberOfEdges(); }
72  virtual const Pnt *getVertex(const size_t &i) const;
73  Polyline3d getContour(void) const;
75  const std::set<const Body *> &getConnectedBodies(void) const
76  { return cuerpos_sup; }
77  size_t CommonEdge(const Face &otra) const;
78  int SenseOfEdge(const Edge *l,const Face &otra) const;
79  bool isConnectedTo(const Body &b) const;
80  virtual bool checkNDivs(void) const= 0;
81 
82  virtual Node *getNode(const size_t &i1,const size_t &j,const size_t &k);
83  virtual const Node *getNode(const size_t &i,const size_t &j,const size_t &k) const;
84  virtual Node *getNode(const size_t &i,const size_t &j);
85  virtual const Node *getNode(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  };
92 
93 std::set<const Face *> getConnectedSurfaces(const Edge &l);
94 
95 } //end of XC namespace.
96 
97 #endif
size_t getNumberOfEdges(void) const
Return the number of edges.
Definition: CmbEdge.h:132
std::set< SetBase * > get_sets(void) const
Returns the sets that contains this surface.
Definition: Face.cc:148
void add_to_sets(std::set< SetBase *> &)
Appends the surface to each of the sets being passed as parameter.
Definition: Face.cc:164
virtual void SetNDivI(const size_t &ndi)
Sets the number of divisions for direction I.
Definition: Face.cc:61
bool isConnectedTo(const Body &b) const
Returns true if the lines touches the body (neighbor).
Definition: Face.cc:141
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
int SenseOfEdge(const Edge *l, const Face &otra) const
Returns:
Definition: Face.cc:98
Finite element model generation tools.
Definition: Preprocessor.h:58
Face(void)
Constructor.
Definition: Face.cc:42
int getVtkCellType(void) const
Interfaz con VTK.
Definition: Face.cc:222
Compound line.
Definition: CmbEdge.h:42
size_t CommonEdge(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:82
Polyline3d getContour(void) const
Returns the contour of the face as a 3D polyline.
Definition: Face.cc:133
const std::set< const Face * > & getConnectedSurfaces(void) const
Return the surfaces that touch the line.
Definition: Edge.h:90
virtual unsigned short int GetDimension(void) const
Returns the dimension of the object.
Definition: Face.h:59
Point (KPoint).
Definition: Pnt.h:49
const std::set< const Body * > & getConnectedBodies(void) const
Return the bodies that touch this surface (neighbors).
Definition: Face.h:75
virtual const Pnt * getVertex(const size_t &i) const
Returns the i-th vertex.
Definition: Face.cc:129
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Six-faced solid.
Definition: Body.h:64
virtual void SetNDivJ(const size_t &ndj)
Sets the number of divisions for direction J.
Definition: Face.cc:65
size_t getNumberOfVertices(void) const
Returns the number of vertices.
Definition: Face.h:70
void update_topology(void)
Updates topology.
Definition: Face.cc:74
Mesh node.
Definition: Node.h:110
Surface.
Definition: Face.h:41