Liebe Gitlab-Nutzerin, lieber Gitlab-Nutzer,
es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Die Konten der externen Nutzer:innen sind über den Reiter "Standard" erreichbar.
Die Administratoren


Dear Gitlab user,
it is now possible to log in to our service using the ZIH login/LDAP. The accounts of external users can be accessed via the "Standard" tab.
The administrators

BoundaryCondition.h 4.37 KB
Newer Older
1 2 3 4
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
5
// ==  http://www.amdis-fem.org                                              ==
6 7
// ==                                                                        ==
// ============================================================================
8 9 10 11 12 13 14 15 16 17 18 19
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.


20 21 22 23 24 25 26 27

/** \file BoundaryCondition.h */

#ifndef AMDIS_BOUNDARYCONDITION_H
#define AMDIS_BOUNDARYCONDITION_H

#include "Boundary.h"
#include "FiniteElemSpace.h"
28
#include "AMDiS_fwd.h"
29 30 31 32 33 34 35 36 37 38

namespace AMDiS {

  /**
   * \ingroup Assembler
   *
   * \brief
   * Sub class of BoundaryCondition. Local boundary conditions are filled
   * while mesh traversal.
   */
39
  class BoundaryCondition
40 41
  {
  public:
42
    /// Constructor.
43
    BoundaryCondition(BoundaryType type, 
44 45
		      const FiniteElemSpace *rowFeSpace_,
		      const FiniteElemSpace *colFeSpace_ = NULL) 
46
      : boundaryType(type),
47 48
	rowFeSpace(rowFeSpace_),
	colFeSpace(colFeSpace_)
49
    {
50 51
      if (!colFeSpace) 
	colFeSpace = rowFeSpace;
52
    }
53

54
    /// Returns \ref boundaryType.
55 56
    inline BoundaryType getBoundaryType() 
    { 
57 58
      return boundaryType; 
    }
59

60 61
    /// Returns \ref rowFeSpace.
    inline const FiniteElemSpace *getRowFeSpace() 
62
    { 
63
      return rowFeSpace; 
64
    }
65

66 67
    /// Returns \ref rowFeSpace.
    inline const FiniteElemSpace *getColFeSpace() 
68
    { 
69
      return colFeSpace; 
70
    }
71

72
    virtual void initMatrix(DOFMatrix*) {}
73

74
    virtual void exitMatrix(DOFMatrix*) {}
75

76
    virtual void initVector(DOFVectorBase<double>*) {}
77

78
    virtual void exitVector(DOFVectorBase<double>*) {}
79

80 81
    /// Destructor.
    virtual ~BoundaryCondition() {}
82

83 84 85
    /// Adds the local boundary condition for elInfo to object.
    /// The dofIndices and localBound as well as nBasFcts are determined by
    // the calling BoundaryManager.
86 87 88 89
    virtual void fillBoundaryCondition(DOFMatrix             *matrix,
				       ElInfo                *elInfo,
				       const DegreeOfFreedom *dofIndices,
				       const BoundaryType    *localBound,
90
				       int                    nBasFcts) {}
91
  
92 93 94
    /// Adds the local boundary condition for elInfo to vector.
    /// The dofIndices and localBound as well as nBasFcts are determined by
    /// the calling BoundaryManager.
95 96 97 98
    virtual void fillBoundaryCondition(DOFVectorBase<double>     *vector, 
				       ElInfo                *elInfo,
				       const DegreeOfFreedom *dofIndices,
				       const BoundaryType    *localBound,
99
				       int                    nBasFcts) {}
100
  
101
    /// Returns the boundary residual for the given element. Called by estimator.
102 103
    virtual double boundResidual(ElInfo *elInfo, 
				 DOFMatrix *matrix,
104 105 106 107
				 const DOFVectorBase<double> *dv) 
    { 
      return 0.0; 
    }
108

109 110
    /// Returns whether the condition must be treated as Dirichlet condition
    /// while assemblage.
111 112
    virtual bool isDirichlet() 
    { 
113 114
      return false; 
    }
115

116 117 118 119 120 121
    /// Returns whether the boundary condition is a periodic condition or not.
    virtual bool isPeriodic()
    {
      return false;
    }

122 123 124 125 126 127
    /// In some situations it may be required to set Dirichlet boundary 
    /// conditions, but not to apply them to the matrix. This is for example the
    /// case, if the boundary condition is set to a couple matrix. Then, the
    /// boundary conditions must be applied to the couple matrix, but they are
    /// set to all matrices in this row (to ensure that there are no other
    /// element entries in the Dirichlet boundary condition rows).
128 129 130 131 132
    virtual bool applyBoundaryCondition()
    {
      return true;
    }

133
  protected:
134 135 136
    /// Speciefies for which parts of the boundary the condition holds.
    /// This id corresponds to the boundary numbers spcified in the
    /// macro file. 
137 138
    BoundaryType boundaryType;

139
    /// FiniteElemSpace for this BoundaryCondition.
140
    const FiniteElemSpace *rowFeSpace;
141

142
    /// FiniteElemSpace for this BoundaryCondition.
143
    const FiniteElemSpace *colFeSpace;
144 145 146 147 148
  };

}

#endif