optframework.dpbe.dpbe_extruder module
Created on Wed Dec 11 15:01:34 2024
@author: px2030
- class optframework.dpbe.dpbe_extruder.ExtruderPBESolver(dim, NC, t_total=601, t_write=100, t_vec=None, load_attr=True, disc='geo', **attr)[source]
Bases:
object
- get_all_comp_params_from_dict(params_dict=None, same_pbe=False, N_feed=None, new_geo=None, new_global=None, new_local=None)[source]
Load component parameters from a dictionary instead of config files.
- The input dictionary should contain two sub-dictionaries:
“geom_params”: contains geometric parameters (e.g., fill_rate, geom_length)
- “pbe_params”: contains PBE parameters, with a sub-dictionary “global” for parameters common to all
components and additional sub-dictionaries “local_0”, “local_1”, … for each component.
- Additionally, three extra input variables can be provided:
new_geo: if provided (a dictionary), updates the “geom_params” entries.
new_global: if provided (a dictionary), updates the “global” sub-dictionary in “pbe_params”.
- new_local: if provided (a dictionary), it should contain keys (e.g., “local_0”, “local_1”, etc.)
whose corresponding values are dictionaries to update the existing local parameters.
- The method performs the following:
Sets geometric parameters (similar to set_comp_geom_params) using the (possibly updated) geom_params.
For each component, it updates the PBE parameters: - If same_pbe is True and i > 0, then only update V_unit and recalculate minimal parameters. - Otherwise, load the local parameters from the corresponding “local_i” dictionary (after updating with new_local if provided) into self.p. - The global parameters (updated by new_global if provided) are applied first.
For the first component (i == 0), it calls init_comp_params to initialize arrays.
Then, for each component, get_one_comp_params(i) is called to extract that component’s parameters.
Parameters
- params_dictdict
Dictionary with keys “geom_params” and “pbe_params”. “pbe_params” must contain a sub-dictionary “global” and local sub-dictionaries named “local_0”, “local_1”, …, “local_{NC-1}”.
- same_pbebool, optional
If True, the same PBE is used for all components except that V_unit is updated; default is False.
- N_feedarray_like, optional
If provided, the feed number is set in the first component’s N.
- new_geodict, optional
A dictionary of updates for geometric parameters. If provided, updates the contents of params_dict[“geom_params”].
- new_globaldict, optional
A dictionary of updates for global PBE parameters. If provided, updates the contents of params_dict[“pbe_params”][“global”].
- new_localdict, optional
A dictionary of updates for local PBE parameters. Expected keys are like “local_0”, “local_1”, etc. For each key present, the corresponding dictionary will update the local parameters stored in params_dict[“pbe_params”].
Raises
- ValueError
If the lengths of fill_rate or geom_length do not match the number of components (NC), or if any required key is missing.
- Exception
If the length of ‘alpha_prim’ (if provided) does not match self.dim**2.
Returns
- None
Updates the class attributes (especially the large matrices containing component parameters) in-place.