RobinBC.h 4.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \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
48
49
50
    RobinBC(BoundaryType type,
	    AbstractFunction<double, WorldVector<double> > *j,
	    AbstractFunction<double, WorldVector<double> > *alpha,
	    FiniteElemSpace *rowFESpace,
	    FiniteElemSpace *colFESpace = NULL);

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

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

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
93
94
95
96
97
98
99
100
    DimVec<SurfaceOperator*>* robinOperators;

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

  class NeumannBC : public RobinBC
  {
  public:
    NeumannBC(BoundaryType type,
	      AbstractFunction<double, WorldVector<double> > *j,
	      FiniteElemSpace *rowFESpace,
	      FiniteElemSpace *colFESpace = NULL)
      : RobinBC(type, j, NULL, rowFESpace, colFESpace)
101
    {}
102
103
104
105
106
  };

}

#endif