Program Listing for File EvolvingStellarEnvelope.h

Return to documentation for file (/home/kpenev/projects/git/poet/poet_src/Star/EvolvingStellarEnvelope.h)

#ifndef __EVOLVING_STELLAR_ENVELOPE_H
#define __EVOLVING_STELLAR_ENVELOPE_H

#include "EvolvingStellarZone.h"

namespace Star {

    class EvolvingStellarEnvelope : public EvolvingStellarZone {
    private:
        double __stellar_mass;

        enum CurrentAgeQuantities {
            RADIUS,
            INERTIA,
        };

    public:
        EvolvingStellarEnvelope(
                double stellar_mass,

                const StellarEvolution::EvolvingStellarQuantity
                *outer_radius=NULL,

                const StellarEvolution::EvolvingStellarQuantity
                *moment_of_inertia=NULL
        ) :
            EvolvingStellarZone({outer_radius, moment_of_inertia}),
            __stellar_mass(stellar_mass)
        {}

        double moment_of_inertia(double age, int deriv_order=0) const
        {return any_age_quantity(INERTIA, age, deriv_order);}

        double moment_of_inertia(int deriv_order=0) const
        {return current_age_quantity(INERTIA, deriv_order);}

        double outer_radius(double age, int deriv_order=0) const
        {return any_age_quantity(RADIUS, age, deriv_order);}

        double outer_radius(int deriv_order=0) const
        {return current_age_quantity(RADIUS, deriv_order);}

        double outer_mass(double, int deriv_order=0) const
        {return (deriv_order ? 0 : __stellar_mass);}

        double outer_mass(int deriv_order=0) const
        {return (deriv_order ? 0 : __stellar_mass);}

    };//End EvolvingStellarEnvelope class.

}//End Star namespace.

#endif