ReFRACtor
FullPhysics::AltitudeHydrostatic Class Reference

This class handles the calculation of the altitude an gravity constants, automatically updating with the surface pressure or temperature profile is updated. More...

#include <altitude_hydrostatic.h>

+ Inheritance diagram for FullPhysics::AltitudeHydrostatic:
+ Collaboration diagram for FullPhysics::AltitudeHydrostatic:

Public Member Functions

 AltitudeHydrostatic (const boost::shared_ptr< Pressure > &P, const boost::shared_ptr< Temperature > &T, const DoubleWithUnit &Latitude, const DoubleWithUnit &Surface_height, const int Num_sublayer=10)
 Constructor. More...
 
virtual ~AltitudeHydrostatic ()
 
virtual void add_observer (Observer< Altitude > &Obs)
 Add an observer. More...
 
void add_observer_and_keep_reference (boost::shared_ptr< Observer< Altitude > > &Obs)
 Add an observer and keep a reference to it. More...
 
virtual AutoDerivativeWithUnit< double > altitude (const AutoDerivativeWithUnit< double > &P) const
 Return altitude grid for the given pressure. More...
 
virtual boost::shared_ptr< Altitudeclone () const
 Clone an Altitude object. More...
 
virtual boost::shared_ptr< Altitudeclone (const boost::shared_ptr< Pressure > &Press, const boost::shared_ptr< Temperature > &Temp) const
 This version of clone takes a pressure and temperature to use. More...
 
virtual AutoDerivativeWithUnit< double > gravity (const AutoDerivativeWithUnit< double > &P) const
 Return gravity constant for the given pressure. More...
 
virtual void notify_add (Temperature &Observed_object)
 Called when an object is added to an Observable. More...
 
virtual void notify_add (Pressure &Observed_object)
 Called when an object is added to an Observable. More...
 
virtual void notify_add ()
 
virtual void notify_add ()
 
virtual void notify_remove (Pressure &Observed_object)
 Called when an object is removed from an Observable. More...
 
virtual void notify_remove (Temperature &Observed_object)
 Called when an object is removed from an Observable. More...
 
virtual void notify_remove ()
 
virtual void notify_remove ()
 
virtual void notify_update (const Pressure &P)
 For performance, we cache some data as we calculate it. More...
 
virtual void notify_update (const Temperature &T)
 For performance, we cache some data as we calculate it. More...
 
virtual void print (std::ostream &Os) const
 
std::string print_to_string () const
 Print to string. More...
 
virtual void remove_observer (Observer< Altitude > &Obs)
 Remove an observer. More...
 

Protected Member Functions

void add_observer_do (Observer< Altitude > &Obs, Altitude &t)
 Add an observer. More...
 
void add_observer_do (Observer< Altitude > &Obs)
 
void clean_dead_ptr ()
 Remove any dead pointers. More...
 
void notify_update_do (const Altitude &Self)
 Function to call to notify Observers of a state change. More...
 
void remove_observer_do (Observer< Altitude > &Obs, Altitude &t)
 Remove an observer. More...
 
void remove_observer_do (Observer< Altitude > &Obs)
 

Protected Attributes

std::list< boost::weak_ptr< Observer< Altitude > > > olist
 
std::vector< boost::shared_ptr< Observer< Altitude > > > ref_list
 

Detailed Description

This class handles the calculation of the altitude an gravity constants, automatically updating with the surface pressure or temperature profile is updated.

We do this by solving the hydrostatic equations.

Todo:
reference for this? (ATB?)

Definition at line 19 of file altitude_hydrostatic.h.

Constructor & Destructor Documentation

◆ AltitudeHydrostatic()

AltitudeHydrostatic::AltitudeHydrostatic ( const boost::shared_ptr< Pressure > &  P,
const boost::shared_ptr< Temperature > &  T,
const DoubleWithUnit Latitude,
const DoubleWithUnit Surface_height,
const int  Num_sublayer = 10 
)

Constructor.

Latitude for the surface point should be in degrees, and height in meters.

Definition at line 163 of file altitude_hydrostatic.cc.

◆ ~AltitudeHydrostatic()

virtual FullPhysics::AltitudeHydrostatic::~AltitudeHydrostatic ( )
inlinevirtual

Definition at line 29 of file altitude_hydrostatic.h.

Member Function Documentation

◆ add_observer()

virtual void FullPhysics::Altitude::add_observer ( Observer< Altitude > &  Obs)
inlinevirtualinherited

Add an observer.

Implements FullPhysics::Observable< Altitude >.

Definition at line 22 of file altitude.h.

◆ add_observer_and_keep_reference()

void FullPhysics::Observable< Altitude >::add_observer_and_keep_reference ( boost::shared_ptr< Observer< Altitude > > &  Obs)
inlineinherited

Add an observer and keep a reference to it.

See the discussion in the Observer class description for details.

Definition at line 107 of file observer.h.

◆ add_observer_do() [1/2]

void FullPhysics::Observable< Altitude >::add_observer_do ( Observer< Altitude > &  Obs,
Altitude t 
)
inlineprotectedinherited

Add an observer.

Definition at line 148 of file observer.h.

◆ add_observer_do() [2/2]

void FullPhysics::Observable< Altitude >::add_observer_do ( Observer< Altitude > &  Obs)
inlineprotectedinherited

Definition at line 159 of file observer.h.

◆ altitude()

virtual AutoDerivativeWithUnit<double> FullPhysics::AltitudeHydrostatic::altitude ( const AutoDerivativeWithUnit< double > &  P) const
inlinevirtual

Return altitude grid for the given pressure.

Implements FullPhysics::Altitude.

Definition at line 56 of file altitude_hydrostatic.h.

◆ clean_dead_ptr()

void FullPhysics::Observable< Altitude >::clean_dead_ptr ( )
inlineprotectedinherited

Remove any dead pointers.

Definition at line 196 of file observer.h.

◆ clone() [1/2]

virtual boost::shared_ptr<Altitude> FullPhysics::AltitudeHydrostatic::clone ( ) const
inlinevirtual

Clone an Altitude object.

Note that the cloned version will not be attached to and StateVector or Observer<Altitude>, although you can of course attach them after receiving the cloned object.

Because this isn't attached to the StateVector, one use of the clone operator is to create a "frozen" Altitude object.

Implements FullPhysics::Altitude.

Definition at line 67 of file altitude_hydrostatic.h.

◆ clone() [2/2]

boost::shared_ptr< Altitude > AltitudeHydrostatic::clone ( const boost::shared_ptr< Pressure > &  Press,
const boost::shared_ptr< Temperature > &  Temp 
) const
virtual

This version of clone takes a pressure and temperature to use.

The intent is that the pressure and temperature has been cloned from the original pressure and temperature (although this class has no way to verify this). This allows sets of objects to be cloned using a common Pressure and Temperature clone, e.g. Atmosphere.

Implements FullPhysics::Altitude.

Definition at line 201 of file altitude_hydrostatic.cc.

◆ gravity()

virtual AutoDerivativeWithUnit<double> FullPhysics::AltitudeHydrostatic::gravity ( const AutoDerivativeWithUnit< double > &  P) const
inlinevirtual

Return gravity constant for the given pressure.

Implements FullPhysics::Altitude.

Definition at line 61 of file altitude_hydrostatic.h.

◆ notify_add() [1/4]

virtual void FullPhysics::Observer< Temperature >::notify_add ( Temperature Observed_object)
inlinevirtualinherited

Called when an object is added to an Observable.

Default is to do nothing.

Definition at line 47 of file observer.h.

◆ notify_add() [2/4]

virtual void FullPhysics::Observer< Pressure >::notify_add ( Pressure Observed_object)
inlinevirtualinherited

Called when an object is added to an Observable.

Default is to do nothing.

Definition at line 47 of file observer.h.

◆ notify_add() [3/4]

virtual void FullPhysics::Observer< Temperature >::notify_add ( )
inlinevirtualinherited

Definition at line 48 of file observer.h.

◆ notify_add() [4/4]

virtual void FullPhysics::Observer< Pressure >::notify_add ( )
inlinevirtualinherited

Definition at line 48 of file observer.h.

◆ notify_remove() [1/4]

virtual void FullPhysics::Observer< Temperature >::notify_remove ( Temperature Observed_object)
inlinevirtualinherited

Called when an object is removed from an Observable.

Default is to do nothing.

Definition at line 55 of file observer.h.

◆ notify_remove() [2/4]

virtual void FullPhysics::Observer< Pressure >::notify_remove ( Pressure Observed_object)
inlinevirtualinherited

Called when an object is removed from an Observable.

Default is to do nothing.

Definition at line 55 of file observer.h.

◆ notify_remove() [3/4]

virtual void FullPhysics::Observer< Pressure >::notify_remove ( )
inlinevirtualinherited

Definition at line 56 of file observer.h.

◆ notify_remove() [4/4]

virtual void FullPhysics::Observer< Temperature >::notify_remove ( )
inlinevirtualinherited

Definition at line 56 of file observer.h.

◆ notify_update() [1/2]

virtual void FullPhysics::AltitudeHydrostatic::notify_update ( const Pressure P)
inlinevirtual

For performance, we cache some data as we calculate it.

This becomes stale when the pressure is changed, so we observe press and mark the cache when it changes.

Reimplemented from FullPhysics::Observer< Pressure >.

Definition at line 39 of file altitude_hydrostatic.h.

◆ notify_update() [2/2]

virtual void FullPhysics::AltitudeHydrostatic::notify_update ( const Temperature T)
inlinevirtual

For performance, we cache some data as we calculate it.

This becomes stale when the temperature is changed, so we observe temperature and mark the cache when it changes.

Reimplemented from FullPhysics::Observer< Temperature >.

Definition at line 50 of file altitude_hydrostatic.h.

◆ notify_update_do()

void FullPhysics::Observable< Altitude >::notify_update_do ( const Altitude Self)
inlineprotectedinherited

Function to call to notify Observers of a state change.

The object should pass itself to this function, so it can be passed to the Observers.

Definition at line 121 of file observer.h.

◆ print()

virtual void FullPhysics::AltitudeHydrostatic::print ( std::ostream &  Os) const
inlinevirtual

Reimplemented from FullPhysics::Altitude.

Definition at line 66 of file altitude_hydrostatic.h.

◆ print_to_string()

std::string FullPhysics::Printable< Altitude >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.

◆ remove_observer()

virtual void FullPhysics::Altitude::remove_observer ( Observer< Altitude > &  Obs)
inlinevirtualinherited

Remove an observer.

Implements FullPhysics::Observable< Altitude >.

Definition at line 24 of file altitude.h.

◆ remove_observer_do() [1/2]

void FullPhysics::Observable< Altitude >::remove_observer_do ( Observer< Altitude > &  Obs,
Altitude t 
)
inlineprotectedinherited

Remove an observer.

Definition at line 173 of file observer.h.

◆ remove_observer_do() [2/2]

void FullPhysics::Observable< Altitude >::remove_observer_do ( Observer< Altitude > &  Obs)
inlineprotectedinherited

Definition at line 181 of file observer.h.

Member Data Documentation

◆ olist

std::list<boost::weak_ptr<Observer<Altitude > > > FullPhysics::Observable< Altitude >::olist
protectedinherited

Definition at line 200 of file observer.h.

◆ ref_list

std::vector<boost::shared_ptr<Observer<Altitude > > > FullPhysics::Observable< Altitude >::ref_list
protectedinherited

Definition at line 201 of file observer.h.


The documentation for this class was generated from the following files:

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:12