Struct kalast::core::body::Body[][src]

pub struct Body {
    pub name: String,
    pub position: V3<f64>,
    pub object: Object3D,
    pub properties: Properties,
    // some fields omitted
}

A celestial body representation.

Definition

Body is defined by its name, its position with respect to the Sun, the shape model of its object file, the physical properties of its ground layers and its surface temperatures

Example

use kalast::{Properties, Body, ASTRONAUMICAL_UNIT, HOUR, V3};

let mut body = Body::new(
    "Dimorphos", // name
    V3::new(0., 1., 0.) * ASTRONAUMICAL_UNIT, // distance to Sun
    "path/to/dimorphos.obj", // 3D object path
    Properties::new(
        11.92 * HOUR, // rotation period
        11.92 * HOUR, // revolution period
        0.,           // obliquity
        500.,         // thermal inertia
        2146.,        // density
        600.,         // heat capacity
        0.07,         // albedo
        0.9,          // emissivity
    ),
);

Fields

name: String

Name of the celestial body.

position: V3<f64>

Position of the celestial body with respect to the Sun (in meters).

object: Object3D

Path to the 3D object file for the shape model of the celestial body.

properties: Properties

Ground properties of the celestial body (completed with time).

Implementations

impl Body[src]

pub fn new<P: AsRef<Path>>(
    name: &str,
    position: V3<f64>,
    path: P,
    properties: Properties
) -> Self
[src]

Celestial body constructor.

pub fn empty(name: &str, position: V3<f64>, properties: Properties) -> Self[src]

pub fn share_time_step(&mut self, time_step: f64)[src]

Share time with Body to initialize ground vector, rotation angle, and more.

pub fn new_ground_temperatures(&self, value: f64) -> DMatrix<f64>[src]

Create a new matrix for ground temperatures initialized with given value.

pub fn recompute_ground_temperatures(&mut self, temperature: Option<f64>)[src]

Recompute ground temperatures to match 3D object faces’ mask. If the ground temperatures is already set, make it match faces’ mask. But if the argument temperature is some, force reset of ground temperatures matrix to this value. If ground temperatures unset, initialize it with temperatures value or 0.

pub fn ground_temperatures(&self) -> &DMatrix<f64>[src]

Ground temperatures getter.

pub fn ground_temperatures_mut(&mut self) -> &mut DMatrix<f64>[src]

Ground temperatures getter as mutable.

pub fn set_ground_temperatures(&mut self, ground_temperatures: DMatrix<f64>)[src]

Ground temperatures setter.

pub fn surface_temperatures(&self) -> MatrixSliceXx1<'_, f64, U1, Dynamic>[src]

Surface temperatures getter.

pub fn surface_temperatures_mut(
    &mut self
) -> MatrixSliceMutXx1<'_, f64, U1, Dynamic>
[src]

Surface temperatures getter as mutable.

pub fn set_surface_temperatures(&mut self, surface_temperatures: VX<f64>)[src]

Surface temperatures setter.

pub fn surface_temperatures_as_vec(&self) -> VX<f64>[src]

Surface temperatures getter as vector (cloned version).

pub fn deepest_temperatures(&self) -> MatrixSliceXx1<'_, f64, U1, Dynamic>[src]

Surface temperatures getter.

pub fn surface_heat_flux(&self) -> &VX<f64>[src]

Surface heat flux getter.

pub fn set_surface_heat_flux(&mut self, heat_flux: VX<f64>)[src]

Set the surface heat flux.

pub fn set_index_daily_surface_temperature(&mut self, index: usize)[src]

Set the index of the facet that record the daily surface temperatures.

pub fn has_last_revolution_started(&self) -> bool[src]

Check if the record of the last revolution has started, i.e. the index of the filled got updated to more than 0.

pub fn daily_surface_temperatures(&self) -> &VX<f64>[src]

Daily surface temperatures getter.

pub fn daily_surface_temperatures_mut(&mut self) -> &mut VX<f64>[src]

Daily surface temperatures mutable getter.

pub fn initiate_daily_record(&mut self, size: usize)[src]

Initiate the record of the daily surface temperatures.

pub fn set_daily_surface_temperatures(&mut self)[src]

Save daily surface temperature.

pub fn revolution_iteration(&mut self)[src]

Iterate in the revolution of the celestial body around its spin axis over a time step.

pub fn direct_solar_flux(&self, position_sun: &V3<f64>) -> VX<f64>[src]

Compute the direct solar flux at the surface of the celestial body.

Expression

U=\frac{F_s\left(1-A\right)\cos\varsigma\left(t\right)}{r_H^2\left(t\right)}

pub fn illumination_cosine(&self, position_sun: &V3<f64>) -> VX<f64>[src]

Compute the illumation angles for each face at the surface of the celestial body (angle between the normal of each face and the direction of the Sun).

pub fn facets_directions_to_sun(&self, position_sun: &V3<f64>) -> V3X<f64>[src]

Compute the direction of the Sun for each face at the surface of the celestial body.

pub fn distance_to(&self, other_position: &V3<f64>) -> f64[src]

Compute the distance of the celestial body to the given position.

pub fn set_faces_mask_equator(&mut self)[src]

Update the view with the indices of the faces that are located at the equator.

pub fn new_face(&mut self, vertices: M3<f64>)[src]

Add a face to the 3D object.

pub fn recompute(&mut self)[src]

Recompute data on the body after some changes (like number of facets or sublayers).

pub fn fixed(&mut self, is_fixed: bool)[src]

Change whether the body is fixed or rotating.

pub fn fixed_surface_temperatures(&self) -> bool[src]

Get whether the temperatures at the surface are fixed (e.g. Dirichlet problem).

pub fn set_fixed_surface_temperatures(&mut self, is_fixed: bool)[src]

Change whether the temperatures at the surface are fixed (e.g. Dirichlet problem).

pub fn fixed_ground_limit_temperatures(&self) -> bool[src]

Get whether the temperatures at the ground limit is be fixed (e.g. Dirichlet problem).

pub fn set_fixed_ground_limit_temperatures(&mut self, is_fixed: bool)[src]

Change whether the temperatures at the ground limit is be fixed (e.g. Dirichlet problem).

pub fn compute_self_view_factor(&mut self)[src]

Compute the view factor of the target body with itself.

pub fn self_view_factor(&mut self) -> &DMatrix<f64>[src]

Get the self view factor.

Auto Trait Implementations

impl RefUnwindSafe for Body

impl Send for Body

impl Sync for Body

impl Unpin for Body

impl UnwindSafe for Body

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,