space.hh

Go to the documentation of this file.
1 
6 #ifndef linDG1Dspace_hh
7 #define linDG1Dspace_hh
8 
9 #include <iostream>
10 
11 #include "basics/typedefs.hh"
12 #include "space/space.hh"
13 #include "space/elementPairs.hh"
14 #include "linearFEM/element1D.hh"
15 #include "linearFEM/space1D.hh"
17 
18 namespace concepts {
19 
20  // forward declarations
21  class Mesh1;
22 
23 } // namespace concepts
24 
25 namespace linDG1D {
26 
27  using concepts::Real;
28 
29  // ************************************************************** Linear1d **
30 
34  class Linear1d : public concepts::Space<Real> {
35  public:
37  typedef void (*SMap)(const concepts::TColumn<Real>&,
44  Linear1d(concepts::Mesh1& msh, uint level);
45  virtual ~Linear1d();
46  virtual uint dim() const { return dim_; }
47  virtual uint nelm() const { return nelm_; }
48  virtual Scan* scan() const
51  { return elmPair_; }
52  protected:
53  virtual std::ostream& info(std::ostream& os) const;
54  private:
56  uint dim_;
58  uint nelm_;
83  void constructor_(concepts::Cell1& cell, uint level);
84 
86  struct TwoElements {
87  TwoElements() { elms[0] = 0; elms[1] = 0; }
88  void addElm(const linearFEM::Line* elm, const uint idx) {
90  if (elms[0] == 0) {
91  elms[0] = elm;
92  idxs[0] = idx;
93  }
94  else {
95  elms[1] = elm;
96  idxs[1] = idx;
97  }
98  }
99  const linearFEM::Line* elms[2];
100  uint idxs[2];
101  };
102  };
103 
104 } // namespace linDG1D
105 
106 #endif // linDG1Dspace_hh
A column of a T matrix.
Definition: analytical.hh:18
virtual ~Linear1d()
Linear1d(concepts::Mesh1 &msh, uint level)
Constructor.
virtual uint nelm() const
Definition: space.hh:47
Abstract class for a space.
uint nelm_
Number of elements.
Definition: space.hh:58
void constructor_(concepts::Cell1 &cell, uint level)
Assigns the degrees of freedom and creates elements.
concepts::Mesh1 & msh_
Mesh which this space is based on.
Definition: space.hh:60
#define conceptsAssert(cond, exc)
Assert that a certain condition is fulfilled.
Definition: exceptions.hh:394
uint dim_
Number of degrees of freedom.
Definition: space.hh:56
virtual std::ostream & info(std::ostream &os) const
An abstract class for 1D meshes.
Definition: mesh.hh:94
One dimensional cell.
Definition: cell.hh:75
const concepts::ElementPairList< Real > & elmPairs() const
Definition: space.hh:50
Exception class for assertions.
Definition: exceptions.hh:258
concepts::Joiner< linearFEM::Line *, 1 > * elm_
List of elements.
Definition: space.hh:62
Space for linear DG FEM in 1D.
Definition: space.hh:34
virtual Scan * scan() const
Definition: space.hh:48
DG FEM for 1D problems using piecewise linear shape functions.
Definition: bilinearForm.hh:13
void(* SMap)(const concepts::TColumn< Real > &, concepts::TColumn< Real > &)
Definition: space.hh:37
Data structure used for temporary data to generate DGElementPair.
Definition: space.hh:86
Line element with linear shape function in 1D.
Definition: element1D.hh:34
concepts::ElementPairList< Real > elmPair_
List of element pairs.
Definition: space.hh:73
virtual uint dim() const
Definition: space.hh:46
void addElm(const linearFEM::Line *elm, const uint idx)
Definition: space.hh:88
concepts::Scan< linearFEM::Line > Scan
Definition: space.hh:36
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Scanner for a list of pointers.
const linearFEM::Line * elms[2]
Definition: space.hh:99
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich