|
|
|
## 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`. Additionally, 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 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`. Additionally, 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. It is highly recommended to import the DART modules before any other external module, so as to avoid potential conflicts with backend libraries.
|
|
|
|
|
|
|
|
**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,
|
|
|
|
`dart` contains all the features required to solve the full potential equation. `tbox` contains the basic features of a finite element framework. Finally, `fwk` contains some common and useful features, such as the timers. If DART is used for development, users can import using,
|
|
|
|
```python
|
|
|
|
import fwk
|
|
|
|
import dart
|
|
|
|
import tbox
|
|
|
|
import tbox.gmsh as gmsh
|
|
|
|
import dart
|
|
|
|
import fwk
|
|
|
|
```
|
|
|
|
If DART has been installed, users need to import using,
|
|
|
|
```python
|
|
|
|
from dartflo import fwk
|
|
|
|
from dartflo import dart
|
|
|
|
from dartflo import tbox
|
|
|
|
from dartflo.tbox import gmsh
|
|
|
|
from dartflo import dart
|
|
|
|
from dartflo import fwk
|
|
|
|
```
|
|
|
|
|
|
|
|
**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
|
|
|
|
``` |
|
|
\ No newline at end of file |