Program Listing for File Planet.h

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

#ifndef __LOCKED_PLANET_H
#define __LOCKED_PLANET_H

#include "../Core/SharedLibraryExportMacros.h"
#include "PlanetZone.h"
#include "../Evolve/DissipatingBody.h"

namespace Planet {

    class LIB_PUBLIC Planet : virtual public Evolve::DissipatingBody {
    private:
        PlanetZone __zone;
    public:
        Planet(double mass,
               double radius,
               double inertia_factor=0.3) :
            __zone(mass, radius, inertia_factor)
        {};

        unsigned number_zones() const {return 1;}

        const Evolve::DissipatingZone &zone(
            unsigned
#ifndef NDEBUG
            zone_index
#endif
        ) const
        {
            assert(zone_index == 0);
            return __zone;
        }

        Evolve::DissipatingZone &zone(
            unsigned
#ifndef NDEBUG
            zone_index
#endif
        )
        {
            assert(zone_index == 0);
            return __zone;
        }

        const PlanetZone &zone() const {return __zone;}

        PlanetZone &zone() {return __zone;}

        Eigen::Vector3d angular_momentum_coupling(
            unsigned,
            Evolve::Dissipation::QuantityEntry=Evolve::Dissipation::NO_DERIV,
            bool = false
        ) const
        {
            throw Core::Error::Runtime("Request for the angular momentum "
                                       "coupling of a Planet!");
        }

        double angular_momentum_loss(
            Evolve::Dissipation::QuantityEntry=Evolve::Dissipation::NO_DERIV
        ) const
        {return 0;}

        void reached_critical_age(double) {}

    }; //End LockedPlanet class.

}//End Planet namespace.

#endif