VectorField3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: VectorField3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Abstract base class for 3-D vector field.
6 > Created Time: 2017/03/14
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_VECTOR_FIELD3_H
10 #define CUBBYFLOW_VECTOR_FIELD3_H
11 
12 #include <Core/Field/Field3.h>
13 #include <Core/Vector/Vector3.h>
14 
15 #include <functional>
16 #include <memory>
17 
18 namespace CubbyFlow
19 {
21  class VectorField3 : public Field3
22  {
23  public:
25  VectorField3();
26 
28  virtual ~VectorField3();
29 
31  virtual Vector3D Sample(const Vector3D& x) const = 0;
32 
34  virtual double Divergence(const Vector3D& x) const;
35 
37  virtual Vector3D Curl(const Vector3D& x) const;
38 
40  virtual std::function<Vector3D(const Vector3D&)> Sampler() const;
41  };
42 
44  using VectorField3Ptr = std::shared_ptr<VectorField3>;
45 }
46 
47 #endif
3-D vector class.
Definition: Vector3.h:26
virtual std::function< Vector3D(const Vector3D &)> Sampler() const
Returns sampler function object.
virtual ~VectorField3()
Default destructor.
std::shared_ptr< VectorField3 > VectorField3Ptr
Shared pointer for the VectorField3 type.
Definition: VectorField3.h:44
Abstract base class for 3-D fields.
Definition: Field3.h:17
virtual Vector3D Sample(const Vector3D &x) const =0
Returns sampled value at given position x.
virtual double Divergence(const Vector3D &x) const
Returns divergence at given position x.
Definition: pybind11Utils.h:24
virtual Vector3D Curl(const Vector3D &x) const
Returns curl at given position x.
Abstract base class for 3-D vector field.
Definition: VectorField3.h:21
VectorField3()
Default constructor.