RobinBC.h 4.24 KB
Newer Older
1
2
3
4
5
6
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
7
// ==  TU Dresden                                                            ==
8
// ==                                                                        ==
9
10
11
// ==  Institut fr Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
12
13
14
15
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
16
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
17
18
19
20
21
22
23
24
25
26
27
// ==                                                                        ==
// ============================================================================

/** \file RobinBC.h */

#ifndef AMDIS_ROBINBC_H
#define AMDIS_ROBINBC_H

#include "BoundaryCondition.h"
#include "AbstractFunction.h"
#include "DOFMatrix.h"
28
#include "AMDiS.h"
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

namespace AMDiS {

  /** 
   * \ingroup Assembler
   *
   * \brief
   * Sub class of BoundaryCondition. Implements Robin and Neumann boundary conditions.
   * The flux in normal direction is given by \f$ j = j_0 + \alpha u\f$ where
   * \f$ j_0 \f$ and \f$ alpha \f$ are functions evaluated at world coordinates
   * and \f$ u \f$ is the problem solution.
   */
  class RobinBC : public BoundaryCondition
  {
  public:
44
    /// Constructor. \f$ j \f$ and \f$ alpha \f$ are given as AbstractFunction objects.
45
46
47
    RobinBC(BoundaryType type,
	    AbstractFunction<double, WorldVector<double> > *j,
	    AbstractFunction<double, WorldVector<double> > *alpha,
48
49
	    FiniteElemSpace *rowFeSpace,
	    FiniteElemSpace *colFeSpace = NULL);
50

51
    /// Constructor. \f$ j \f$ and \f$ alpha \f$ are given as DOFVectors.
52
53
54
    RobinBC(BoundaryType type,
	    DOFVectorBase<double> *j,
	    DOFVectorBase<double> *alpha,
55
56
	    FiniteElemSpace *rowFeSpace,
	    FiniteElemSpace *colFeSpace = NULL);
57

58
    /// Constructor. \f$ j \f$ and \f$ alpha \f$ are given as Operator objects.
59
60
    RobinBC(BoundaryType type,
	    Operator* jOp, Operator* alphaOp,
61
62
	    FiniteElemSpace *rowFeSpace,
	    FiniteElemSpace *colFeSpace = NULL);
63

64
65
66
    /// Implements BoundaryCondition::fillBoundaryCondition();
    virtual void fillBoundaryCondition(DOFMatrix* matrix,
				       ElInfo* elInfo,
67
				       const DegreeOfFreedom* dofIndices,
68
69
				       const BoundaryType* localBound,
				       int nBasFcts);
70
  
71
72
73
    /// Implements BoundaryCondition::fillBoundaryCondition();
    virtual void fillBoundaryCondition(DOFVectorBase<double>* vector, 
				       ElInfo* elInfo,
74
				       const DegreeOfFreedom* dofIndices,
75
76
				       const BoundaryType* localBound,
				       int nBasFcts);
77

78
    /// Implements BoundaryCondition::boundResidual();
79
80
81
82
83
    virtual double boundResidual(ElInfo *elInfo, 
				 DOFMatrix *matrix,
				 const DOFVectorBase<double> *dv);

  protected:
84
    /// Surface operators for each element side for the Neumann part.
85
86
    DimVec<SurfaceOperator*>* neumannOperators;

87
    /// Surface operators for each element side for the Robin part.
88
89
90
91
92
    DimVec<SurfaceOperator*>* robinOperators;

    VectorOfFixVecs<DimVec<double> >**coords;
  };

93

94
95
96
97
98
  class NeumannBC : public RobinBC
  {
  public:
    NeumannBC(BoundaryType type,
	      AbstractFunction<double, WorldVector<double> > *j,
99
100
101
	      FiniteElemSpace *rowFeSpace,
	      FiniteElemSpace *colFeSpace = NULL)
      : RobinBC(type, j, NULL, rowFeSpace, colFeSpace)
102
    {}
103
104
105
106
107
108
109

    NeumannBC(BoundaryType type,
	      DOFVectorBase<double> *j,
	      FiniteElemSpace *rowFeSpace,
	      FiniteElemSpace *colFeSpace = NULL)
      : RobinBC(type, j, NULL, rowFeSpace, colFeSpace)
    {}
110
111
112
113
114
  };

}

#endif