space.hh

Go to the documentation of this file.
1 
6 #ifndef Space1D_hh
7 #define Space1D_hh
8 
9 #include "basics/exceptions.hh"
10 #include "basics/typedefs.hh"
11 #include "geometry/mesh.hh"
13 #include "space/space.hh"
14 #include "space/hpMethod.hh"
16 #include "toolbox/dynArray.hh"
17 #include "element.hh"
18 
19 namespace hp1D {
20  using concepts::Real;
21 
22  // ***************************************************************** Space **
23 
27  class Space :
28  public concepts::SpaceOnCells<Real>,
29  public concepts::AdaptiveSpace<Real, concepts::AdaptiveAdjustP<1> > {
30  public:
32 
43  Space(concepts::Mesh1& msh, uint l, uint p,
45  virtual ~Space();
46 
47  inline uint dim() const;
48  inline uint nelm() const;
49  inline Scan* scan() const;
50 
51  inline uint dim();
52  inline uint nelm();
53  inline Scan* scan();
54 
55  virtual void adjust(const concepts::Element<Real>& elm,
57 
59  void rebuild();
60 
65  protected:
66  virtual std::ostream& info(std::ostream& os) const;
67  private:
72 
77  bool rebuild_;
78 
80  uint dim_;
81 
83  uint nelm_;
84 
87 
92 
95 
96  void meshAndPoly_(concepts::EdgeNd& cell, int l, int& L, int& P);
98  concepts::TColumn<Real>* T0 = 0);
100  };
101 
102  uint Space::dim() const {
104  return dim_;
105  }
106 
107  uint Space::nelm() const {
109  return nelm_;
110  }
111 
114  return new concepts::PListScan<BaseElement<Real> >(*elm_);
115  }
116 
117  uint Space::dim() {
118  if (rebuild_) rebuild();
119  return dim_;
120  }
121 
122  uint Space::nelm() {
123  if (rebuild_) rebuild();
124  return nelm_;
125  }
126 
128  if (rebuild_) rebuild();
129  return new concepts::PListScan<BaseElement<Real> >(*elm_);
130  }
131 
132 } // namespace hp1D
133 
134 #endif // Space1D_hh
virtual ~Space()
A column of a T matrix.
Definition: analytical.hh:18
concepts::BoundaryConditions * bc_
Boundary conditions.
Definition: space.hh:71
void buildElements_(concepts::EdgeNd &cell, concepts::TColumn< Real > *T0=0)
A 1D hp FEM space with continuous, picewise polynomial basis functions.
Definition: space.hh:29
uint nelm() const
Definition: space.hh:107
#define conceptsException(exc)
Prepares an exception for throwing.
Definition: exceptions.hh:344
virtual std::ostream & info(std::ostream &os) const
Container class: a dynamic array.
Definition: mesh.hh:30
concepts::Joiner< BaseElement< Real > *, 1 > * elm_
Linked list of the elements.
Definition: space.hh:86
Joiner class with multiple successors, i.e.
An abstract class for 1D meshes.
Definition: mesh.hh:94
Space(concepts::Mesh1 &msh, uint l, uint p, concepts::BoundaryConditions *bc=0)
Constructor.
Scan * scan() const
Definition: space.hh:112
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
void meshAndPoly_(concepts::EdgeNd &cell, int l, int &L, int &P)
uint nelm_
Number of elements currently active in the mesh.
Definition: space.hh:83
uint dim() const
Definition: space.hh:102
Indicates that the space on which a function was called was not yet correctly built.
Definition: space.hh:36
concepts::Scan< BaseElement< Real > > Scan
Definition: space.hh:31
A 1D cell in any dimension: edge.
Definition: cell1D.hh:32
concepts::Mesh1 & msh_
Mesh.
Definition: space.hh:69
Abstract class for a space.
Definition: space.hh:81
concepts::DynArray< concepts::AdaptiveAdjustP< 1 > > adj_
Hash table of the adjustment information of the elements.
Definition: space.hh:94
concepts::DynArray< concepts::AdaptiveControl<> > ctrl0_
Hash table of the control information for the vertices.
Definition: space.hh:89
virtual void adjust(const concepts::Element< Real > &elm, const concepts::AdaptiveAdjustP< 1 > &a)
uint dim_
Dimension of the FE space.
Definition: space.hh:80
Abstract base class for an adaptive space.
Definition: space.hh:350
concepts::DynArray< concepts::AdaptiveControlP< 1 > > ctrl1_
Hash table of the control information for the 1D elements.
Definition: space.hh:91
void recomputeShapefunctions()
Recompute shape functions, e.g.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
bool rebuild_
If true: the elements have to be rebuilt.
Definition: space.hh:77
void enforceBC_(concepts::EdgeNd &cell)
void rebuild()
Rebuilds the space after an adjustment with adjust.
Scanner for a list of pointers.
1D hp-FEM
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich