TranslateLsFct.h 846 Bytes
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
#ifndef AMDIS_TRANSLATELSFCT_H
#define AMDIS_TRANSLATELSFCT_H

#include "ElementFunction.h"
#include "FixVec.h"

using namespace AMDiS;

template<typename T>
class TranslateLsFct : public ElementFunction<T>
{
 public:
  /**
   * Constructor
   */
  TranslateLsFct(ElementFunction<T> *f_,
		 double c_)
    : ElementFunction<T>(),
    f(f_),
    c(c_)
  {};

  /** 
   * evaluation at given coordinates.
   *
   * Defines new level set function. Zero level set of this level set
   * function is level set c of level set function f.
   */
  const T& operator()(const DimVec<double>& bary) const {

    f->setElInfo(elInfo_);
    return ((*f)(bary) - c);
  }; 

 protected:
  /**
   * Level set function which is translated.
   */
  ElementFunction<T> *f;

  /**
   * Translation parameter. 
   */
  double c;
};

#endif  // AMDIS_TRANSLATELSFCT_H