6 #ifndef USML_OCEAN_BOUNDARY_GRID_FAST_H
7 #define USML_OCEAN_BOUNDARY_GRID_FAST_H
9 #include <usml/ocean/boundary_model.h>
10 #include <usml/ocean/reflect_loss_rayleigh.h>
77 wvector* normal = NULL,
bool quick_interp =
false) {
86 matrix<double> gtheta(location.
size1(), location.
size2());
87 matrix<double> gphi(location.
size1(), location.
size2());
88 matrix<double> t(location.
size1(), location.
size2());
89 matrix<double> p(location.
size1(), location.
size2());
93 t = element_div(gtheta, *rho);
94 p = element_div(gphi, element_prod(*rho,
sin(location.
theta())));
96 element_div(-t,
sqrt(1.0 +
abs2(t))));
97 normal->phi(element_div(-p,
sqrt(1.0 +
abs2(p))));
99 1.0 -
abs2(normal->theta()) -
abs2(normal->phi())));
115 wvector1* normal = NULL,
bool quick_interp =
false) {
124 double loc[2] = { location.
theta(), location.
phi() };
127 const double t = grad[0] / (*rho);
128 const double p = grad[1] / ((*rho) *
sin(location.
theta()));
129 normal->theta(-t /
sqrt(1.0 + t * t));
130 normal->phi(-p /
sqrt(1.0 + p * p));
131 const double N = normal->theta() * normal->theta()
132 + normal->phi() * normal->phi();
133 normal->rho(
sqrt(1.0 - N));
135 double loc[2] = { location.
theta(), location.
phi() };
unsigned size2() const
Number of columns in each coordinate.
Definition: wvector.h:264
Definition: reflect_loss_rayleigh.h:96
enum GRID_INTERP_TYPE interp_type(int unsigned dimension) const
Retrieve the type of interpolation for one of the axes.
Definition: data_grid.h:135
World location in geodetic earth coordinates (latitude, longitude, and altitude). ...
Definition: wposition.h:39
virtual void height(const wposition &location, matrix< double > *rho, wvector *normal=NULL, bool quick_interp=false)
Compute the height of the boundary and it's surface normal at a series of locations.
Definition: boundary_grid_fast.h:76
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_abs2< typename E::value_type > >::result_type abs2(const matrix_expression< E > &e)
Magnitude squared of a complex matrix.
Definition: matrix_math.h:270
unsigned size1() const
Number of rows in each coordinate.
Definition: wvector.h:256
virtual void height(const wposition1 &location, double *rho, wvector1 *normal=NULL, bool quick_interp=false)
Compute the height of the boundary and it's surface normal at a single location.
Definition: boundary_grid_fast.h:114
Definition: data_grid.h:23
Bottom model constructed from 2-D data_grid_bathy.
Definition: boundary_grid_fast.h:29
A reflection loss model computes the changes in amplitude and phase that result from the reflection o...
Definition: reflect_loss_model.h:30
Implements fast calculations for data_grids using a non-recursive engine on interpolation.
Definition: data_grid_bathy.h:38
data_grid_bathy * _height
Boundary for all locations.
Definition: boundary_grid_fast.h:143
Individual world vector in spherical earth coordinates.
Definition: wvector1.h:27
double theta() const
Retrieves the colatitude component of the spherical earth coordinate system.
Definition: wvector1.h:91
reflect_loss_model * _reflect_loss_model
Reference to the reflection loss model.
Definition: boundary_model.h:95
double phi() const
Retrieves the longitude component of the spherical earth coordinate system.
Definition: wvector1.h:122
boundary_grid_fast(data_grid_bathy *height, reflect_loss_model *reflect_loss=NULL)
Constructor - Initialize depth and reflection loss components for a boundary.
Definition: boundary_grid_fast.h:47
void reflect_loss(reflect_loss_model *reflect_loss)
Define a new reflection loss model.
Definition: boundary_model.h:104
const matrix< double > & phi() const
Retrieves the longitude component of the spherical earth coordinate system.
Definition: wvector.h:204
const matrix< double > & theta() const
Retrieves the colatitude component of the spherical earth coordinate system.
Definition: wvector.h:140
bool edge_limit(int unsigned dimension) const
Returns the edge_limit flag for the requested dimension.
Definition: data_grid.h:174
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_sin< typename E::value_type > >::result_type sin(const matrix_expression< E > &e)
Sine of a matrix.
Definition: matrix_math.h:354
virtual ~boundary_grid_fast()
Destructor - Delete boundary grid.
Definition: boundary_grid_fast.h:63
World location in geodetic earth coordinates (latitude, longitude, and altitude). ...
Definition: wposition1.h:23
double interpolate(double *location, double *derivative=NULL)
Overrides the interpolate function within data_grid using the non-recursive formula.
Definition: data_grid_bathy.h:272
Models plane wave reflection loss from a flat fluid-solid interface.
Definition: reflect_loss_rayleigh.h:86
Definition: data_grid.h:24
World vector in spherical earth coordinates.
Definition: wvector.h:42
A "boundary model" computes the environmental parameters of the ocean's surface or bottom...
Definition: boundary_model.h:58
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_sqrt< typename E::value_type > >::result_type sqrt(const matrix_expression< E > &e)
Square root of a matrix.
Definition: matrix_math.h:296