xc
Paver.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 //Paver.h
29 
30 #ifndef PAVER_H
31 #define PAVER_H
32 
33 #include "utility/kernel/CommandEntity.h"
34 #include "utility/geom/d2/Polygon3d.h"
35 
36 extern "C" {
37 #include "paving.h"
38 }
39 
40 namespace XC {
41 
42 class Paver: public CommandEntity
43  {
44  private:
45  integer nbnode;
46  integer nprm;
47  // (there is one outside perimeter and one perimeter for
48  // each hole in the boundary)
49  integer mln= 8;
50  // number should be passed in as eight (8) currently.
51  std::vector<integer> iptper;
52  // bnode array. Each pointer indicates the
53  // beginning node for that perimeter in lperim.
54  std::vector<integer> numper;
55  // nodes in each of the perimeters.
56  std::vector<integer> lperim;
57  std::vector<xc_float> x;
58  // to mxnd.
59  std::vector<xc_float> y;
60  // to mxnd.
61  std::vector<xc_float> z;
62  // to mxnd.
63  std::vector<integer> iexk;
64  // element dimensioned as (4, mxnd)
65  std::vector<integer> inxe;
66  // edge dimensioned as (2, mxnd)
67  integer nnn= 0;
68  integer lll= 0;
69  integer kkk= 0;
70  integer mxnd= 0;
71  // (if this is exceeded, noroom is returned as .true.)
72  std::vector<xc_float> angle;
73  // paving - dimensioned to (mxnd) - this becomes
74  // the angle array.
75  std::vector<xc_float> bnsize;
76  // paving - dimensioned to (mxnd * 2) - this
77  // becomes the bnsize array
78  std::vector<integer> lnodes;
79  // paving - dimensioned to (mxnd * 8) -
80  // this becomes the lnodes array
81  std::vector<integer> linkpr;
82  // paving - dimensioned to (nprm * 3 -
83  // this becomes the linkpr array
84  std::vector<integer> nperim;
85  // paving - dimensioned to (nprm -
86  // this becomes the nperim array
87  std::vector<integer> lxk;
88  // paving - dimensioned to (mxnd * 4 -
89  // this becomes the lxk array
90  std::vector<integer> kxl;
91  // paving - dimensioned to (mxnd * 6 -
92  // this becomes the kxl array
93  std::vector<integer> nxl;
94  // paving - dimensioned to (mxnd * 6 -
95  // this becomes the nxl array
96  std::vector<integer> lxn;
97  // paving - dimensioned to (mxnd * 4 -
98  // this becomes the lxn array
99  std::vector<integer> nuid;
100  // paving - dimensioned to (mxnd -
101  // this becomes the nuid array
102  integer iavail= 0;
103  integer navail= 0;
105  // becomes navail.
106  logical graph= 0;
107  logical timer= 0;
108  logical video= 0;
109  xc_float defsiz= 0.0;
110  // (set it to zero if you don't know what else to do.)
111  logical sizeit= 0;
112  // with paving.
113  char dev1[3]= {' ',' ',' '};
114  // describing the plotting device being used.
115  integer kreg= 0;
116  logical batch= 1;
117  // graphics capabilities.
118  logical noroom= 0;
119  // exceeded (more space is needed)
120  logical err= 0;
121  // is .true.
122  std::vector<xc_float> amesur;
123  // (used in adaptive meshing).
124  std::vector<xc_float> bmesur;
125  // (used in adaptive meshing).
126  std::vector<xc_float> xnold;
127  std::vector<xc_float> ynold;
129  std::vector<integer> nxkold;
131  // (used in adaptive meshing).
132  std::vector<integer> mmpold;
133  std::vector<integer> linkeg;
134  std::vector<integer> listeg;
135  integer mlink= 0;
136  integer nprold= 0;
137  integer npnold= 0;
138  integer npeold= 0;
139  integer nnxk= 0;
140  logical remesh= 0;
141  xc_float rexmin= 0.0;
142  xc_float rexmax= 0.0;
143  xc_float reymin= 0.0;
144  xc_float reymax= 0.0;
145  int idivis= 0;
146  int call_paving(const Ref2d3d &, const Polygon3d &, const std::deque<Polygon3d> &);
147  int extract_mesh(const Ref2d3d &);
148  std::vector<int> get_elem_nodes(const std::vector<int> &);
149 
150  // Resulting mesh.
151  std::vector<Pos3d> nodePos; //Positions of the nodes.
152  std::vector<std::vector<int> > elemEdges; //Element edges.
153  std::deque<std::vector<int> > elemNodes; //Element nodes.
154  public:
155  Paver(void);
156  void report(std::ostream &);
157  int mesh(const Polygon3d &, const std::deque<Polygon3d> &);
158  int meshPy(const Polygon3d &, const boost::python::list &);
159  boost::python::list getNodePositionsPy(void) const;
160  boost::python::list getQuadsPy(void) const;
161  const std::vector<Pos3d> &getNodePositions(void) const;
162  size_t getIndexNearestPosition(const Pos3d &, const size_t &limit) const;
163  const std::deque<std::vector<int> > &getQuads(void) const;
164  };
165 
166 } // end of XC namespace
167 
168 #endif
Plane polygon in a 3D space.
Definition: Polygon3d.h:35
int mesh(const Polygon3d &, const std::deque< Polygon3d > &)
Get data from Python and call paving.
Definition: Paver.cc:183
boost::python::list getNodePositionsPy(void) const
Return a list containing the positions of the nodes.
Definition: Paver.cc:319
boost::python::list getQuadsPy(void) const
Return the node indexes for each element.
Definition: Paver.cc:328
Definition: Paver.h:42
size_t getIndexNearestPosition(const Pos3d &, const size_t &limit) const
Return the nearest position in the range [0, limit)
Definition: Paver.cc:297
Objet that can execute python scripts.
Definition: CommandEntity.h:40
Paver(void)
Default constructor.
Definition: Paver.cc:50
Posición en tres dimensiones.
Definition: Pos3d.h:44
int meshPy(const Polygon3d &, const boost::python::list &)
Get data from Python and call paving.
Definition: Paver.cc:197
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Two-dimensional reference system defined in a three-dimensional space.
Definition: Ref2d3d.h:41