VelocityExtFromVelocityField.h 2.46 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef VELOCITYEXTFROMVELOCITYFIELD_H
#define VELOCITYEXTFROMVELOCITYFIELD_H

#include "AdaptInfo.h"
#include "BasisFunction.h"
#include "DOFVector.h"
#include "ElInfo.h"
#include "NormEps.h"
#include "VelocityExt.h"

using namespace AMDiS;

/////////////////////////////////////////////////////////////////////////////
//  c l a s s   V e l o c i t y E x t F r o m V e l o c i t y F i e l d    //
/////////////////////////////////////////////////////////////////////////////
class VelocityExtFromVelocityField : public VelocityExt
{
18
public:
19
20
21

  VelocityExtFromVelocityField(int dim_)
    : VelocityExt(dim_),
22
23
24
      lSFct(NULL),
      elNormalVel(dim_, NO_INIT),
      basFcts(NULL)
25
26
  {
    FUNCNAME("VelocityExtFromVelocityField::VelocityExtFromVelocityField()");
27
    
28
    lSFctVal.change_dim(dim + 1);
29
    
30
31
    // ===== set epsilon for norm regularization =====
    NormEps::setEps();
32
  }
33
34

  ~VelocityExtFromVelocityField()
35
  {}
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

  /**
   * Set velocity field.
   */
  void setVelocityField(std::vector<DOFVector<double> *> &velField_,
			const DOFVector<double> *lSFct_,
			DOFVector<double> *velDOF_)
  {
    FUNCNAME("VelocityExtFromVelocityField::setVelocityField()");

    nVelDOFs = 1;

    velField = velField_;
    lSFct = lSFct_;
    velDOF.clear();
    velDOF.push_back(velDOF_);
    origVelDOF.clear();

    TEST_EXIT(lSFct)("level set function not defined !\n");
    TEST_EXIT((int)velField.size() == dim)("illegal velocity field !\n");
56
    TEST_EXIT(lSFct->getFeSpace() == velDOF_->getFeSpace())
57
58
      ("different feSpaces !\n");

59
    basFcts = lSFct->getFeSpace()->getBasisFcts();
60
61
62
63
64
65
66
67
68
69
70
  };

  /**
   * Adaption of VelocityExt::calcVelocityBoundary().
   * Used to initialize normal velocity at interface elements.
   */
  void calcVelocityBoundary(DegreeOfFreedom *locInd, const int indexV);

  /**
   * Sets elInfo.
   */
71
72
  inline void setElInfo(ElInfo *elInfo_) 
  {
73
    elInfo = elInfo_;
74
  }
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

 protected:
  /**
   * Velocity field at interface.
   */
  std::vector<DOFVector<double> *> velField;

  /**
   * Interface is zero level set of level set function lSFct.
   */
  const DOFVector<double> *lSFct;

  /**
   * Normal velocity on a single element. Used to set normal velocity
   * in velDOF on interface elements.
   */
  DimVec<double> elNormalVel;

93
94
  /// Values of level set function in vertices of element.
  ElementVector lSFctVal;
95

96
  /// Basis functions.
97
98
  const BasisFunction *basFcts;

99
  /// ElInfo used in calcVelocityBoundary().
100
101
102
103
  ElInfo *elInfo;
};

#endif  // VELOCITYEXTFROMVELOCITYFIELD_H