XC Open source finite element analysis program
Body.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 //Body.h
28 //Class for block entities. (XXX: rename as Block?)
29 
30 #ifndef BODY_H
31 #define BODY_H
32 
33 #include "EntMdlr.h"
34 #include "CmbEdge.h"
35 
36 
37 class Pos3d;
38 
39 namespace XC {
40 
41 class Face;
42 class Pnt;
43 
48  {
49  size_t l1;
50  size_t l2;
51  size_t l3;
52  size_t l4;
53  bool dirt;
54 
55  SecuenciaLados(const size_t primero= 1,const bool &directo= true);
57  const bool &Directo(void) const
58  { return dirt; }
59  };
60 
64 class Body: public EntMdlr
65  {
66  protected:
70  class BodyFace
71  {
72  Face *surface;
73  SecuenciaLados sec_lados;
74  public:
75  BodyFace(Face *ptr= nullptr,const size_t &p=1,const bool &d=true);
76  Face *Surface(void);
77  const Face *Surface(void) const;
78  void SetSurf(Face *s);
79 
80  const std::string &GetNombre(void) const;
81  bool Vacia(void) const;
82  size_t NumLineas(void) const;
83  size_t NumVertices(void) const;
84  const CmbEdge::Lado *GetLado(const size_t &) const;
85  CmbEdge::Lado *GetLado(const size_t &);
86  const Pnt *GetVertice(const size_t &) const;
87  Pnt *GetVertice(const size_t &);
88  virtual MatrizPos3d get_posiciones(void) const;
89  void create_nodes(void);
90  bool checkNDivs(void) const;
91  Node *GetNodo(const size_t &,const size_t &);
92  };
93 
94  void set_surf(Face *s);
95 
96  virtual BodyFace *GetFace(const size_t &i)= 0;
97  public:
98  Body(Preprocessor *m,const std::string &nombre= "");
100  inline virtual unsigned short int GetDimension(void) const
101  { return 3; }
103  virtual size_t NumLineas(void) const= 0;
105  virtual size_t NumVertices(void) const= 0;
107  virtual size_t NumFaces(void) const= 0;
108  virtual std::set<const Face *> getSurfaces(void)= 0;
109  virtual const BodyFace *GetFace(const size_t &i) const= 0;
110  virtual const CmbEdge::Lado *GetArista(const size_t &i) const= 0;
111  virtual const Pnt *GetVertice(const size_t &i) const= 0;
112  std::vector<int> getIndicesVertices(void) const;
113  virtual BND3d Bnd(void) const;
114 
115  virtual bool checkNDivs(void) const= 0;
116 
117  std::set<SetBase *> get_sets(void) const;
118  void add_to_sets(std::set<SetBase *> &);
119 
120 
121  };
122 
123 std::set<const Body *> GetCuerposTocan(const Face &s);
124 
125 } //end of XC namespace
126 
127 #endif
Surface.
Definition: Face.h:41
Six-faced solid.
Definition: Body.h:64
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:53
Surface that limits the body (face as seen by the body).
Definition: Body.h:70
Order in edges of an hexaedron face.
Definition: Body.h:47
const bool & Directo(void) const
Return true if the edge sequence is direct (edge1 -> edge4).
Definition: Body.h:57
Mesh node.
Definition: Node.h:99
Component of a compound line.
Definition: CmbEdge.h:57
bool dirt
Direct or reverse.
Definition: Body.h:53
Finite element model generation tools.
Definition: Preprocessor.h:58
virtual unsigned short int GetDimension(void) const
Return the object dimension.
Definition: Body.h:100
Punto (KPoint).
Definition: Pnt.h:49
size_t l3
Index edge 3.
Definition: Body.h:51
size_t l1
Index edge 1.
Definition: Body.h:49
size_t l2
Index edge 2.
Definition: Body.h:50
================================================================================
Definition: ContinuaReprComponent.h:34
SecuenciaLados(const size_t primero=1, const bool &directo=true)
Constructor.
Definition: Body.cc:43
size_t l4
Index edge 4.
Definition: Body.h:52
std::set< const Body * > GetCuerposTocan(const Face &s)
Return the bodies that touch the surface passed as parameter (neighbors).
Definition: Body.cc:224