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
impl Generator
pub fn new() -> Self
pub fn generate_0d( &mut self, descriptor: Reactor0DDescriptor, dest: Option<String>, ) -> Result<CMCase, CMError>
pub fn generate_1d( &mut self, descriptor: PFRDescription, out_dir: Option<String>, ) -> Result<CMCase, CMError>
pub fn merge_from_memory( &self, connections: Option<[RawDataFlux; 2]>, ) -> Result<GenerateContract, CMError>
Sourcefn phases_by_reactor(&self) -> Vec<(&RawPhase, Option<&RawPhase>)>
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.
Sourcepub fn add_existing_case(
&mut self,
id: &str,
case_dir: &str,
keep_in_memory: bool,
) -> Result<(), CMError>
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.
pub fn merge( &self, root_dir: impl AsRef<Path>, ids: &[String], connections: Option<[RawDataFlux; 2]>, ) -> Result<GenerateContract, CMError>
Source§impl Generator
impl Generator
fn generate_0d_phase( &mut self, case: &mut CMCase, volume: f64, phase: PhaseCM, dest: Option<String>, ) -> Result<(), CMError>
fn impl_generate_0d( &mut self, descriptor: Reactor0DDescriptor, fields: Option<&[Field0D]>, dest: Option<String>, ) -> Result<CMCase, CMError>
fn impl_generate_1d( &mut self, case: &mut CMCase, descriptor: &PFRDescription, phase_d: PhaseCM, out_dir: Option<String>, ) -> Result<(), CMError>
fn merge_phase<'a, I>( phases: I, connections: Option<RawDataFlux>, ) -> Result<RawPhase, CMError>
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§
impl Freeze for Generator
impl RefUnwindSafe for Generator
impl Send for Generator
impl Sync for Generator
impl Unpin for Generator
impl UnsafeUnpin for Generator
impl UnwindSafe for Generator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
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
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.