USML
data_grid_svp Class Reference
Collaboration diagram for data_grid_svp:

Detailed Description

Implements fast calculations for data_grids using a non-recursive engine on interpolation.

Takes an existing data_grid and wraps it into a new data_grid_svp and overrides the interpolate function to implement the non-recursive algorithm.

Assumes that both axes of the passed data_grid both have the same interp_type.

WARNING: This wrapper is specific to 3-dimensional grids only. For 2-dimensional grids, the user should implement the data_grid_bathy wrapper instead.

Since the data is passed in and referenced by this wrapper, the data is taken control of and destroyed at the end of its use cycle.

Constructor & Destructor Documentation

data_grid_svp ( const data_grid< double, 3 > &  grid,
bool  copy_data = true 
)
inline

Constructor - Creates a fast interpolation grid from an existing data_grid.

Parameters
gridThe data_grid that is to be wrapped.
copy_dataIf true, copies the data grids data fields as well as the axises.

Member Function Documentation

double data_3d ( unsigned  dim0,
unsigned  dim1,
unsigned  dim2 
)
inlineprivate

Utility accessor function for data grid values.

double interpolate ( double *  location,
double *  derivative = NULL 
)
inline

Overrides the interpolate function within data_grid using the non-recursive formula.

Determines which interpolate function to based on the interp_type enumeral stored within the 0th dimensional axis.

Interpolate at a single location.

Parameters
locationLocation to do the interpolation at
derivativeCalculates first derivative if not NULL
void interpolate ( const matrix< double > &  x,
const matrix< double > &  y,
const matrix< double > &  z,
matrix< double > *  result,
matrix< double > *  dx = NULL,
matrix< double > *  dy = NULL,
matrix< double > *  dz = NULL 
)
inline

Interpolation 3-D specialization where the arguments, and results, are matrix<double>.

This is used frequently in the WaveQ3D model to interpolate environmental parameters.

Parameters
xFirst dimension of location.
ySecond dimension of location.
zThird dimension of location.
resultInterpolated values at each location (output).
dxFirst dimension of derivative (output).
dySecond dimension of derivative (output).
dzThird dimension of derivative (output).

Member Data Documentation

c_matrix<double, 2, 2> _dz
private
c_matrix<double, 2, 2> _interp_plane
private
unsigned _kxmax
private
unsigned _kymax
private
unsigned _kzmax
private

Create all variables needed for each calculation once to same time and memory.

double*** derv_z
private