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.26 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/******************************************************************************
 *
 * AMDiS - Adaptive multidimensional simulations
 *
 * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
 * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
 *
 * Authors: 
 * Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 *
 * This file is part of AMDiS
 *
 * See also license.opensource.txt in the distribution.
 * 
 ******************************************************************************/
20 21


22 23 24 25 26 27 28 29

/** \file BoundaryCondition.h */

#ifndef AMDIS_BOUNDARYCONDITION_H
#define AMDIS_BOUNDARYCONDITION_H

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

namespace AMDiS {

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

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

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

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

74
    virtual void initMatrix(DOFMatrix*) {}
75

76
    virtual void exitMatrix(DOFMatrix*) {}
77

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

80
    virtual void exitVector(DOFVectorBase<double>*) {}
81

82 83
    /// Destructor.
    virtual ~BoundaryCondition() {}
84

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

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

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

124 125 126 127 128 129
    /// 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).
130 131 132 133 134
    virtual bool applyBoundaryCondition()
    {
      return true;
    }

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

141
    /// FiniteElemSpace for this BoundaryCondition.
142
    const FiniteElemSpace *rowFeSpace;
143

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

}

#endif