Struct Vs30Point

Source
pub struct Vs30Point {
    pub lon: f64,
    pub lat: f64,
    pub vs30: f64,
    pub dl: Option<f64>,
    pub xvf: Option<u8>,
}
Expand description

Input point definition for which GMPE will be calculated.

Fields§

§lon: f64

Longitude in decimal degrees. Example: 142.23567

§lat: f64

Latitude in decimal degrees. Example: 50.35927

§vs30: f64

Average shear-wave velocity (Vs, in m/s) in the top 30 meters of soil.

§dl: Option<f64>

Depth (in meters) to the subsurface layer where Vs reaches 1400 m/s at the site.

§xvf: Option<u8>

Binary variable (0 or 1) indicating the site’s position relative to the volcanic front (specific to Japan).

Implementations§

Source§

impl Vs30Point

Source

pub fn new( lon: f64, lat: f64, vs30: f64, dl: Option<f64>, xvf: Option<u8>, ) -> Self

Create a new Vs30Point instance.

§Arguments
  • lon - Longitude in decimal degrees.
  • lat - Latitude in decimal degrees.
  • vs30 - Average Vs in the top 30 meters.
  • dl - Depth to Vs=1400 m/s layer (optional).
  • xvf - Binary volcanic front position indicator (optional).
§Example
use ground_motion_lib::gmm::Vs30Point;
let vs30_point = Vs30Point::new(142.523, 52.913, 300., Some(250.), Some(1));
println!("Point is {vs30_point:?}");
Source

pub fn get_gm<T: GroundMotionModeling>( &self, gmpe: &T, eq: &Earthquake, ) -> GmpePoint

Calculate ground motion value for this point and given earthquake, using a GMPE.

§Arguments
  • gmpe - Reference to a type implementing GroundMotionModeling.
  • eq - Earthquake source parameters.
§Returns

A GmpePoint with the computed value.

Trait Implementations§

Source§

impl Debug for Vs30Point

Source§

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

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

impl<'de> Deserialize<'de> for Vs30Point

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 Serialize for Vs30Point

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

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool

Source§

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