XC Open source finite element analysis program
UniformGrid.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 //UniformGrid.h
28 
29 #ifndef UNIFORMGRID_H
30 #define UNIFORMGRID_H
31 
32 #include "EntMdlr.h"
33 #include "xc_utils/src/geom/pos_vec/Pos3d.h"
34 
35 namespace XC {
36 
40 class UniformGrid: public EntMdlr
41  {
42  private:
43  Pos3d org;
44  double Lx;
45  double Ly;
46  double Lz;
47  size_t ndiv_x;
48  size_t ndiv_y;
49  size_t ndiv_z;
50  protected:
51 
52  void actualiza_topologia(void);
53  void create_nodes(void);
54  public:
55  UniformGrid(Preprocessor *m,const size_t &i= 0);
56  UniformGrid(const std::string &nombre= "",Preprocessor *m= nullptr,const size_t &i= 0);
57  SetEstruct *getCopy(void) const;
58  virtual unsigned short int GetDimension(void) const;
59 
60 
61  inline void setOrg(const Pos3d &p)
62  { org= p; }
63  inline const Pos3d &getOrg(void) const
64  { return org; }
65 
66  inline void setLx(const double &l)
67  { Lx= l; }
68  inline double getLx(void) const
69  { return Lx; }
70  inline void setLy(const double &l)
71  { Ly= l; }
72  inline double getLy(void) const
73  { return Ly; }
74  inline void setLz(const double &l)
75  { Lz= l; }
76  inline double getLz(void) const
77  { return Lz; }
78 
79  inline void setNDivX(const size_t &l)
80  { ndiv_x= l; }
81  inline size_t getNDivX(void) const
82  { return Lx; }
83  inline void setNDivY(const size_t &l)
84  { ndiv_y= l; }
85  inline size_t getNDivY(void) const
86  { return Ly; }
87  inline void setNDivZ(const size_t &l)
88  { ndiv_z= l; }
89  inline size_t getNDivZ(void) const
90  { return Lz; }
91 
92  virtual BND3d Bnd(void) const;
93  Pos3d GetCentro(void) const;
94 
95  std::set<SetBase *> get_sets(void) const;
96  void add_to_sets(std::set<SetBase *> &);
97 
98  virtual void genMesh(meshing_dir dm);
99  };
100 
101 } //end of XC namespace
102 
103 #endif
virtual unsigned short int GetDimension(void) const
Returns mesh dimension (1,2 ó 3).
Definition: UniformGrid.cc:61
virtual void genMesh(meshing_dir dm)
Triggers mesh creation.
Definition: UniformGrid.cc:115
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:53
virtual BND3d Bnd(void) const
Returns mesh BND.
Definition: UniformGrid.cc:71
SetEstruct * getCopy(void) const
Virtual constructor.
Definition: UniformGrid.cc:53
void add_to_sets(std::set< SetBase * > &)
Adds the uniform grid to the set being passed as parameter.
Definition: UniformGrid.cc:98
Finite element model generation tools.
Definition: Preprocessor.h:58
structured set, i. e. a set that can return a pointer a to a node or an element from its indices i...
Definition: SetEstruct.h:45
void create_nodes(void)
Creates mesh nodes.
Definition: UniformGrid.cc:108
UniformGrid(Preprocessor *m, const size_t &i=0)
Constructor.
Definition: UniformGrid.cc:40
void actualiza_topologia(void)
Number of divisions on z axis.
Definition: UniformGrid.cc:56
Uniform mesh. Uniform node distributionn on x, y and z.
Definition: UniformGrid.h:40
================================================================================
Definition: ContinuaReprComponent.h:34
std::set< SetBase * > get_sets(void) const
Returns the sets a los que pertenece este objeto.
Definition: UniformGrid.cc:82
Pos3d GetCentro(void) const
Returns mesh centroid.
Definition: UniformGrid.cc:78