Module for building OpenMDAO problem from configuration file


Bases: object

class for configuring an OpenMDAO problem from a configuration file

See description of configuration file.


conf_file_path – if provided, configuration will be read directly from it

property input_file_path

path of file with input variables of the problem

property output_file_path

path of file where output variables will be written

get_problem(read_inputs: bool = False, auto_scaling: bool = False) fastoad.openmdao.problem.FASTOADProblem[source]

Builds the OpenMDAO problem from current configuration.

  • read_inputs – if True, the created problem will already be fed with variables from the input file

  • auto_scaling – if True, automatic scaling is performed for design variables and constraints


the problem instance


Reads the problem definition


conf_file – Path to the file to open or a file descriptor

save(filename: Optional[str] = None)[source]

Saves the current configuration If no filename is provided, the initially read file is used.


filename – file where to save configuration

write_needed_inputs(source_file_path: Optional[str] = None, source_formatter: Optional[] = None)[source]

Writes the input file of the problem with unconnected inputs of the configured problem.

Written value of each variable will be taken:

  1. from input_data if it contains the variable

  2. from defined default values in component definitions

  • source_file_path – if provided, variable values will be read from it

  • source_formatter – the class that defines format of input file. if not provided, expected format will be the default one.

get_optimization_definition() Dict[source]
Returns information related to the optimization problem:
  • Design Variables

  • Constraints

  • Objectives


dict containing optimization settings for current problem

set_optimization_definition(optimization_definition: Dict)[source]

Updates configuration with the list of design variables, constraints, objectives contained in the optimization_definition dictionary.

Keys of the dictionary are: “design_var”, “constraint”, “objective”.

Configuration file will not be modified until save() is used.


optimization_definition – dict containing the optimization problem definition