39#ifndef YL_ADVECTION_HH_INCLUDED
40#define YL_ADVECTION_HH_INCLUDED
64 template <
class TVisitor>
67 const Point3df& start_point)
const;
77 virtual void first(
const Point3df& point) = 0;
79 virtual void visit(
const Point3df& point) = 0;
81 virtual bool move_on(
const Point3df& point)
const = 0;
106 m_max_iter = max_iter;
118 m_verbose = verbosity;
127 virtual void move_one_step(Point3df& point,
128 const Point3df& local_field)
const = 0;
132 unsigned int m_max_iter;
153 virtual void move_one_step(Point3df& point,
154 const Point3df& local_field)
const;
Thrown by move_one_step() to abort the advection.
virtual void abort()
Called when the advection cannot finish successfully.
virtual bool move_on(const Point3df &point) const =0
Predicate that decides if the advection will continue or stop.
virtual void visit(const Point3df &point)=0
Called for every point on the advection path, including the first.
virtual void finished(const Point3df &)
Called after the advection is stopped by move_on()
virtual void first(const Point3df &point)=0
Called before visit() on the first point of the advection path.
void set_verbose(int verbosity)
Set the verbosity level (output to stderr)
virtual bool aborted() const =0
Indicates whether the Visitor encountered an error.
void set_verbose(const int verbosity)
Set the verbosity level (output to stderr)
Advection(const VectorField3d &advection_field)
bool visitor_advection(TVisitor &visitor, const Point3df &start_point) const
Advect a visitor along a vector field.
void set_max_iter(unsigned int max_iter)
Set the maximum number of iterations.
static const unsigned int default_max_iter
Default iteration limit.
void set_step(float step)
Change the step length.
ConstantStepAdvection(const yl::VectorField3d &advection_field, float step)
virtual ~ConstantStepAdvection()
Store a vector field and access it at any coordinates.