-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation and test CI for pyFANS
- Loading branch information
1 parent
6f9e600
commit 251c665
Showing
9 changed files
with
108 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Test PyFans | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
container: unistuttgartdae/fans-ci:noble | ||
defaults: | ||
run: | ||
shell: "bash --login -eo pipefail {0}" | ||
env: | ||
FANS_BUILD_DIR: build | ||
FANS_MPI_USER: fans | ||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Generate build directory | ||
run: mkdir -p ${{ env.FANS_BUILD_DIR }} | ||
|
||
- name: Configure | ||
working-directory: ${{ env.FANS_BUILD_DIR }} | ||
run: | | ||
cmake .. -DFANS_LIB=ON | ||
make | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Run micro_mesh.py | ||
run: | | ||
pipx install numpy | ||
cd test/test_pyfans | ||
python run_fans_as_library.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# pyFANS | ||
|
||
pyFANS is a Python-wrapped library to control FANS via the [Micro Manager](https://precice.org/tooling-micro-manager-overview.html). The main idea is to create a large number of FANS simulations, and couple them to one macro-scale simulation typically in Abaqus, CalculiX, etc. The library follows the [API of the Micro Manager](https://precice.org/tooling-micro-manager-prepare-micro-simulation.html). | ||
|
||
## Dependencies | ||
|
||
- [pybind11](https://pybind11.readthedocs.io/en/stable/index.html) | ||
|
||
## Building | ||
|
||
To build FANS as a library, set the CMake variable `FANS_LIB` to `ON`. The CMake command to compile FANS would then be `cmake .. -DFANS_LIB=ON`. | ||
|
||
## Usage | ||
|
||
pyFANS is intended to be used with the Micro Manager and preCICE for two-scale coupled simulations. However, standalone use of the library is not restricted per se. Look at the [test_pyfans](../test/test_pyfans/) example to see how the library is used in a Python script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Test pyFANS | ||
|
||
Test pyFANS as standalone library called from a Python script. | ||
|
||
## Build pyFANS | ||
|
||
Configure the FANS CMake build with the variable `FANS_LIB` set to `ON`. | ||
|
||
## Run the test | ||
|
||
Run | ||
|
||
```bash | ||
python3 run_fans_as_library.py | ||
``` | ||
|
||
The script creates a pyFANS object and calls the `solve()` method. The script only checks if the pyFANS object is created and the solve function is callable. The result is not checked for correctness. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"ms_filename": "../microstructures/sphere32.h5", | ||
"ms_datasetname": "/sphere/32x32x32/ms", | ||
"ms_L": [1.0, 1.0, 1.0], | ||
|
||
"problem_type": "mechanical", | ||
"matmodel": "LinearElasticIsotropic", | ||
"material_properties":{ | ||
"bulk_modulus": [62.5000, 222.222], | ||
"shear_modulus": [28.8462, 166.6667] | ||
}, | ||
|
||
"method": "cg", | ||
"error_parameters":{ | ||
"measure": "Linfinity", | ||
"type": "absolute", | ||
"tolerance": 1e-10 | ||
}, | ||
"n_it": 100, | ||
"macroscale_loading": [ | ||
[[1, 0, 0, 0, 0, 0]], | ||
[[0, 1, 0, 0, 0, 0]], | ||
[[0, 0, 1, 0, 0, 0]], | ||
[[0, 0, 0, 1, 0, 0]], | ||
[[0, 0, 0, 0, 1, 0]], | ||
[[0, 0, 0, 0, 0, 1]] | ||
], | ||
|
||
"results": ["stress_average", "strain_average", "absolute_error", "phase_stress_average", "phase_strain_average", | ||
"microstructure", "displacement", "stress", "strain"] | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.