xc
QuadCellRegion.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 //QuadCellRegion.h
28 
29 #ifndef QUADCELLREGION_H
30 #define QUADCELLREGION_H
31 
32 
33 #include <iostream>
34 #include "material/section/repres/geom_section/region/SectRegion.h"
35 
36 class Grid2d;
37 
38 namespace XC {
39 
41 //
43 //
44 // nDivIJ= 4
45 // L +---+---+---+---+ K
46 // | | | | |
47 // +---+---+---+---+ nDivKL= 2
48 // | | | | |
49 // I +---+---+---+---+ J
51  {
52  mutable Grid2d *grid;
53  protected:
54  int nDivIJ, nDivJK;
55  void free_mem(void) const;
56  const Grid2d &alloc(const Grid2d &) const;
57 
58  public:
60  QuadCellRegion(Material *, int numSubdivIJ, int numSubdivJK);
63  virtual ~QuadCellRegion(void);
64 
65  void setDiscretization(int numSubdivIJ, int numSubdivJK);
66 
67  inline void setNDivIJ(const int &n)
68  { nDivIJ= n; }
69  inline int getNDivIJ(void) const
70  { return nDivIJ; }
71  inline void setNDivJK(const int &n)
72  { nDivJK= n; }
73  inline int getNDivJK(void) const
74  { return nDivJK; }
75  //inquiring functions
76  inline const int &nDivCirc(void) const
77  { return nDivIJ; }
78  inline int &nDivCirc(void)
79  { return nDivIJ; }
80  inline const int &nDivRad(void) const
81  { return nDivJK; }
82  inline int &nDivRad(void)
83  { return nDivJK; }
84  int getNumCells(void) const;
85  void getDiscretization(int &numSubdivIJ, int &numSubdivJK) const;
86  virtual const Grid2d &getMesh(void) const=0;
87  Vector getCenterOfMassGrid(void) const;
88  Vector getVertCoords(const size_t &,const size_t &) const;
89  Matrix getCellVertCoords(const size_t &,const size_t &) const;
90 
91 
92  };
93 } // end of XC namespace
94 
95 
96 #endif
97 
Vector getCenterOfMassGrid(void) const
Return the center of mass of the grid.
Definition: QuadCellRegion.cc:97
Float vector abstraction.
Definition: Vector.h:93
Matrix getCellVertCoords(const size_t &, const size_t &) const
Return the coordinates of the vertices of the (i,j) cell.
Definition: QuadCellRegion.cc:123
Region of a section that creates quadrilateral cells.
Definition: QuadCellRegion.h:50
Base class for materials.
Definition: Material.h:91
int nDivJK
number of divisions.
Definition: QuadCellRegion.h:54
int getNumCells(void) const
Return the number of celdas.
Definition: QuadCellRegion.cc:92
void getDiscretization(int &numSubdivIJ, int &numSubdivJK) const
Return the number of divisions on each direction.
Definition: QuadCellRegion.cc:85
QuadCellRegion & operator=(const QuadCellRegion &)
Assignment operator.
Definition: QuadCellRegion.cc:64
Region of a section that corresponds with a material.
Definition: SectRegion.h:57
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Matrix of floats.
Definition: Matrix.h:108
Vector getVertCoords(const size_t &, const size_t &) const
Return the coordinates of the point i,j.
Definition: QuadCellRegion.cc:108
void setDiscretization(int numSubdivIJ, int numSubdivJK)
Sets the number of divisions on each direction.
Definition: QuadCellRegion.cc:78