xc
Block.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 //Block.h
29 
30 #ifndef BLOCK_H
31 #define BLOCK_H
32 
33 #include "Body.h"
34 
35 namespace XC {
36 
40 class Block: public Body
41  {
42  BodyFace sups[6];
43  size_t index(Face *s) const;
44  void put(const size_t &i,Face *s);
45  protected:
46  void insert(const size_t &);
47  //XXX void add_points(const std::vector<size_t> &);
48  void append_faces(const std::vector<size_t> &);
49  void create_face_nodes(void);
50  Pos3dArray3d get_positions(void) const;
51  void create_nodes(void);
52 
53  virtual BodyFace *getFace(const size_t &i);
54  public:
55  Block(Preprocessor *m,const std::string &name= "");
56  virtual bool operator==(const Block &) const;
57  SetEstruct *getCopy(void) const;
59  virtual size_t getNumberOfLines(void) const;
60  virtual size_t getNumberOfVertices(void) const;
61  virtual size_t getNumberOfFaces(void) const;
62  size_t getNumberOfDefinedFaces(void) const;
63  void update_topology(void);
64  virtual std::set<const Face *> getSurfaces(void) const;
65  virtual std::set<Face *> getSurfaces(void);
66  const BodyFace *getFace(const size_t &i) const;
67  Face *newFace(const size_t &i,Pnt *,Pnt *,Pnt *,Pnt *);
68  CmbEdge::Side *getEdge(const size_t &i);
69  const CmbEdge::Side *getEdge(const size_t &i) const;
70  Pnt *getVertex(const size_t &i);
71  const Pnt *getVertex(const size_t &i) const;
72  boost::python::list getPositionsPy(void) const;
73  virtual Pos3d getCentroid(void) const;
74 
75  int getVtkCellType(void) const;
76 
77  void addPoints(const ID &);
78  void setPoints(const ID &);
79 
80  size_t NDivI(void) const;
81  void setNDivI(const size_t &nDiv);
82  size_t NDivJ(void) const;
83  void setNDivJ(const size_t &nDiv);
84  size_t NDivK(void) const;
85  void setNDivK(const size_t &nDiv);
86 
87  std::deque<const Edge *> getNDivErrors(void) const;
88  bool checkNDivs(void) const;
89 
90  void genMesh(meshing_dir dm);
91 
92  double getVolume(void) const;
93 
94  boost::python::dict getPyDict(void) const;
95  void setPyDict(const boost::python::dict &);
96  };
97 } //end of XC namespace
98 
99 #endif
SetEstruct * getCopy(void) const
Virtual constructor.
Definition: Block.cc:105
size_t getNumberOfDefinedFaces(void) const
Return the number of already defined faces.
Definition: Block.cc:143
Component of a compound line.
Definition: CmbEdge.h:59
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Block.cc:860
int getVtkCellType(void) const
Interface with VTK.
Definition: Block.cc:109
void update_topology(void)
Update topology of the enclosing surface (neighbors).
Definition: Block.cc:287
virtual size_t getNumberOfLines(void) const
Return the number of lines of the object.
Definition: Block.cc:131
Finite element model generation tools.
Definition: Preprocessor.h:59
size_t NDivK(void) const
Return the number of divisions along the edge 1->5.
Definition: Block.cc:568
void addPoints(const ID &)
Creates and inserts the the faces that link the points from the indexes being passed as parameter...
Definition: Block.cc:776
Surface that limits the body (face as seen by the body).
Definition: Body.h:77
CmbEdge::Side * getEdge(const size_t &i)
Return the i-th edge of the solid.
Definition: Block.cc:186
Vector of integers.
Definition: ID.h:95
virtual bool operator==(const Block &) const
Comparison operator.
Definition: Block.cc:90
bool checkNDivs(void) const
Check that number of divisions of the lines are compatible.
Definition: Block.cc:125
void create_nodes(void)
Create nodes for the block.
Definition: Block.cc:598
void genMesh(meshing_dir dm)
Trigger mesh generation.
Definition: Block.cc:758
virtual std::set< const Face * > getSurfaces(void) const
Return the surfaces that close the solid.
Definition: Block.cc:261
Six-faced body.
Definition: Block.h:40
Face * newFace(const size_t &i, Pnt *, Pnt *, Pnt *, Pnt *)
Creates a new face between the points being passed as parameters and inserts it on the faces set...
Definition: Block.cc:167
double getVolume(void) const
Returns the object volume.
Definition: Block.cc:842
void insert(const size_t &)
Insert the surface with the identifier passed as parameter (if found).
Definition: Block.cc:380
Point (KPoint).
Definition: Pnt.h:50
virtual Pos3d getCentroid(void) const
Return the centroid of the object.
Definition: Block.cc:408
void create_face_nodes(void)
Trigger the creation of nodes on faces.
Definition: Block.cc:402
void setPoints(const ID &)
Creates and inserts the faces from the points identified by the indexes being passed as parameter...
Definition: Block.cc:822
structured set, i.
Definition: SetEstruct.h:47
Position array in a three-dimensional space.
Definition: Pos3dArray3d.h:37
Posición en tres dimensiones.
Definition: Pos3d.h:44
boost::python::list getPositionsPy(void) const
Return the positions that will be used for the nodes when meshing.
Definition: Block.cc:520
Block(Preprocessor *m, const std::string &name="")
Constructor.
Definition: Block.cc:86
Pos3dArray3d get_positions(void) const
Return (ndivI+1)*(ndivJ+1)*(ndivK+1) positions for the nodes.
Definition: Block.cc:454
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Pnt * getVertex(const size_t &i)
Return the i-th vertex of the solid.
Definition: Block.cc:237
std::deque< const Edge * > getNDivErrors(void) const
Returns a list with the edges that have an incompatible number of divisions.
Definition: Block.cc:113
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Block.cc:874
Six-faced solid.
Definition: Body.h:71
void append_faces(const std::vector< size_t > &)
Create and insert the faces from the indices passed as parameter.
Definition: Block.cc:394
virtual size_t getNumberOfVertices(void) const
Return the number of vertices.
Definition: Block.cc:135
size_t NDivI(void) const
Return the number of divisions along the edge 1->2.
Definition: Block.cc:546
virtual BodyFace * getFace(const size_t &i)
Return the face with the index passed as parameter.
Definition: Block.cc:157
Surface.
Definition: Face.h:45
size_t NDivJ(void) const
Return the number of divisions along the edge 2->3.
Definition: Block.cc:557
virtual size_t getNumberOfFaces(void) const
Return the number of faces.
Definition: Block.cc:139