Update home authored by Adrien Crovato's avatar Adrien Crovato
...@@ -20,16 +20,20 @@ python3 run.py path/to/case.py ...@@ -20,16 +20,20 @@ python3 run.py path/to/case.py
## Use ## Use
PyPK is initialized through its API `init_pypk`. Examples can be found under the tests directory. A case file typically contains the following lines PyPK is initialized through its API `init_pypk`. Examples can be found under the tests directory. A case file typically contains the following lines
```python ```python
# Initialize
from pypk import init_pypk from pypk import init_pypk
cfg = {...} cfg = {...}
solver = init_pypk(cfg) solver = init_pypk(cfg)
solver.set_matrices(m, k, q) solver.set_matrices(m, k, q)
# Compute flutter solution
solver.compute() solver.compute()
solver.find_flutter() solver.find_flutter()
solver.save(case_name) solver.save(case_name)
solver.plot(case_name, show=True, format=fmt) solver.plot(case_name, show=True, format=fmt)
# Compute gradients (only available for NIPK)
solver.compute_gradients()
``` ```
where `cfg` is a `dict` defining the configuration of the solution method, `m`, `k` and `q` are the mass, stiffness and aerodynamic force matrices provided as `numpy array`, and `case_name` and `fmt` are `str`. where `cfg` is a `dict` defining the configuration of the solution method, `m`, `k` and `q` are the mass, stiffness and aerodynamic force matrices provided as `numpy array`, and `case_name` and `fmt` are `str`. The variables are stored as public attributes of the `solver` and are listed in [`Solution.__init__()`](https://gitlab.uliege.be/am-dept/pypk/-/blob/master/pypk/solution.py).
PyPK has also been interfaced with OpenMDAO for performing flutter-constrained optimization, see [OMFlut](https://gitlab.uliege.be/am-dept/omflut). Within that context, its builder must be imported using `from pypk.api_om import PypkBuilder`, then initialized with a configuration dictionary and provided to an OMFLut FlutterGroup as `FlutterGroup(..., flutter=PypkBuilder(cfg))`. PyPK has also been interfaced with OpenMDAO for performing flutter-constrained optimization, see [OMFlut](https://gitlab.uliege.be/am-dept/omflut). Within that context, its builder must be imported using `from pypk.api_om import PypkBuilder`, then initialized with a configuration dictionary and provided to an OMFLut FlutterGroup as `FlutterGroup(..., flutter=PypkBuilder(cfg))`.
The configuration dictionary contains the following entries The configuration dictionary contains the following entries
... ...
......