profile_model.h

00001 
00005 #pragma once
00006 
00007 #include <usml/ocean/attenuation_thorp.h>
00008 
00009 namespace usml {
00010 namespace ocean {
00011 
00012 using boost::numeric::ublas::vector;
00013 
00016 
00027 class USML_DECLSPEC profile_model : public attenuation_model {
00028 
00029 public:
00030 
00037         profile_model( attenuation_model* attenuation = NULL ) : _flat_earth(false) {
00038                 if ( attenuation ) {
00039                         _attenuation = attenuation ;
00040                 } else {
00041                         _attenuation = new attenuation_thorp() ;
00042                 }
00043         }
00044 
00048         virtual ~profile_model() {
00049                 delete _attenuation ;
00050         }
00051 
00059     inline void flat_earth( bool flat ) {
00060         _flat_earth = flat ;
00061     }
00062 
00071     virtual void sound_speed( const wposition& location,
00072         matrix<double>* speed, wvector* gradient=NULL ) = 0 ;
00073 
00079    void attenuation( attenuation_model* attenuation ) {
00080            if ( _attenuation ) delete _attenuation ;
00081            _attenuation = attenuation ;
00082    }
00083 
00092    virtual void attenuation(
00093            const wposition& location,
00094            const seq_vector& frequencies,
00095            const matrix<double>& distance,
00096            matrix< vector<double> >* attenuation)
00097    {
00098            _attenuation->attenuation(
00099                    location, frequencies, distance, attenuation ) ;
00100    }
00101 
00102 
00103   protected:
00104 
00138     virtual void adjust_speed( const wposition& location,
00139         matrix<double>* speed, wvector* gradient=NULL ) ;
00140 
00142     bool _flat_earth ;
00143 
00144   private:
00145 
00147     attenuation_model* _attenuation ;
00148 
00149 };
00150 
00152 }  // end of namespace ocean
00153 }  // end of namespace usml

Generated on 4 May 2015 for USML by  doxygen 1.6.1