ScalarField3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: ScalarField3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Abstract base class for 3-D scalar field.
6 > Created Time: 2017/03/14
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_SCALAR_FIELD3_H
10 #define CUBBYFLOW_SCALAR_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 ScalarField3 : public Field3
22  {
23  public:
25  ScalarField3();
26 
28  virtual ~ScalarField3();
29 
31  virtual double Sample(const Vector3D& x) const = 0;
32 
34  virtual Vector3D Gradient(const Vector3D& x) const;
35 
37  virtual double Laplacian(const Vector3D& x) const;
38 
40  virtual std::function<double(const Vector3D&)> Sampler() const;
41  };
42 
44  using ScalarField3Ptr = std::shared_ptr<ScalarField3>;
45 }
46 
47 #endif
3-D vector class.
Definition: Vector3.h:26
virtual std::function< double(const Vector3D &)> Sampler() const
Returns sampler function object.
std::shared_ptr< ScalarField3 > ScalarField3Ptr
Shared pointer for the ScalarField3 type.
Definition: ScalarField3.h:44
virtual ~ScalarField3()
Default destructor.
virtual double Sample(const Vector3D &x) const =0
Returns sampled value at given position x.
Abstract base class for 3-D fields.
Definition: Field3.h:17
Definition: pybind11Utils.h:24
virtual Vector3D Gradient(const Vector3D &x) const
Returns gradient vector at given position x.
Abstract base class for 3-D scalar field.
Definition: ScalarField3.h:21
ScalarField3()
Default constructor.
virtual double Laplacian(const Vector3D &x) const
Returns Laplacian at given position x.