Program Listing for File EvolvingStellarCore.h

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

#ifndef __EVOLVING_STELLAR_CORE_H
#define __EVOLVING_STELLAR_CORE_H

#include "../Core/SharedLibraryExportMacros.h"
#include "EvolvingStellarZone.h"

#include "../Core/Functions.h"
#include "../StellarEvolution/EvolvingStellarQuantity.h"

namespace Star {

    class LIB_PUBLIC EvolvingStellarCore : public EvolvingStellarZone {
    private:
        double __formation_age;

        enum QuantityIndex {
            MASS,
            RADIUS,
            INERTIA,
        };

    public:
        EvolvingStellarCore(
            double formation_age=Core::Inf,

            const StellarEvolution::EvolvingStellarQuantity *mass = NULL,

            const StellarEvolution::EvolvingStellarQuantity *radius = NULL,

            const StellarEvolution::EvolvingStellarQuantity
            *moment_of_inertia = NULL
        ) :
            EvolvingStellarZone({mass, radius, moment_of_inertia}),
            __formation_age(formation_age)
        {}

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

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

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

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

        double outer_mass(int deriv_order = 0) const
        {return current_age_quantity(MASS, deriv_order);}

        double outer_mass(double age, int deriv_order = 0) const
        {return any_age_quantity(MASS, age, deriv_order);}

        double formation_age() const {return __formation_age;}
    }; //End EvolvingStellarCore class.

}//End Star namespace.

#endif