8 #define BUILDING_LIBRARY 18 __torque[i].resize(11, Eigen::Vector3d(Core::NaN,
24 unsigned top_zone_index,
25 Evolve::Dissipation::QuantityEntry entry,
26 bool with_respect_to_top
35 std::valarray<Eigen::Vector3d> &zone_torque=
__torque[top_zone_index];
38 return zone_torque[0];
40 return zone_torque[(with_respect_to_top ? 1 : 2)];
42 return zone_torque[(with_respect_to_top ? 3 : 4)];
44 return zone_torque[(with_respect_to_top ? 5 : 6)];
46 return zone_torque[(with_respect_to_top ? 7 : 8)];
48 return zone_torque[(with_respect_to_top ? 9 : 10)];
51 "Unsupported entry in " 52 "ExponentialDecayDiffRotBody::torque_entry" 59 double companion_mass,
62 const double *spin_angmom,
63 const double *inclination,
64 const double *periapsis,
66 bool zero_outer_inclination,
67 bool zero_outer_periapsis)
82 zero_outer_inclination,
83 zero_outer_periapsis);
87 unsigned top_zone_index,
88 Evolve::Dissipation::QuantityEntry entry,
89 bool with_respect_to_top
102 return Eigen::Vector3d(0, 0, 0);
105 with_respect_to_top);
106 if(!std::isnan(result[0]))
return result;
108 &zone2 =
zone(top_zone_index + 1);
110 i2 = zone2.moment_of_inertia();
111 if(i1 == 0 || i2 == 0) {
120 result = zone_to_zone_transform(
123 Eigen::Vector3d(0, 0, zone2.spin_frequency()),
136 result = Eigen::Vector3d(
142 result = zone_to_zone_transform(zone2,
144 Eigen::Vector3d(0, 0, 1));
147 result *= zone2.spin_frequency();
157 else if(with_respect_to_top)
158 result *= i2 * (1 - i1 / (i1 + i2));
159 else result *= i1 * (1 - i2 / (i1 + i2));
std::valarray< std::valarray< Eigen::Vector3d > > __torque
The coupling torque and its nonzero entries.
Function arguments do not satisfy some requirement.
RADIUS
The derivative w.r.t. the radius of the body in .
Declares a DissipatingBody with exponentially decaying differential rotation coupling.
SPIN_FREQUENCY
The derivative w.r.t. the spin frequency of a dissipating zone.
Eigen::Vector3d angular_momentum_coupling(unsigned top_zone_index, Evolve::Dissipation::QuantityEntry entry=Evolve::Dissipation::NO_DERIV, bool with_respect_to_top=false) const
See DissipatingBody::angular_momentum_coupling().
virtual const DissipatingZone & zone(unsigned zone_index) const =0
A modifiable reference to one of the body's zones.
SEMIMAJOR
The derivative w.r.t. the semimajor axis in AU.
virtual double moment_of_inertia(int deriv_order=0) const =0
Moment of inertia of the zone or its age derivative at the age of last configure() call...
virtual void configure(bool initialize, double age, double companion_mass, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination=NULL, const double *periapsis=NULL, bool locked_surface=false, bool zero_outer_inclination=false, bool zero_outer_periapsis=false)
Defines the orbit this body is in.
A layer of a system body for which the tidal bulge is not exactly in phase with the tidal potential...
void reset_torque()
Resets __torque to all undefined (correcting the size if necessary).
virtual void configure(bool initialize, double age, double companion_mass, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination=NULL, const double *periapsis=NULL, bool locked_surface=false, bool zero_outer_inclination=false, bool zero_outer_periapsis=false)
See DissipatingBody::configure().
Eigen::Vector3d & torque_entry(unsigned top_zone_index, Evolve::Dissipation::QuantityEntry entry, bool wih_respect_to_top) const
Returns the entry in __torque that corresponds to the given quantity entry.
double __timescale
The timescale for the differential rotation torque.
ECCENTRICITY
The derivative w.r.t. the eccentricity.
AGE
The derivative w.r.t. age, excluding the dependence through the body's radius and the moments of iner...
double __current_age
The age for which the last conigure() was called.
NO_DERIV
The quantity itself, undifferentiated.
ORBITAL_FREQUENCY
The derivative w.r.t. the orbital frequency.
SPIN_ANGMOM
The derivative w.r.t. the spin angular momentum in .
double spin_frequency() const
The spin frequency of the given zone.
virtual unsigned number_zones() const =0
The number of zones the body consists of.