[MPhys](https://github.com/openMDAO/MPHYS)(Multi-Physics) is a framework designed to perform multi-physics analysis and optimization, and is built on top of [OpenMDAO](https://openmdao.org/). The API allows to interface DART with other software through MPhys, and is implemented under [api/mphys](https://gitlab.uliege.be/am-dept/dartflo/blob/master/dart/api/mphys.py).
[MPhys](https://github.com/openMDAO/MPHYS)(Multi-Physics) is a framework designed to perform multi-physics analysis and optimization, and is built on top of [OpenMDAO](https://openmdao.org/). The API allows to interface DART with other software through MPhys, and is implemented under [api/mphys](https://gitlab.uliege.be/am-dept/dartflo/blob/master/dart/api/mphys.py).
**0. Importing the API**
**0. Importing the API**
Since MPhys couples multiple software, it is required to install them before using MPhys. As such, DART cannot be used from a development environment (it must be installed), and must be imported by calling,
Since MPhys couples multiple software, it is required to install them before using MPhys. As such, DART cannot be used from a development environment (it must be installed), and must be imported by calling,
```python
```python
fromdartflo.dart.api.mphysimportDartBuilder
fromdartflo.dart.api.mphysimportDartBuilder
```
```
**1. Initializing the interface**
**1. Initializing the interface**
In practise, the MPhys API uses the [Core API](use_api_core) to initialize DART. Note that the interface must be setup in an MPhys class,
In practise, the MPhys API uses the [Core API](use_api_core) to initialize DART. Note that the interface must be setup in an MPhys class,
where `cfg` is a dictionary of parameters (available choices are listed in [core](use_api_core)), and where valid choices for `scenario` are `'aerodynamic'` or `'aerostructural'`, and valid choices for `task` are `'analysis'` or `'optimization'`. Additionally, `saveAll` is a boolean indicating whether to write results to different files at each (major) iteration, and `raiseError` is a boolean indicating whether to raise an `OpenMDAO.AnalysisError` when the solver does not fully converge.
where `cfg` is a dictionary of parameters (available choices are listed in [core](use_api_core)), `save_all` is a boolean indicating whether to write results to different files at each (major) iteration, and `raise_error` is a boolean indicating whether to raise an `openmdao.api.AnalysisError` when the solver does not fully converge.
*Note* DART can be coupled with [pyGeo](https://github.com/mdolab/pyGeo), which uses the free-form deformation technique, to perform aerodynamic shape optimization. Since pyGeo only handles 3D geometries, users wanting to perform 2D shape optimization must provide a so-called 2.5D geometry, which consists of an extruded 2D geometry enclosed between two symmetry walls. In such a case, the parameters `'WakeTips'` MUST NOT be given.
*Note* DART can be coupled with [pyGeo](https://github.com/mdolab/pyGeo), which uses the free-form deformation technique, to perform aerodynamic shape optimization. Since pyGeo only handles 3D geometries, users wanting to perform 2D shape optimization must provide a so-called 2.5D geometry, which consists of an extruded 2D geometry enclosed between two symmetry walls. In such a case, the parameters `'free_edge'` MUST NOT be given.
**2. Using the interface**
**2. Using the interface**
Users should refer to the MPhys documentation to connect the interface through MPhys. In version 1.3.0, this is done by calling,
Users should refer to the MPhys documentation to connect the interface through MPhys. In version 2.0.0, this is done by calling,