Operator.hpp 2.19 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#pragma once

#include <list>

#include "OperatorTerm.hpp"

namespace AMDiS
{
  template <class MeshView>
  class Operator
  {
    using Self = Operator;
    using OperatorTermType = OperatorTerm<MeshView>;
    
  public:
16
17
18
19
    template <class RowFeSpace, class ColFeSpace>
    void init(RowFeSpace const& rowFeSpace,
	      ColFeSpace const& colFeSpace);
      
20
21
22
23
24
25
26
27
28
    template <class RowView, class ColView, class ElementMatrix>
    void getElementMatrix(RowView const& rowView,
			  ColView const& colView,
			  ElementMatrix& elementMatrix);
    
    template <class RowView, class ElementVector>
    void getElementVector(RowView const& rowView,
			  ElementVector& elementVector);
    
29
30
    template <class Term>
    Self& addZOT(Term const& term)
31
    {
32
33
	zeroOrder.push_back(new GenericOperatorTerm<MeshView, Term>(term));
	return *this;
34
35
    }
    
36
37
    template <class Term>
    Self& addSOT(Term const& term)
38
    {
39
40
	secondOrder.push_back(new GenericOperatorTerm<MeshView, Term>(term));
	return *this;
41
42
43
44
45
46
47
48
49
50
51
52
53
    }
    

    /// Calculates the needed quadrature degree for the given order.
    int getQuadratureDegree(int order/*, FirstOrderType firstOrderType = GRD_PHI*/);
    
    
  protected:
    template <class RowView, class ColView, class ElementMatrix>
    void assembleZeroOrderTerms(RowView const& rowView,
				ColView const& colView,
				ElementMatrix& elementMatrix);
    
54
55
56
57
    template <class RowView, class ElementVector>
    void assembleZeroOrderTerms(RowView const& rowView,
				ElementVector& elementVector);
    
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    template <class RowView, class ColView, class ElementMatrix>
    void assembleSecondOrderTerms(RowView const& rowView,
				  ColView const& colView,
				  ElementMatrix& elementMatrix);
    
  private:
      /// List of all second order terms
      std::list<OperatorTermType*> secondOrder;

      /// List of all first order terms derived to psi
      std::list<OperatorTermType*> firstOrderGrdPsi;

      /// List of all first order terms derived to phi
      std::list<OperatorTermType*> firstOrderGrdPhi;

      /// List of all zero order terms
      std::list<OperatorTermType*> zeroOrder;
75
76
77
      
      int psiDegree = 1;
      int phiDegree = 1;
78
79
80
81
82
  };
  
} // end namespace AMDiS

#include "Operator.inc.hpp"