Class documentation of Concepts

Loading...
Searching...
No Matches
space.hh
Go to the documentation of this file.
1
6#ifndef hpSpace2Dedge_hh
7#define hpSpace2Dedge_hh
8
9#include <memory>
10#include <cstring>
11#include <set>
12#include "basics/exceptions.hh"
13#include "basics/typedefs.hh"
14#include "space/space.hh"
15#include "space/hpMethod.hh"
17#include "geometry/cell2D.hh"
18#include "geometry/mesh.hh"
20#include "toolbox/dynArray.hh"
22#include "hp2D/element.hh"
23#include "hp2D/space.hh"
24
25namespace concepts {
26
27 // forward declarations
28 template<class F>
29 class SMatrixBase;
30
31 class SMatrix1D;
32
33 template<class F, int dim>
34 class SMatrixTensor;
35
36} // namespace concepts
37
38namespace hp2Dedge {
39 using concepts::Real;
40
41 // ***************************************************************** Space **
42
50 class Space :
51 public concepts::SpaceOnCells<Real>,
52 public concepts::AdaptiveSpace<Real, concepts::AdaptiveAdjustP<2> > {
53 public:
55
69 Space(concepts::Mesh2& msh, uint l, uint p,
70 concepts::BoundaryConditions* bc = 0, bool trunk = false);
71 virtual ~Space();
72
73 // Override concepts::Space::getOutputDimension
74 virtual uint getOutputDimension() const{
75 return 2u;
76 }
77
78 inline uint dim() const;
79 inline uint nelm() const;
81 inline Scan* scan() const;
84
85 inline uint dim();
86 inline uint nelm();
88 inline Scan* scan();
91
92 virtual void adjust(const concepts::Element<Real>& elm,
94
95 inline concepts::BoundaryConditions* boundary() { return bc_;}
96
113 void rebuild();
118 protected:
119 virtual std::ostream& info(std::ostream& os) const;
120 private:
122 concepts::Mesh2& msh_;
126 bool trunk_;
127
132 bool rebuild_;
133
135 uint dim_;
136
138 uint nelm_;
139
142
148 std::unordered_map<uint, concepts::AdaptiveControlP<2> > ctrl2_;
149
151 std::map<uint, concepts::CellData> cellList_;
153 std::map<uint, concepts::EdgeData> edgeList_;
154
157 /* Linked list of cells, created for handling subdivision
158 in 4 quadrilaterials, which lie between the four children
159 and the father
160 */
162 /* list of edges, created for handling subdivision
163 in 4 quadrilaterials, which lie between the four children
164 and the father
165 */
166 std::set<uint> interEdges_;
167
170
172 std::unique_ptr<concepts::SMatrix1D>
173 S1left_t_, S1right_t_, S1left_n_, S1right_n_;
174 // --> allgemein (mit hp2D) schreiben als C-Array oder Liste
175 // QuadEdgeFunctions kann hineinschreiben
176
179 std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices2H_X_[2];
180 std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices2H_Y_[2];
181 std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices2V_X_[2];
182 std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices2V_Y_[2];
183
187 std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices2H_[2];
191 std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices2V_[2];
195 std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices4_[4];
196
217 void meshAndPoly_(concepts::Quad2d& cell, concepts::Level<2>& L, int* P);
218
223 void enforceBC_(concepts::Quad2d& cell);
224
226 void createCellList_(const concepts::Connector& cntr,
227 const concepts::CellData* father);
229 void createEdgList_(const concepts::Cell2& cell);
230
245 void enrichElm_(const concepts::Quad2d& cell, int* p);
246
256 void minimumRule_(const concepts::Connector2& cntr,
257 const concepts::Connector1& edge);
258
273 void buildTColumns_(const concepts::Quad& cntr, ushort* Pmax,
275
278 const concepts::Quad& cntr,
279 const uint* nn);
280
283 const concepts::Quad& cntr,
284 const uint* nn);
285
293 void buildElements_(concepts::Quad2d& cell);
294
299 void computePmax_(const concepts::Connector2& cntr, ushort Pmax[2]) const;
300
307 void edgeOrientation_(const concepts::Connector2& cntr, const uint i,
308 uint& pIndex) const;
309
319 void recomputeSmatrices_(const ushort* p, const uint* nn);
320
321 void deactivate_(concepts::Edge& edg);
322 void deactivate_(concepts::Vertex& vtx);
323
334 void nonactiveRegion_();
335
337 bool activeCell_(concepts::Cell& cell);
338
342 void status_();
343 void matlabstatus_();
344 };
345
346 uint Space::dim() const {
347 if (rebuild_) throw conceptsException(concepts::SpaceNotBuilt());
348 return dim_;
349 }
350
351 uint Space::nelm() const {
352 if (rebuild_) throw conceptsException(concepts::SpaceNotBuilt());
353 return nelm_;
354 }
355
357 if (rebuild_) throw conceptsException(concepts::SpaceNotBuilt());
358 return new concepts::PListScan<hp2D::Element<Real> >(*elm_);
359 }
360
365
366 uint Space::dim() {
367 if (rebuild_) rebuild();
368 return dim_;
369 }
370
371 uint Space::nelm() {
372 if (rebuild_) rebuild();
373 return nelm_;
374 }
375
377 if (rebuild_) rebuild();
378 return new concepts::PListScan<hp2D::Element<Real> >(*elm_);
379 }
380
385
386} // namespace hp2Dedge
387
388#endif // hpSpace2Dedge_hh
#define conceptsException(exc)
Two dimensional cell.
Definition cell.hh:89
Scan * scan() const
scanner over the cells of the coarsest mesh
Definition space.hh:356
void recomputeShapefunctions()
virtual uint getOutputDimension() const
Returns the default output dimension, when we consider plotting a real-valued operator on this space.
Definition space.hh:74
uint nelm() const
Returns the number of elements in the space.
Definition space.hh:351
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
uint dim() const
Returns the dimension of the space.
Definition space.hh:346
concepts::Scan< const concepts::Quad > * interScan() const
scanner over the intermediate cells
Definition space.hh:361
Space(concepts::Mesh2 &msh, uint l, uint p, concepts::BoundaryConditions *bc=0, bool trunk=false)
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320