Skip to content

Model generation

Generate a flat CellML (or Python / C++ / CasADi) model from the module array and parameters file referenced by the configuration dict.

libcuflynx.scripts.script_generate_with_new_architecture.generate_with_new_architecture

generate_with_new_architecture(
    do_generation_with_fit_parameters=False,
    inp_data_dict=None,
)

Generate a model from its module array and parameters file.

Reads the module array (CSV or JSON) and the parameters file (JSON) the config names and emits a flat model in the configured model_type (CellML, Python, C++ or CasADi) into the generated-models directory.

Parameters:

Name Type Description Default
do_generation_with_fit_parameters

If True, regenerate using previously fitted parameters instead of the values in the parameters file.

False
inp_data_dict

Configuration dict (see [get_default_inp_data_dict][utilities.utility_funcs.get_default_inp_data_dict]). If None, the values are loaded from user_inputs.yaml.

None

Returns:

Name Type Description
bool

True if generation succeeded, False otherwise.

Converting 0D vessels to 1D

libcuflynx.scripts.convert_0d_to_1d.convert_0d_to_1d

convert_0d_to_1d(
    model,
    folder_0d,
    param_file_0d,
    folder_hyb=None,
    vess_1d_list=[],
    module_sources_inputs=None,
)

module_sources_inputs: the module source settings (module_library_dirs, use_builtin_modules, external_modules_dir) whose module configs give each 0D neighbour's coupling port; default the built-in modules.