Struct gmt_fem::FEM

source ·
pub struct FEM {
    pub model_description: String,
    pub inputs: Vec<Option<Inputs>>,
    pub outputs: Vec<Option<Outputs>>,
    pub eigen_frequencies: Vec<f64>,
    pub inputs_to_modal_forces: Vec<f64>,
    pub modal_disp_to_outputs: Vec<f64>,
    pub proportional_damping_vec: Vec<f64>,
    pub static_gain: Option<Vec<f64>>,
    pub n_io: (usize, usize),
    /* private fields */
}
Expand description

GMT Finite Element Model

Fields§

§model_description: String

Model info

§inputs: Vec<Option<Inputs>>

inputs properties

§outputs: Vec<Option<Outputs>>

outputs properties

§eigen_frequencies: Vec<f64>

mode shapes eigen frequencies [Hz]

§inputs_to_modal_forces: Vec<f64>

inputs forces to modal forces matrix [n_modes,n_inputs] (row wise)

§modal_disp_to_outputs: Vec<f64>

mode shapes to outputs nodes [n_outputs,n_modes] (row wise)

§proportional_damping_vec: Vec<f64>

mode shapes damping coefficients

§static_gain: Option<Vec<f64>>§n_io: (usize, usize)

number of inputs and outputs before any model reduction

Implementations§

source§

impl FEM

source

pub fn from_zip_archive<P: AsRef<Path>>(path: P) -> Result<FEM>

Loads a FEM model, saved in a second order form, from a zip archive file

source

pub fn from_env() -> Result<Self>

Loads a FEM model, saved in a second order form, from a zip archive file located in a directory given by the FEM_REPO environment variable

The name of the zip file must be "modal_state_space_model_2ndOrder.zip

source

pub fn n_modes(&self) -> usize

Gets the number of modes

source

pub fn eigen_frequencies_to_radians(&self) -> Vec<f64>

Converts FEM eigen frequencies from Hz to radians

source

pub fn n_inputs(&self) -> usize

Gets the number of inputs

source

pub fn n_outputs(&self) -> usize

Gets the number of outputs

source

pub fn keep_inputs(&mut self, id: &[usize]) -> &mut Self

Selects the inputs according to their natural ordering

source

pub fn keep_inputs_by<F>(&mut self, id: &[usize], pred: F) -> &mut Self
where F: Fn(&IOData) -> bool + Copy,

Selects the inputs according to their natural ordering and some properties matching

source

pub fn keep_outputs(&mut self, id: &[usize]) -> &mut Self

Selects the outputs according to their natural ordering

source

pub fn keep_outputs_by<F>(&mut self, id: &[usize], pred: F) -> &mut Self
where F: Fn(&IOData) -> bool + Copy,

Selects the outputs according to their natural ordering and some properties matching

source

pub fn filter_inputs_by<F>(&mut self, id: &[usize], pred: F) -> &mut Self
where F: Fn(&IOData) -> bool + Copy,

Filters the inputs according to some properties matching

source

pub fn remove_inputs_by<F>(&mut self, id: &[usize], pred: F) -> &mut Self
where F: Fn(&IOData) -> bool + Copy,

Removes the inputs which properties do not match the predicate

source

pub fn filter_outputs_by<F>(&mut self, id: &[usize], pred: F) -> &mut Self
where F: Fn(&IOData) -> bool + Copy,

Filters the outputs according to some properties matching

source

pub fn inputs2modes(&mut self) -> Vec<f64>

Returns the inputs 2 modes transformation matrix for the turned-on inputs

source

pub fn input2modes(&self, id: usize) -> Option<Vec<f64>>

Returns the inputs 2 modes transformation matrix for a given input

source

pub fn trim2input( &self, id: usize, matrix: &DMatrix<f64> ) -> Option<DMatrix<f64>>

source

pub fn modes2outputs(&mut self) -> Vec<f64>

Returns the modes 2 outputs transformation matrix for the turned-on outputs

source

pub fn modes2output(&self, id: usize) -> Option<Vec<f64>>

Returns the modes 2 outputs transformation matrix for a given output

source

pub fn trim2output( &self, id: usize, matrix: &DMatrix<f64> ) -> Option<DMatrix<f64>>

source

pub fn reduced_static_gain(&mut self) -> Option<DMatrix<f64>>

Return the static gain reduced to the turned-on inputs and outputs

source

pub fn static_gain(&mut self) -> DMatrix<f64>

Returns the FEM static gain for the turned-on inputs and outputs

Trait Implementations§

source§

impl Clone for FEM

source§

fn clone(&self) -> FEM

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for FEM

source§

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

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

impl Default for FEM

source§

fn default() -> FEM

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

impl<'de> Deserialize<'de> for FEM

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 Display for FEM

source§

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

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

impl Serialize for FEM

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§

§

impl RefUnwindSafe for FEM

§

impl Send for FEM

§

impl Sync for FEM

§

impl Unpin for FEM

§

impl UnwindSafe for FEM

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

§

type Output = T

Should always be Self
§

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

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

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

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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>,

§

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.
§

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

§

fn vzip(self) -> V

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

source§

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