xc
UniformGrid.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 //UniformGrid.h
29 
30 #ifndef UNIFORMGRID_H
31 #define UNIFORMGRID_H
32 
33 #include "preprocessor/multi_block_topology/entities/EntMdlr.h"
34 #include "utility/geom/pos_vec/Pos3d.h"
35 
36 namespace XC {
37 
41 class UniformGrid: public EntMdlr
42  {
43  private:
44  Pos3d org;
45  double Lx;
46  double Ly;
47  double Lz;
48  size_t ndiv_x;
49  size_t ndiv_y;
50  size_t ndiv_z;
51  protected:
52 
53  void update_topology(void);
54  void create_nodes(void);
55  public:
56  UniformGrid(Preprocessor *m,const size_t &i= 0);
57  UniformGrid(const std::string &name= "",Preprocessor *m= nullptr,const size_t &i= 0);
58  virtual bool operator==(const UniformGrid &) const;
59  SetEstruct *getCopy(void) const;
60  virtual unsigned short int GetDimension(void) const;
61 
62 
63  inline void setOrg(const Pos3d &p)
64  { org= p; }
65  inline const Pos3d &getOrg(void) const
66  { return org; }
67 
68  inline void setLx(const double &l)
69  { Lx= l; }
70  inline double getLx(void) const
71  { return Lx; }
72  inline void setLy(const double &l)
73  { Ly= l; }
74  inline double getLy(void) const
75  { return Ly; }
76  inline void setLz(const double &l)
77  { Lz= l; }
78  inline double getLz(void) const
79  { return Lz; }
80 
81  inline void setNDivX(const size_t &n)
82  { ndiv_x= n; }
83  inline size_t getNDivX(void) const
84  { return ndiv_x; }
85  inline void setNDivY(const size_t &n)
86  { ndiv_y= n; }
87  inline size_t getNDivY(void) const
88  { return ndiv_y; }
89  inline void setNDivZ(const size_t &n)
90  { ndiv_z= n; }
91  inline size_t getNDivZ(void) const
92  { return ndiv_z; }
93 
94  virtual BND3d Bnd(void) const;
95  Pos3d getCenter(void) const;
96  std::deque<Pos3d> getPosNodes(bool initialGeometry= true) const;
97 
98  std::set<SetBase *> get_sets(void) const;
99  void add_to_sets(std::set<SetBase *> &);
100 
101  virtual void genMesh(meshing_dir dm);
102  };
103 
104 } //end of XC namespace
105 
106 #endif
void add_to_sets(std::set< SetBase *> &)
Adds the uniform grid to the set being passed as parameter.
Definition: UniformGrid.cc:125
std::set< SetBase * > get_sets(void) const
Returns the sets to which this object belongs.
Definition: UniformGrid.cc:108
Finite element model generation tools.
Definition: Preprocessor.h:59
virtual BND3d Bnd(void) const
Returns mesh BND.
Definition: UniformGrid.cc:97
Pos3d getCenter(void) const
Returns mesh centroid.
Definition: UniformGrid.cc:104
void update_topology(void)
Number of divisions on z axis.
Definition: UniformGrid.cc:82
Uniform mesh.
Definition: UniformGrid.h:41
void create_nodes(void)
Creates mesh nodes.
Definition: UniformGrid.cc:135
"boundary" en tres dimensiones.
Definition: BND3d.h:34
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:55
UniformGrid(Preprocessor *m, const size_t &i=0)
Constructor.
Definition: UniformGrid.cc:41
virtual unsigned short int GetDimension(void) const
Returns mesh dimension (1,2 or 3).
Definition: UniformGrid.cc:87
structured set, i.
Definition: SetEstruct.h:47
virtual void genMesh(meshing_dir dm)
Triggers mesh creation.
Definition: UniformGrid.cc:142
Posición en tres dimensiones.
Definition: Pos3d.h:44
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
std::deque< Pos3d > getPosNodes(bool initialGeometry=true) const
Return the positions of the nodes.
Definition: UniformGrid.cc:150
virtual bool operator==(const UniformGrid &) const
Comparison operator.
Definition: UniformGrid.cc:54
SetEstruct * getCopy(void) const
Virtual constructor.
Definition: UniformGrid.cc:79