Skip to main content

Generator

Struct Generator 

Source
pub struct Generator {
    raw_phase: Vec<RawPhase>,
    existing_case: HashMap<String, PathBuf>,
}

Fields§

§raw_phase: Vec<RawPhase>§existing_case: HashMap<String, PathBuf>

Case directory of the reactors read from an existing flow map, by reactor id

Implementations§

Source§

impl Generator

Source

pub fn new() -> Self

Source

pub fn generate_0d( &mut self, descriptor: Reactor0DDescriptor, dest: Option<String>, ) -> Result<CMCase, CMError>

Source

pub fn generate_1d( &mut self, descriptor: PFRDescription, out_dir: Option<String>, ) -> Result<CMCase, CMError>

Source

pub fn merge_from_memory( &self, connections: Option<[RawDataFlux; 2]>, ) -> Result<GenerateContract, CMError>

Source

fn phases_by_reactor(&self) -> Vec<(&RawPhase, Option<&RawPhase>)>

Phases of each reactor in declaration order. Every reactor pushes its liquid phase first and its gas one right after when it has one, which is what pairs them back together.

Source

pub fn add_existing_case( &mut self, id: &str, case_dir: &str, keep_in_memory: bool, ) -> Result<(), CMError>

Declare a reactor whose flow map already exists instead of being generated. Its case is read where it lies, merge resolves the reactor id through existing_case.

Source

pub fn merge( &self, root_dir: impl AsRef<Path>, ids: &[String], connections: Option<[RawDataFlux; 2]>, ) -> Result<GenerateContract, CMError>

Source§

impl Generator

Source

fn generate_0d_phase( &mut self, case: &mut CMCase, volume: f64, phase: PhaseCM, dest: Option<String>, ) -> Result<(), CMError>

Source

fn impl_generate_0d( &mut self, descriptor: Reactor0DDescriptor, fields: Option<&[Field0D]>, dest: Option<String>, ) -> Result<CMCase, CMError>

Source

fn impl_generate_1d( &mut self, case: &mut CMCase, descriptor: &PFRDescription, phase_d: PhaseCM, out_dir: Option<String>, ) -> Result<(), CMError>

Source

fn merge_phase<'a, I>( phases: I, connections: Option<RawDataFlux>, ) -> Result<RawPhase, CMError>
where I: Iterator<Item = &'a RawPhase>,

Source

fn impl_merge<'a>( liquid_phase: impl Iterator<Item = &'a RawPhase>, gas_phase: impl Iterator<Item = &'a RawPhase>, connections: Option<[RawDataFlux; 2]>, ) -> Result<(RawPhase, Option<RawPhase>), CMError>

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

Source§

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