Skip to main content

StageOverrideRule

Enum StageOverrideRule 

Source
#[non_exhaustive]
pub enum StageOverrideRule { Rescaled, PartsInPlace, }
Expand description

How a stage’s Overrides set its inertia. Both rules give the stage the overrides’ mass and center; they differ in where the stage’s parts are taken to be, and so in the inertia.

With the parts’ mass m_p, center x_p and inertia I_p about it, a mass override m′ and a center override c, an AddedMass at a station counted among the parts (one with no station is too under Rescaled, and sits at c under PartsInPlace):

RescaledParts in place
mass override aloneI_p m′/m_pI_p
center override aloneI_pI_p + m_p ((d·d) 1 − d dᵀ), d = x_p − c
bothI_p m′/m_pI_p + m_p ((d·d) 1 − d dᵀ)

An inertia override replaces the tensor under either rule. The two agree on a stage with no override and on an override that changes neither the mass nor the center.

Neither rule is measured on a flying rocket: a stage’s overrides say what it weighs and where it balances, not where the mass the parts don’t account for sits. Rescaled puts it where the parts’ mass is; PartsInPlace puts it at the stage’s center and leaves each part where the design puts it. The decision record that added the second rule weighs the two (ADR-340).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Rescaled

The stage’s parts, with its added mass, are one body the overrides rescale and move (Overrides::apply): a mass override scales the inertia with the mass, and a center override moves the body whole, its inertia about its center unchanged. The default, and hpr-design’s rule for a part’s overrides too (ADR-061).

§

PartsInPlace

The parts stay where the design puts them (Overrides::apply_with_parts_in_place): the stage’s inertia is its parts’ about the stage’s center, and the mass a mass override adds or takes away sits at that center. This is how OpenRocket 24.12 weighs a single stage’s overrides that cover its parts, measured on probe designs (validation/oracles/openrocket/); on the lower of two stages OpenRocket’s sum is below the parts’ inertia about the stage’s center. The .ork reader gives it to every stage with such an override, on the axis (ADR-340) or parallel, whose pods OpenRocket leaves in place the same way (the record that measured a parallel stage).

Implementations§

Source§

impl StageOverrideRule

Source

pub fn is_rescaled(&self) -> bool

Whether this is the default rule, Rescaled.

Source

pub fn weigh( self, parts: MassProperties, added_mass: Option<AddedMass>, overrides: &Overrides, fore_station_m: f64, ) -> Result<MassProperties, DesignError>

A stage whose parts weigh parts, with added_mass added to them and then overrides applied by this rule, stations measured from the stage’s forward end fore_station_m.

§Errors

As AddedMass::add_to and Overrides::apply.

Trait Implementations§

Source§

impl Clone for StageOverrideRule

Source§

fn clone(&self) -> StageOverrideRule

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StageOverrideRule

Source§

impl Debug for StageOverrideRule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StageOverrideRule

Source§

fn default() -> StageOverrideRule

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for StageOverrideRule

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for StageOverrideRule

Source§

impl JsonSchema for StageOverrideRule

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for StageOverrideRule

Source§

fn eq(&self, other: &StageOverrideRule) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for StageOverrideRule

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StageOverrideRule

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.