USML
profile_grid_fast.h
1 
6 #ifndef USML_OCEAN_PROFILE_GRID_FAST_H
7 #define USML_OCEAN_PROFILE_GRID_FAST_H
8 
9 #include <usml/ocean/profile_model.h>
10 
11 namespace usml {
12 namespace ocean {
13 
16 
33 
34 public:
35 
36  //**************************************************
37  // sound speed model
38 
50  profile_model(attmodel), _sound_speed(speed) {
51  }
52 
56  virtual ~profile_grid_fast() {
57  delete _sound_speed;
58  }
59 
68  virtual void sound_speed(const wposition& location, matrix<double>* speed,
69  wvector* gradient = NULL) {
70  if (gradient) {
71  matrix<double> rho(location.size1(), location.size2());
72  matrix<double> theta(location.size1(), location.size2());
73  matrix<double> phi(location.size1(), location.size2());
74  this->_sound_speed->interpolate(location.rho(), location.theta(),
75  location.phi(), speed, &rho, &theta, &phi);
76  gradient->rho(rho);
77  gradient->theta(theta);
78  gradient->phi(phi);
79  } else {
80  this->_sound_speed->interpolate(location.rho(), location.theta(),
81  location.phi(), speed);
82  }
83  this->adjust_speed(location, speed, gradient);
84  }
85 
86 protected:
87 
90 
91 };
92 // end class profile_grid_fast
93 
95 } // end of namespace ocean
96 } // end of namespace usml
97 
98 #endif
99 
unsigned size2() const
Number of columns in each coordinate.
Definition: wvector.h:264
virtual void sound_speed(const wposition &location, matrix< double > *speed, wvector *gradient=NULL)
Compute the speed of sound and it's first derivatives at a series of locations.
Definition: profile_grid_fast.h:68
Implements fast calculations for data_grids using a non-recursive engine on interpolation.
Definition: data_grid_svp.h:38
const matrix< double > & rho() const
Retrieves the radial component of the spherical earth coordinate system.
Definition: wvector.h:76
World location in geodetic earth coordinates (latitude, longitude, and altitude). ...
Definition: wposition.h:39
profile_grid_fast(data_grid_svp *speed, attenuation_model *attmodel=NULL)
Constructor - Default behavior for new profile models.
Definition: profile_grid_fast.h:49
unsigned size1() const
Number of rows in each coordinate.
Definition: wvector.h:256
Sound speed model constructed from a data_grid_svp.
Definition: profile_grid_fast.h:32
data_grid_svp * _sound_speed
Sound speed for all locations.
Definition: profile_grid_fast.h:89
virtual ~profile_grid_fast()
Destructor - Delete sound speed grid.
Definition: profile_grid_fast.h:56
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
A "profile model" computes the environmental parameters of ocean water.
Definition: profile_model.h:28
double interpolate(double *location, double *derivative=NULL)
Overrides the interpolate function within data_grid using the non-recursive formula.
Definition: data_grid_svp.h:196
World vector in spherical earth coordinates.
Definition: wvector.h:42
An attenuation loss model computes the absorption of sound by the minerals in sea water...
Definition: attenuation_model.h:30
virtual void adjust_speed(const wposition &location, matrix< double > *speed, wvector *gradient=NULL)
When the flat earth option is enabled, this routine applies an anti-correction term to the profile...
Definition: profile_model.cc:14