-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
level_set_field.h
42 lines (34 loc) · 1.52 KB
/
level_set_field.h
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
#pragma once
#include <functional>
#include "drake/common/eigen_types.h"
namespace drake {
namespace multibody {
namespace hydroelastics {
namespace internal {
// TODO(SeanCurtis-TRI): The contents of this file are no longer used. Refactor
// this into geometry as appropriate.
// TODO(amcastro-tri): consider making this an abstract class so that we can
// inherit multiple implementations (analytical, structured grids, etc.)
// This class represents a level set function as the mapping
// `φ(p_FR): ℝ³ → ℝ` with `p_FR` the position vector for a point R in a frame
// F.
template <typename T>
struct LevelSetField {
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(LevelSetField)
// Constructs a level set field from user-defined functions for a level set
// and its gradient.
// These functions implicitly defines a frame F for the level set
// field. `level_set_F` defines the level set value at a point R from its
// position vector `p_FR` in F as `φ(R) ≡ level_set_F(p_FR)`.
// Similarly, `grad_level_set_F` is a function taking the position of point R
// in frame F, with the resulting gradient expressed in frame F.
LevelSetField(std::function<T(const Vector3<T>&)> level_set_F,
std::function<Vector3<T>(const Vector3<T>&)> grad_level_set_F)
: value(level_set_F), gradient(grad_level_set_F) {}
std::function<T(const Vector3<T>&)> value;
std::function<Vector3<T>(const Vector3<T>&)> gradient;
};
} // namespace internal
} // namespace hydroelastics
} // namespace multibody
} // namespace drake