fastoad.openmdao.problem module
- class fastoad.openmdao.problem.FASTOADProblem(*args, **kwargs)[source]
Bases:
openmdao.core.problem.ProblemVanilla OpenMDAO Problem except that it can write its outputs to a file.
It also runs
ValidityDomainCheckerafter eachrun_model()orrun_driver()(but it does nothing if no check has been registered).Initialize attributes.
- Parameters
model (<System> or None) – The top-level <System>. If not specified, an empty <Group> will be created.
driver (<Driver> or None) – The driver for the problem. If not specified, a simple “Run Once” driver will be used.
comm (MPI.Comm or <FakeComm> or None) – The global communicator.
name (str) – Problem name. Can be used to specify a Problem instance when multiple Problems exist.
**options (named args) – All remaining named args are converted to options.
- input_file_path
File path where
read_inputs()will read inputs
- output_file_path
File path where
write_outputs()will write outputs
- additional_variables
Variables that are not part of the problem but that should be written in output file.
- run_model(case_prefix=None, reset_iter_counts=True)[source]
Run the model by calling the root system’s solve_nonlinear.
- class fastoad.openmdao.problem.AutoUnitsDefaultGroup(**kwargs)[source]
Bases:
openmdao.core.group.GroupOpenMDAO group that automatically use self.set_input_defaults() to resolve declaration conflicts in variable units.
Set the solvers to nonlinear and linear block Gauss–Seidel by default.
- Parameters
**kwargs (dict) – dict of arguments available here and in all descendants of this Group.
- configure()[source]
Configure this group to assign children settings.
This method may optionally be overidden by your Group’s method.
You may only use this method to change settings on your children subsystems. This includes setting solvers in cases where you want to override the defaults.
You can assume that the full hierarchy below your level has been instantiated and has already called its own configure methods.
- Available attributes:
name pathname comm options system hieararchy with attribute access
- class fastoad.openmdao.problem.FASTOADModel(**kwargs)[source]
Bases:
fastoad.openmdao.problem.AutoUnitsDefaultGroupOpenMDAO group that defines active submodels after the initialization of all its subsystems, and inherits from
AutoUnitsDefaultGroupfor resolving declaration conflicts in variable units.It allows to have a submodel choice in the initialize() method of a FAST-OAD module, but to possibly override it with the definition of
active_submodels(i.e. from the configuration file).Set the solvers to nonlinear and linear block Gauss–Seidel by default.
- Parameters
**kwargs (dict) – dict of arguments available here and in all descendants of this Group.
- active_submodels
Definition of active submodels that will be applied during setup()
- setup()[source]
Build this group.
This method should be overidden by your Group’s method. The reason for using this method to add subsystem is to save memory and setup time when using your Group while running under MPI. This avoids the creation of systems that will not be used in the current process.
You may call ‘add_subsystem’ to add systems to this group. You may also issue connections, and set the linear and nonlinear solvers for this group level. You cannot safely change anything on children systems; use the ‘configure’ method instead.
- Available attributes:
name pathname comm options