ReFRACtor
pressure.h
Go to the documentation of this file.
1 #ifndef PRESSURE_H
2 #define PRESSURE_H
4 #include "observer.h"
5 #include "array_ad_with_unit.h"
6 
7 namespace FullPhysics {
8 /****************************************************************/
32 class Pressure : virtual public StateVectorObserver,
33  public Observable<Pressure> {
34 public:
35  virtual ~Pressure() {}
36  virtual void add_observer(Observer<Pressure>& Obs)
37  { add_observer_do(Obs, *this);}
38  virtual void remove_observer(Observer<Pressure>& Obs)
39  { remove_observer_do(Obs, *this);}
40 
42 
43 //-----------------------------------------------------------------------
46 //-----------------------------------------------------------------------
47 
48  double surface_pressure_value() const
49  {return surface_pressure().convert(units::Pa).value.value();}
50 
51 //-----------------------------------------------------------------------
55 //-----------------------------------------------------------------------
56 
57  virtual ArrayAdWithUnit<double, 1> pressure_grid() const = 0;
58 
59 //-----------------------------------------------------------------------
62 //-----------------------------------------------------------------------
63 
64  int number_layer() const {return pressure_grid().value.rows() - 1;}
65 
66 //-----------------------------------------------------------------------
69 //-----------------------------------------------------------------------
70 
71  int number_level() const {return pressure_grid().value.rows();}
72 
73 //-----------------------------------------------------------------------
77 //-----------------------------------------------------------------------
78 
79  virtual int max_number_level() const {return number_level();}
80 
81 //-----------------------------------------------------------------------
88 //-----------------------------------------------------------------------
89 
90  virtual boost::shared_ptr<Pressure> clone() const = 0;
91 };
92 }
93 #endif
int number_layer() const
This is the number of layers.
Definition: pressure.h:64
virtual ~Pressure()
Definition: pressure.h:35
This is a AutoDerivative that also has units associated with it.
void add_observer_do(Observer< Pressure > &Obs, Pressure &t)
Add an observer.
Definition: observer.h:148
const Unit Pa("Pa", N/(m *m))
This is an observer of a StateVector.
void remove_observer_do(Observer< Pressure > &Obs, Pressure &t)
Remove an observer.
Definition: observer.h:173
double surface_pressure_value() const
Return the current surface pressure value, without the gradient.
Definition: pressure.h:48
int number_level() const
This is the number of levels.
Definition: pressure.h:71
Mixin for a class that allows other classes to observe it state.
Definition: observer.h:12
AutoDerivativeWithUnit< double > surface_pressure() const
Return surface pressure, which is just the pressure at the bottom level of pressure_grid.
Definition: pressure.cc:19
virtual void remove_observer(Observer< Pressure > &Obs)
Remove an observer.
Definition: pressure.h:38
This class maintains the pressure portion of the state.
Definition: pressure.h:32
virtual void add_observer(Observer< Pressure > &Obs)
Add an observer.
Definition: pressure.h:36
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual ArrayAdWithUnit< double, 1 > pressure_grid() const =0
This returns the pressure grid to use for layer retrieval, along with the gradient of each of the pre...
virtual boost::shared_ptr< Pressure > clone() const =0
Clone a Pressure object.
virtual int max_number_level() const
The maximum number of levels that we can have.
Definition: pressure.h:79
int rows() const
Definition: array_ad.h:368

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