Am Montag, 13. Mai 2022, finden Wartungsarbeiten am Gitlab-Server (Update auf neue Version statt). Der Dienst wird daher am Montag für einige Zeit nicht verfügbar sein.
On Monday, May 13th 2022, the Gitlab server will be updated. The service will therefore not be accessible for some time on Monday.

DirichletBC.h 4.09 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \file DirichletBC.h */

#ifndef AMDIS_DIRICHLETBC_H
#define AMDIS_DIRICHLETBC_H

#include "BoundaryCondition.h"
#include "AbstractFunction.h"

namespace AMDiS {

  template<typename T> class DOFVectorBase;
  class ElInfo;

  // ============================================================================
  // ===== class DirichletBC ==================================================== 
  // ============================================================================

  /**
   * \ingroup Assembler
   *
   * \brief
   * Sub class of BoundaryCondition. Implements Dirichlet boundary conditions.
   * A DOFVectors is set to a given value at a Dirichlet dof and in a DOFMatrix
   * the row corresponding to a Dirichlet dof is replaced by a row containing
   * only a 1.0 in the diagonal.
   */
  class DirichletBC : public BoundaryCondition
  {
  public:
    /** \brief
     * Constructor.
     */
    DirichletBC(BoundaryType                                    type,
		AbstractFunction<double, WorldVector<double> > *fct,
54
55
56
57
58
		FiniteElemSpace                                *rowFESpace,
		FiniteElemSpace                                *colFESpace = NULL)
      : BoundaryCondition(type, rowFESpace, colFESpace), 
        f(fct), 
        dofVec(NULL)
59
60
61
62
63
    {};

    /** \brief
     * Constructor.
     */
64
    DirichletBC(BoundaryType          type,
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
		DOFVectorBase<double> *vec);

    /** \brief
     * Implementation of BoundaryCondition::fillBoundaryCondition().
     */
    void fillBoundaryCondition(DOFMatrix*     matrix,
			       ElInfo*                elInfo,
			       const DegreeOfFreedom* dofIndices,
			       const BoundaryType*    localBound,
			       int                    nBasFcts);
  
    /** \brief
     * Implementation of BoundaryCondition::fillBoundaryCondition().
     */
    void fillBoundaryCondition(DOFVectorBase<double>*     vector, 
			       ElInfo*                elInfo,
			       const DegreeOfFreedom* dofIndices,
			       const BoundaryType*    localBound,
			       int                    nBasFcts);

    /** \brief
     * Implementation of BoundaryCondition::boundResidual().
     */
    double boundResidual(ElInfo*, 
			 DOFMatrix *,
90
91
92
			 const DOFVectorBase<double>*) { 
      return 0.0; 
    };
93

94
95
96
    bool isDirichlet() { 
      return true; 
    };
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

    inline AbstractFunction<double, WorldVector<double> > *getF() {
      return f;
    };

    inline DOFVectorBase<double> *getDOFVector() {
      return dofVec;
    };

  protected:
    /** \brief
     * Function which is evaluated at world coords of Dirichlet dofs.
     */
    AbstractFunction<double, WorldVector<double> > *f;

    /** \brief
     * DOFVector containing the boundary values
     */
    DOFVectorBase<double> *dofVec;
  };

}

#endif