API

Public APIs

FieldTracer.select_seedsMethod
 select_seeds(x, y, z; nsegment=(5, 5, 5))

Generate uniform seeding points in the grid range x, y and z in nsegment.

source
FieldTracer.select_seedsMethod
 select_seeds(x, y; nsegment=(5, 5))

Generate uniform seeding points in the grid range x and y in nsegment. If nsegment specified, use the keyword input, otherwise it will be overloaded by the 3D version seed generation function!

source
FieldTracer.traceMethod
trace(fieldx, fieldy, fieldz, startx, starty, startz, gridx, gridy, gridz;
	alg=RK4(), kwargs...)

trace(fieldx, fieldy, fieldz, startx, starty, startz, grid::CartesianGrid;
	alg=RK4(), maxstep=20000, ds=0.01, gridtype="ndgrid", direction="both")

Stream tracing on structured mesh with field in 3D array and grid in range.

source
FieldTracer.traceMethod
 trace(mesh::SimpleMesh, vx, vy, xstart, ystart; maxIter=1000, maxLen=1000.)

2D stream tracing on unstructured quadrilateral and triangular mesh.

source

Private APIs

FieldTracer.bilin_regMethod
bilin_reg(x, y, Q00, Q01, Q10, Q11)

Bilinear interpolation for x1,y1=(0,0) and x2,y2=(1,1) Q's are surrounding points such that Q00 = F[0,0], Q10 = F[1,0], etc.

source
FieldTracer.eulerMethod
euler(maxstep, ds, startx, starty, xGrid, yGrid, ux, uy)

Fast 2D tracing using Euler's method. It takes at most maxstep with step size ds tracing the vector field given by ux,uy starting from (startx,starty) in the Cartesian grid specified by ranges xGrid and yGrid. Step size is in physical unit. Return footprints' coordinates in (x, y).

source
FieldTracer.eulerMethod
euler(maxstep, ds, startx, starty, startz, xGrid, yGrid, zGrid, ux, uy, uz)

Fast 3D tracing using Euler's method. It takes at most maxstep with step size ds tracing the vector field given by ux,uy,uz starting from (startx,starty,startz) in the Cartesian grid specified by ranges xGrid, yGrid and zGrid. ds is the step size in physical unit. Return footprints' coordinates in (x,y,z).

source
FieldTracer.euler_batchMethod
euler_batch(maxstep, ds, startx, starty, startz, xGrid, yGrid, zGrid, ux, uy, uz)

Fast 3D tracing of multiple particles using Euler's method. Returns matrices x, y, z of size (n_particles, maxstep).

source
FieldTracer.euler_batchMethod
euler_batch(maxstep, ds, startx, starty, xGrid, yGrid, ux, uy)

Fast 2D tracing of multiple particles using Euler's method. Returns matrices x and y of size (n_particles, maxstep).

source
FieldTracer.grid_interpMethod
grid_interp(x, y, field, ix, iy)

Interpolate a value at (x,y) in a field. ix and iy are indexes for x,y locations (0-based).

source
FieldTracer.grid_interpMethod
grid_interp(x, y, z, ix, iy, iz, field)

Interpolate a value at (x,y,z) in a field. ix,iy and iz are indexes for x, y and z locations (0-based).

source
FieldTracer.rk4Method
rk4(maxstep, ds, startx, starty, xGrid, yGrid, ux, uy)

Fast and reasonably accurate 2D tracing with 4th order Runge-Kutta method and constant step size ds. See also euler.

source
FieldTracer.rk4Method
rk4(maxstep, ds, startx, starty, startz, xGrid, yGrid, zGrid, ux, uy, uz)

Fast and reasonably accurate 3D tracing with 4th order Runge-Kutta method and constant step size ds. See also euler. ds is the step size in physical unit.

source
FieldTracer.rk4_batchMethod
rk4_batch(maxstep, ds, startx, starty, startz, xGrid, yGrid, zGrid, ux, uy, uz)

Fast 3D tracing of multiple particles using RK4 method. Returns matrices x, y, z of size (n_particles, maxstep).

source
FieldTracer.rk4_batchMethod
rk4_batch(maxstep, ds, startx, starty, xGrid, yGrid, ux, uy)

Fast 2D tracing of multiple particles using RK4 method. Returns matrices x and y of size (n_particles, maxstep).

source
FieldTracer.trace2d_eulerMethod
trace2d_euler(fieldx, fieldy, startx, starty, gridx, gridy;
   maxstep=20000, ds=0.01, gridtype="ndgrid", direction="both")

Given a 2D vector field, trace a streamline from a given point to the edge of the vector field. The field is integrated using Euler's method, which is faster but less accurate than RK4. Only valid for regular grid with coordinates' range gridx and gridy. Step size is in same unit as the grid coordinates. The field can be in both meshgrid or ndgrid (default) format. Supporting direction of {"both","forward","backward"}.

source
FieldTracer.trace2d_rk4Method
trace2d_rk4(fieldx, fieldy, startx, starty, gridx, gridy;
   maxstep=20000, ds=0.01, gridtype="ndgrid", direction="both")

Given a 2D vector field, trace a streamline from a given point to the edge of the vector field. The field is integrated using Runge Kutta 4. Slower than Euler, but more accurate. The higher accuracy allows for larger step sizes ds. Step size is in same unit as the grid coordinates. See also trace2d_euler.

source
FieldTracer.trace3d_eulerMethod
trace3d_euler(fieldx, fieldy, fieldz, startx, starty, startz, gridx, gridy, gridz;
   maxstep=20000, ds=0.01)

Given a 3D vector field, trace a streamline from a given point to the edge of the vector field. The field is integrated using Euler's method. Only valid for regular grid with coordinates gridx, gridy, gridz. The field can be in both meshgrid or ndgrid (default) format. Supporting direction of {"both","forward","backward"}.

source
FieldTracer.trace3d_rk4Method
trace3d_rk4(fieldx, fieldy, fieldz, startx, starty, startz, gridx, gridy, gridz;
   maxstep=20000, ds=0.01)

Given a 3D vector field, trace a streamline from a given point to the edge of the vector field. The field is integrated using Euler's method. Only valid for regular grid with coordinates gridx, gridy, gridz. The field can be in both meshgrid or ndgrid (default) format. See also trace3d_euler.

source
FieldTracer.trilin_regMethod
trilin_reg(x, y, z, Q)

Trilinear interpolation for x1,y1,z1=(0,0,0) and x2,y2,z2=(1,1,1) Q's are surrounding points such that Q000 = F[0,0,0], Q100 = F[1,0,0], etc.

source