Class documentation of Concepts

Loading...
Searching...
No Matches
sfcdstr.hh
Go to the documentation of this file.
1
6#ifndef sfcdstr_hh
7#define sfcdstr_hh
8
9#include <memory>
10
11#include "basics.hh"
12#include "geometry/cell1D.hh"
13#include "geometry/cell2D.hh"
14#include "geometry/cell3D.hh"
15#include "geometry/mesh.hh"
16#include "toolbox_p/using_p.hh"
18#include "geometry_p/mesh_p.hh"
19#include "sfc.hh"
20
21namespace parallel {
22
23 // ******************************************** SFCDstr **
24
34 private:
35
37 template<class T>
38 class ListElmSFC {
39 private:
41 ListElmSFC<T>* lnk_;
43 T* cell_;
45 Real3d c_;
46
47 public:
48 inline ListElmSFC(Real3d& c, T* cell, ListElmSFC<T>* lnk = 0)
49 : lnk_(lnk), cell_(cell), c_(c) {};
50
51 inline ListElmSFC<T>** linkp() {return &lnk_;};
52 inline ListElmSFC<T>* link() const {return lnk_;}
53 inline const Real3d& center() const {return c_;};
54 inline T* cell() const {return cell_;};
55 };
56
62 void refine1_(Cell1* cell, uint lvl, ListHead<ListElmSFC<Cell1> >& lst);
68 void refine2_(Cell2* cell, uint lvl, ListHead<ListElmSFC<Cell2> >& lst);
74 void refine3_(Cell3* cell, uint lvl, ListHead<ListElmSFC<Cell3> >& lst);
75
83 template<class T>
84 void sortList_(ListElmSFC<T>** root, Real& d, Real3d& pmin, ushort ori);
85
93 template<class T>
94 void boundingBox_(ListHead<ListElmSFC<T> >& lst, Real3d* pmin,
95 Real* d, uint* npnt);
96
103 void markOwnCells1_(ListHead<ListElmSFC<Cell1> >& cells, uint* ncntr0,
104 DynArray<uchar>& cellmap);
112 void markOwnCells2_(ListHead<ListElmSFC<Cell2> >& cells, uint* ncntr0,
113 uint* ncntr1, DynArray<uchar>& cellmap);
122 void markOwnCells3_(ListHead<ListElmSFC<Cell3> >& cells, uint* ncntr0,
123 uint* ncntr1, uint* ncntr2, DynArray<uchar>& cellmap);
124
131 bool mapCount1_(Cell1* cell, uint lvl, DynArray<uchar>& cellmap);
138 bool mapCount2_(Cell2* cell, uint lvl, DynArray<uchar>& cellmap);
145 bool mapCount3_(Cell3* cell, uint lvl, DynArray<uchar>& cellmap);
146
161 void newCells1A_(concepts::Edge1d* edg, uint lvl, uint* n,
162 concepts::MapEdge1d* mapcln, DynArray<uchar>& cellmap,
164 Array<unique_ptr<Connector0> >& cntr0,
165 Array<unique_ptr<Connector1> >& cntr1,
166 Array<unique_ptr<Cell1> >& cell1);
167
185 void newCells2A_(concepts::Triangle2d* tri, uint lvl, uint* n,
187 DynArray<uchar>& cellmap,
190 Array<unique_ptr<Connector0> >& cntr0,
191 Array<unique_ptr<Connector1> >& cntr1,
192 Array<unique_ptr<Connector2> >& cntr2,
193 Array<unique_ptr<Cell2> >& cell2);
194 void newCells2B_(concepts::Quad2d* quad, uint lvl, uint* n,
196 DynArray<uchar>& cellmap,
199 Array<unique_ptr<Connector0> >& cntr0,
200 Array<unique_ptr<Connector1> >& cntr1,
201 Array<unique_ptr<Connector2> >& cntr2,
202 Array<unique_ptr<Cell2> >& cell2);
203 void newCells2C_(concepts::Triangle3d* tri, uint lvl, uint* n,
205 DynArray<uchar>& cellmap,
208 Array<unique_ptr<Connector0> >& cntr0,
209 Array<unique_ptr<Connector1> >& cntr1,
210 Array<unique_ptr<Connector2> >& cntr2,
211 Array<unique_ptr<Cell2> >& cell2);
212
233 void newCells3A_(concepts::Hexahedron3d* hex, uint lvl, uint* n,
235 DynArray<uchar>& cellmap,
238 DynArray<Connector2*>& fcemap,
239 Array<unique_ptr<Connector0> >& cntr0,
240 Array<unique_ptr<Connector1> >& cntr1,
241 Array<unique_ptr<Connector2> >& cntr2,
242 Array<unique_ptr<Connector3> >& cntr3,
243 Array<unique_ptr<Cell3> >& cell3);
244
246 const Communicator& com_;
248 uint maxpnt_;
250 SFC &sfc_;
251
252 public:
258 SFCDstr(uint maxpnt, SFC& sfc, const Communicator& com);
259 ~SFCDstr();
260
263 Mesh1* distribute1(concepts::Mesh1& msh, uint lvl);
264 Mesh2* distribute2(concepts::Mesh2& msh, uint lvl);
265 Mesh3* distribute3(concepts::Mesh3& msh, uint lvl);
266
267 inline const Communicator& comm() const {return com_;};
268
269 protected:
270 std::ostream& info(std::ostream& os) const;
271 };
272
273} // namespace parallel
274
275#endif // sfcdstr_hh
One dimensional cell.
Definition cell.hh:75
Two dimensional cell.
Definition cell.hh:89
Three dimensional cell.
Definition cell.hh:112
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
SFCDstr(uint maxpnt, SFC &sfc, const Communicator &com)
Mesh * distribute(concepts::Mesh &msh, uint lvl)
Refines a mesh up to level lvl and distributes it among processors.