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