Jet
v1.3.3
|
Implementation of 2-D semi-Lagrangian advection solver. More...
#include <jet/semi_lagrangian2.h>
Public Member Functions | |
SemiLagrangian2 () | |
virtual | ~SemiLagrangian2 () |
void | advect (const ScalarGrid2 &input, const VectorField2 &flow, double dt, ScalarGrid2 *output, const ScalarField2 &boundarySdf=ConstantScalarField2(kMaxD)) final |
Computes semi-Lagrangian for given scalar grid. More... | |
void | advect (const CollocatedVectorGrid2 &input, const VectorField2 &flow, double dt, CollocatedVectorGrid2 *output, const ScalarField2 &boundarySdf=ConstantScalarField2(kMaxD)) final |
Computes semi-Lagrangian for given collocated vector grid. More... | |
void | advect (const FaceCenteredGrid2 &input, const VectorField2 &flow, double dt, FaceCenteredGrid2 *output, const ScalarField2 &boundarySdf=ConstantScalarField2(kMaxD)) final |
Computes semi-Lagrangian for given face-centered vector grid. More... | |
![]() | |
AdvectionSolver2 () | |
virtual | ~AdvectionSolver2 () |
Protected Member Functions | |
virtual std::function< double(const Vector2D &)> | getScalarSamplerFunc (const ScalarGrid2 &input) const |
Returns spatial interpolation function object for given scalar grid. More... | |
virtual std::function< Vector2D(const Vector2D &)> | getVectorSamplerFunc (const CollocatedVectorGrid2 &input) const |
Returns spatial interpolation function object for given collocated vector grid. More... | |
virtual std::function< Vector2D(const Vector2D &)> | getVectorSamplerFunc (const FaceCenteredGrid2 &input) const |
Returns spatial interpolation function object for given face-centered vector grid. More... | |
Implementation of 2-D semi-Lagrangian advection solver.
This class implements 2-D semi-Lagrangian advection solver. By default, the class implements 1st-order (linear) algorithm for the spatial interpolation. For the back-tracing, this class uses 2nd-order mid-point rule with adaptive time-stepping (CFL <= 1). To extend the class using higher-order spatial interpolation, the inheriting classes can override SemiLagrangian2::getScalarSamplerFunc and SemiLagrangian2::getVectorSamplerFunc. See CubicSemiLagrangian2 for example.
jet::SemiLagrangian2::SemiLagrangian2 | ( | ) |
|
virtual |
|
finalvirtual |
Computes semi-Lagrangian for given collocated vector grid.
This function computes semi-Lagrangian method to solve advection equation for given collocated vector grid input
and underlying vector field flow
that carries the input field. The solution after solving the equation for given time-step dt
should be stored in scalar field output
. The boundary interface is given by a signed-distance field. The field is negative inside the boundary. By default, a constant field with max double value (kMaxD) is used, meaning no boundary.
input | Input vector grid. |
flow | Vector field that advects the input field. |
dt | Time-step for the advection. |
output | Output vector grid. |
boundarySdf | Boundary interface defined by signed-distance field. |
Reimplemented from jet::AdvectionSolver2.
|
finalvirtual |
Computes semi-Lagrangian for given face-centered vector grid.
This function computes semi-Lagrangian method to solve advection equation for given face-centered vector grid input
and underlying vector field flow
that carries the input field. The solution after solving the equation for given time-step dt
should be stored in vector field output
. The boundary interface is given by a signed-distance field. The field is negative inside the boundary. By default, a constant field with max double value (kMaxD) is used, meaning no boundary.
input | Input vector grid. |
flow | Vector field that advects the input field. |
dt | Time-step for the advection. |
output | Output vector grid. |
boundarySdf | Boundary interface defined by signed-distance field. |
Reimplemented from jet::AdvectionSolver2.
|
finalvirtual |
Computes semi-Lagrangian for given scalar grid.
This function computes semi-Lagrangian method to solve advection equation for given scalar field input
and underlying vector field flow
that carries the input field. The solution after solving the equation for given time-step dt
should be stored in scalar field output
. The boundary interface is given by a signed-distance field. The field is negative inside the boundary. By default, a constant field with max double value (kMaxD) is used, meaning no boundary.
input | Input scalar grid. |
flow | Vector field that advects the input field. |
dt | Time-step for the advection. |
output | Output scalar grid. |
boundarySdf | Boundary interface defined by signed-distance field. |
Implements jet::AdvectionSolver2.
|
protectedvirtual |
Returns spatial interpolation function object for given scalar grid.
This function returns spatial interpolation function (sampler) for given scalar grid input
. By default, this function returns linear interpolation function. Override this function to have custom interpolation for semi-Lagrangian process.
Reimplemented in jet::CubicSemiLagrangian2.
|
protectedvirtual |
Returns spatial interpolation function object for given collocated vector grid.
This function returns spatial interpolation function (sampler) for given collocated vector grid input
. By default, this function returns linear interpolation function. Override this function to have custom interpolation for semi-Lagrangian process.
Reimplemented in jet::CubicSemiLagrangian2.
|
protectedvirtual |
Returns spatial interpolation function object for given face-centered vector grid.
This function returns spatial interpolation function (sampler) for given face-centered vector grid input
. By default, this function returns linear interpolation function. Override this function to have custom interpolation for semi-Lagrangian process.
Reimplemented in jet::CubicSemiLagrangian2.