File: DirectionFunction.h

package info (click to toggle)
psurface 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 1,088 kB
  • ctags: 1,113
  • sloc: cpp: 12,339; makefile: 111; awk: 38
file content (37 lines) | stat: -rw-r--r-- 1,080 bytes parent folder | download | duplicates (3)
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
#ifndef PSURFACE_DIRECTION_FUNCTION_H
#define PSURFACE_DIRECTION_FUNCTION_H

#include "StaticVector.h"

namespace psurface {

/** \brief Abstract base class for direction fields on simplicial surfaces */
template <int dimworld, class ctype>
struct DirectionFunction
{
    virtual ~DirectionFunction() {};
};

/** \brief Abstract base class for direction fields that are given by closed-form expressions. 
*/
template <int dimworld, class ctype>
struct AnalyticDirectionFunction
    : public DirectionFunction<dimworld,ctype>
{
    /** \brief Return a direction for a given world position */
    virtual StaticVector<ctype,dimworld> operator()(const StaticVector<ctype,dimworld>& position) const = 0;
};

/** \brief Abstract base class for direction fields that are given per vertex.
*/
template <int dimworld, class ctype>
struct DiscreteDirectionFunction
    : public DirectionFunction<dimworld,ctype>
{
    /** \brief Return a direction for a given vertex index */
    virtual StaticVector<ctype,dimworld> operator()(size_t index) const = 0;
};

} // namespace psurface

#endif