|
|
|
## 0. Importing the modules
|
|
|
|
DART can be readily used through python because SWIG has been used to generate wrappers. More specifically, SWIG produces a shared library `_modulew.[so|pyd]` and a python module `modulew.py`. Additionaly, the repository is organized such that the folder `module` automatically imports the modules it depends on. Consequently, users only need to import the required modules, as they would do for any package written in pure python.
|
|
|
|
|
|
|
|
**External modules**
|
|
|
|
`math` or `numpy` modules contain useful mathematics constant/functions. Since `math` is a default module of python while `numpy` needs to be installed, this documentation will use `math`.
|
|
|
|
```python
|
|
|
|
import math # or import numpy
|
|
|
|
```
|
|
|
|
|
|
|
|
**DART modules**
|
|
|
|
`fwk` contains some common and useful features, such as the timers. `tbox` contains the basic features of a finite element framework. Finally, `dart` contains all the features required to solve the full potential equation. If DART is used for development, users can import using,
|
|
|
|
```python
|
|
|
|
import fwk
|
|
|
|
import tbox
|
|
|
|
import tbox.gmsh as gmsh
|
|
|
|
import dart
|
|
|
|
```
|
|
|
|
If DART has been installed, users need to import using,
|
|
|
|
```python
|
|
|
|
from dartflo import fwk
|
|
|
|
from dartflo import tbox
|
|
|
|
from dartflo.tbox import gmsh
|
|
|
|
from dartflo import dart
|
|
|
|
``` |