Skip to content

Commit 6267bae

Browse files
authored
Add Abstract Droplet Simulation (#14)
* Add JSON porter for network and simulation import new json model * :text: Update Network1a to new json model * :text: Refactor Network1a-d JSON files * 🔨 Merge 1D and Hybrid - network architecture * 🎉 Initial commit merged 1D and Hybrid Simulators * 🔀 merge main into addDroplet1D * 🚨 Add tests of 1D droplet simulator * 🚧 WIP: Making 1D droplet tests pass * ✔️ Make 1D droplet tests pass * ✔️ Make all tests pass * ⚡ Update example cases for new JSON porting definition * 🚨 Update tests with main branch * Refactor code for no interdependency * 🐛 Fix compiler warnings * 🐛 Memory allocation in lbmModule * 🐍 Fix python binding * Add Windows CI * 🚨 Add tests for windows * 🐍 Add python wheels - windows * Undo separate droplet definition in JSON * Rename enumeration values of Type and Platform * Create porting functions for json string * 🔨 Refactor result.json output * :bugfix: Store JSON results according to index ordering * 🐛 Fix unique droplet ID in JSON result * 🐛 Add volume to droplet definition in JSON result * WIP: Update Python Bindings * Add Python Test Abstract Droplet * WIP: Add Python Test for Continuous Hybrid * Add tests for JSON definition * WIP: Update Readme * Add VTK Folder entry to JSON Definition * 📚 🚨 WIP: Update Readme and Add Tests New Release * 📚 🚨 Update Readme and Add Tests New Release * 📚 Update Readme New Release * Prepare Rename MMFT Hybrid Simulator to MMFT Simulator * Update Readme * Add missing documentation * Fix python package init * 🔥 Disable windows wheel build * 🐛 Fix Test option cmake
1 parent 223695c commit 6267bae

103 files changed

Lines changed: 13228 additions & 5254 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Windows-build
2+
3+
on: [push]
4+
5+
defaults:
6+
run:
7+
shell: pwsh
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
submodules: recursive
17+
18+
- uses: msys2/setup-msys2@v2
19+
20+
- name: Configure CMake
21+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G "MinGW Makefiles"
22+
23+
- name: Build
24+
run: cmake --build build

.github/workflows/publish-to-pypi.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,41 @@ concurrency:
1515

1616
jobs:
1717
build_wheels:
18-
name: ${{ matrix.os }} wheels
19-
runs-on: ${{ matrix.os }}
18+
name: ${{ matrix.runs-on.os }} ${{ matrix.python }} wheels
19+
runs-on: ${{ matrix.runs-on.os }}
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
os: [ ubuntu-latest ]
23+
runs-on:
24+
- { os: ubuntu-latest, shell: bash }
25+
- { os: macos-11, shell: bash }
26+
#- { os: windows-latest, shell: "msys2 {0}" }
27+
python: ["cp38", "cp39", "cp310", "cp311", "cp312"]
28+
defaults:
29+
run:
30+
shell: ${{ matrix.runs-on.shell }}
2431
steps:
2532
- uses: actions/checkout@v3
2633
with:
2734
fetch-depth: 0
2835
submodules: recursive
36+
- if: runner.os == 'Windows'
37+
uses: msys2/setup-msys2@v2
38+
with:
39+
msystem: MINGW64
40+
path-type: inherit
41+
install: >-
42+
mingw-w64-x86_64-gcc
2943
- name: Build wheels
30-
uses: pypa/cibuildwheel@v2.12.3
31-
- uses: actions/upload-artifact@v3
44+
run: |
45+
pipx run cibuildwheel
46+
env:
47+
CIBW_ARCHS_WINDOWS: auto64
48+
CIBW_ENVIRONMENT_WINDOWS: CC=gcc CXX=g++
49+
- name: Upload wheels
50+
uses: actions/upload-artifact@v3
3251
with:
52+
name: cibw-wheels-${{ runner.os }}-${{ matrix.python }}-${{ strategy.job-index }}
3353
path: ./wheelhouse/*.whl
3454

3555
build_sdist:

.github/workflows/ubuntu_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
submodules: recursive
1616

1717
- name: Configure CMake
18-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
18+
run: cmake -DTEST=ON -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
1919

2020
- name: Build
2121
run: cmake --build ${{github.workspace}}/build

.github/workflows/windows_test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Windows-test
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited]
6+
branches: [main, develop]
7+
8+
defaults:
9+
run:
10+
shell: pwsh
11+
12+
jobs:
13+
test:
14+
runs-on: windows-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
submodules: recursive
20+
21+
- uses: msys2/setup-msys2@v2
22+
23+
- name: Configure CMake
24+
run: cmake -DTEST=ON -S . -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G "MinGW Makefiles"
25+
26+
- name: Build
27+
run: cmake --build build
28+
29+
- name: Test
30+
working-directory: ${{github.workspace}}/build
31+
run: ./simulatorTest

CMakeLists.txt

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cmake_minimum_required(VERSION 3.21.0)
22

3-
project(hybrid-simulator
4-
DESCRIPTION "Hybrid simulator for closed channel-based microfluidic devices."
5-
HOMEPAGE_URL "https://github.com/cda-tum/mmft-hybrid-simulator.git"
3+
project(MMFT-simulator
4+
DESCRIPTION "Simulator for closed channel-based microfluidic devices."
5+
HOMEPAGE_URL "https://github.com/cda-tum/mmft-simulator.git"
66
LANGUAGES CXX C
77
)
88

@@ -14,6 +14,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1414
add_compile_definitions(PLATFORM_CPU_SISD)
1515
set(CMAKE_CXX_FLAGS "-O3 -Wall -march=native -mtune=native")
1616

17+
IF (WIN32)
18+
set(patch_file ${CMAKE_CURRENT_BINARY_DIR}/_deps/lbm-src/src/core/singleton.h)
19+
set(lbm_patch sed -i -f ${CMAKE_CURRENT_SOURCE_DIR}/script.sed ${patch_file})
20+
ELSE()
21+
set(lbm_patch )
22+
ENDIF()
23+
1724
# download external libraries
1825
include(FetchContent)
1926
FetchContent_Declare(
@@ -34,6 +41,7 @@ FetchContent_Declare(
3441
FetchContent_Declare(
3542
lbm
3643
URL https://www.openlb.net/wp-content/uploads/2022/04/olb-1.5r0.tgz
44+
PATCH_COMMAND ${lbm_patch}
3745
CONFIGURE_COMMAND ""
3846
BUILD_COMMAND ""
3947
)
@@ -90,7 +98,7 @@ target_include_directories(
9098
${lbm_SOURCE_DIR}/external/zlib
9199
)
92100
# add library
93-
set(TARGET_NAME hybridLib)
101+
set(TARGET_NAME simLib)
94102
add_library(${TARGET_NAME})
95103

96104
# add sources
@@ -99,23 +107,29 @@ add_subdirectory(src)
99107
# create executable and tests (if build as main project)
100108

101109
# main executable
102-
add_executable(hybridSim)
103-
target_sources(hybridSim PUBLIC src/main.cpp)
104-
target_link_libraries(hybridSim PUBLIC ${TARGET_NAME})
110+
add_executable(MMFTSim)
111+
target_sources(MMFTSim PUBLIC src/main.cpp)
112+
target_link_libraries(MMFTSim PUBLIC ${TARGET_NAME})
105113

106114
# add Python binding code
107115
option(BINDINGS "Configure for building Python bindings")
108116
if(BINDINGS)
109-
add_subdirectory(python/mmft/hybridsim)
117+
add_subdirectory(python/mmft/simulator)
110118
endif()
111119

112120
# create tests
113-
enable_testing()
114-
include(GoogleTest)
115-
set(TARGET_NAME simulatorTest)
116-
add_executable(${TARGET_NAME})
117-
target_link_libraries(${TARGET_NAME} PUBLIC gtest gtest_main)
118-
target_link_libraries(${TARGET_NAME} PUBLIC gtest lbmLib)
119-
target_link_libraries(${TARGET_NAME} PUBLIC gtest hybridLib)
120-
add_subdirectory(tests)
121-
gtest_discover_tests(${TARGET_NAME})
121+
option(TEST "Configure for building test cases")
122+
if(TEST)
123+
enable_testing()
124+
include(GoogleTest)
125+
set(TARGET_NAME testLib)
126+
add_library(${TARGET_NAME})
127+
add_subdirectory(tests)
128+
add_executable(simulatorTest)
129+
target_sources(simulatorTest PUBLIC tests/test.cpp)
130+
target_link_libraries(simulatorTest PUBLIC gtest gtest_main)
131+
target_link_libraries(simulatorTest PUBLIC gtest lbmLib)
132+
target_link_libraries(simulatorTest PUBLIC gtest simLib)
133+
target_link_libraries(simulatorTest PUBLIC gtest testLib)
134+
gtest_discover_tests(simulatorTest)
135+
endif()

0 commit comments

Comments
 (0)