Class documentation of Concepts

Loading...
Searching...
No Matches
space.hh
Go to the documentation of this file.
1
6#ifndef hpSpace3D_hh
7#define hpSpace3D_hh
8
9#include <memory>
10#include <map>
11#include <cstring>
12#include "basics/exceptions.hh"
13#include "basics/typedefs.hh"
14#include "basics/level.hh"
15#include "toolbox/hashMap.hh"
16#include "space/space.hh"
17#include "space/hpMethod.hh"
18#include "space/smatrix.hh"
20#include "geometry/cell3D.hh"
21#include "geometry/mesh.hh"
23#include "geometry/cellConditions.hh"
25#include "element.hh"
26
27namespace concepts {
28
29 // forward declaration
30 class InOutParameters;
31
32 // ****************************************************************** Scan **
33
34 template<>
35 class Scan<hp3D::Element<Real> > :
36 public concepts::Scan<concepts::ElementWithCell<Real> > {
37 public:
39 };
40
41} // namespace concepts
42
43namespace hp3D {
44 using concepts::Real;
45
46 // forward declarations
47 class Hexahedron;
48 class BuildDofsBase;
49 class TraceSpace;
50
51 // ***************************************************************** Space **
52
82 class Space :
83 public concepts::SpaceOnCells<Real>,
84 public concepts::AdaptiveSpace<Real, concepts::AdaptiveAdjustP<3> > {
85 friend class BuildDofsBase;
86 public:
89
101 Space(concepts::Mesh3& msh, uint l, uint p,
104 Space(const Space& spc);
105 virtual ~Space();
106
107 inline virtual uint dim() const;
108 inline virtual uint nelm() const;
109 inline virtual Scan* scan() const;
110 inline virtual const concepts::BoundaryConditions* bc() const;
111
112 inline uint dim();
113 inline uint nelm();
114 inline Scan* scan();
115 inline const concepts::BoundaryConditions* bc();
116
117
118 inline void getPmax(const concepts::Hexahedron& cntr,
119 ushort Pmax[3]) const{
120 getPmax_(cntr,Pmax);
121 }
122
123
124 void setDim(uint dim);
125
126 virtual void adjust(const concepts::Element<Real>& elm,
128
167
169 const std::unique_ptr<concepts::SMatrixBase<Real> >*
171
178 void recomputeSmatrices(const Hexahedron* elm) const;
179
184
220 static bool timings();
222
259 protected:
260 virtual std::ostream& info(std::ostream& os) const;
261 private:
263 concepts::Mesh3& msh_;
271 bool rebuild_;
272
274 uint dim_;
276 uint nelm_;
279 concepts::Joiner<Element<Real>*, 1>* endElm_;
281 std::unordered_map<uint, concepts::AdaptiveControl<> > ctrl0_;
283 std::unique_ptr<std::unordered_map<uint,
286 std::unique_ptr<std::unordered_map<uint,
289 std::unordered_map<uint, concepts::AdaptiveControlP<3> > ctrl3_;
291 std::unordered_map<uint, concepts::AdaptiveControlP<3> > pMax_;
292
294 std::map<uint, concepts::CellData> cellList_;
296 std::map<uint, concepts::FaceData> faceList_;
298 std::map<uint, concepts::EdgeData> edgeList_;
300 std::map<uint, concepts::VertexData> vertexList_;
301
303 std::unordered_map<uint, concepts::AdaptiveAdjustP<3> > adj_;
304
306 mutable std::unique_ptr<concepts::SMatrix1D> S1left_, S1right_;
310 mutable std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices8_[8];
314 mutable std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices4x_[4],
315 Smatrices4y_[4], Smatrices4z_[4];
319 mutable std::unique_ptr<concepts::SMatrixBase<Real> > Smatrices2x_[2],
320 Smatrices2y_[2], Smatrices2z_[2];
321
323 static concepts::InOutParameters* timings_;
325 static uint timeCntr_;
326
330 std::unique_ptr<BuildDofsBase> buildVertexDofs_;
334 std::unique_ptr<BuildDofsBase> buildEdgeDofs_;
338 std::unique_ptr<BuildDofsBase> buildFaceDofs_;
342 std::unique_ptr<BuildDofsBase> buildInnerDofs_;
343
364 void meshAndPoly_(concepts::Hexahedron3d& cell,
365 concepts::Level<3>& L, int* P);
366
371 void enforceBC_(concepts::Hexahedron3d& cell);
372
379 void enforceCC_(concepts::Hexahedron3d& cell);
380
388 void createCellList_(const concepts::Connector& cntr,
389 const concepts::CellData* father);
397 void createEdgFaceList_(const concepts::Cell3& cell);
403 void createVtxEdgList_(const concepts::Cell3& cell);
404
420 void enrichElm_(const concepts::Hexahedron3d& cell, int* p);
421
435 void buildElements_(concepts::Hexahedron3d& cell,
436 ushort* Pmax,
438
442 void getPmax_(const concepts::Hexahedron& cntr,
443 ushort Pmax[3]) const;
444
449 void computePmax_(const concepts::Hexahedron& cntr,
450 ushort Pmax[3]) const;
451
455 void deactivate_(const concepts::Connector2& face);
459 void deactivate_(const concepts::Connector1& edg);
461 void deactivate_(const concepts::Connector0& vtx);
468 void doCorrectRefinement_(concepts::Hexahedron3d& cell,
469 concepts::Level<3>& L) const;
470 };
471
472 uint Space::dim() const {
473 if (rebuild_) throw conceptsException(concepts::SpaceNotBuilt());
474 return dim_;
475 }
476
477 uint Space::nelm() const {
478 if (rebuild_) throw conceptsException(concepts::SpaceNotBuilt());
479 return nelm_;
480 }
481
483 if (rebuild_) throw conceptsException(concepts::SpaceNotBuilt());
484 return new concepts::PListScan<Element<Real> >(*elm_);
485 }
486
487 const concepts::BoundaryConditions* Space::bc() const{
488 if (rebuild_) throw conceptsException(concepts::SpaceNotBuilt());
489 return bc_;
490 }
491
492 uint Space::dim() {
493 if (rebuild_) rebuild();
494 return dim_;
495 }
496
497 uint Space::nelm() {
498 if (rebuild_) rebuild();
499 return nelm_;
500 }
501
502 Space::Scan* Space::scan() {
503 if (rebuild_) rebuild();
504 return new concepts::PListScan<Element<Real> >(*elm_);
505 }
506
507 const concepts::BoundaryConditions* Space::bc(){
508 if (rebuild_) rebuild();
509 return bc_;
510 }
511
512} // namespace hp3d
513
514#include "buildDofsBase.hh"
515
516#endif // hpElement3d_h
#define conceptsException(exc)
Three dimensional cell.
Definition cell.hh:112
hp3D::Element< Real > & operator++(int)=0
Returns the next element in the scanned set.
static bool timings()
virtual uint nelm() const
Returns the number of elements in the space.
Definition space.hh:477
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
const std::unique_ptr< concepts::SMatrixBase< Real > > * getSmatrices(const concepts::Hex3dSubdivision *subdiv) const
Returns the list of matrices matching the subdivision type subdiv.
void recomputeShapefunctions()
void buildVertexDofs(const BuildDofsBase &b)
virtual Scan * scan() const
Returns a scanner to iterate over the elements of the space.
Definition space.hh:482
Space rebuild()
void buildEdgeDofs(const BuildDofsBase &b)
Space(const Space &spc)
Copy constructor.
static void setTimings(concepts::InOutParameters *timings)
void buildInnerDofs(const BuildDofsBase &b)
void recomputeSmatrices(const Hexahedron *elm) const
virtual uint dim() const
Returns the dimension of the space.
Definition space.hh:472
Space(concepts::Mesh3 &msh, uint l, uint p, concepts::BoundaryConditions *bc=0, concepts::CellConditions *cc=0)
void buildFaceDofs(const BuildDofsBase &b)
double Real
Definition typedefs.hh:39
Definition meshDX.hh:23