Skip to content

Release v0.4.0 #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e185190
Build FANS as a library to be coupled to a macro-scale simulation via…
IshaanDesai Nov 4, 2024
fed1280
added results_prefix field in input json
sanathkeshav Nov 5, 2024
91d1e13
Merge pull request #36 from DataAnalyticsEngineering/feature_result_p…
sanathkeshav Nov 5, 2024
b2aa364
Fix spack installation tutorial in README.md (#37)
juliusgh Nov 11, 2024
a4f8cc3
The LS1 PR: Introduce system for checking compiler flags: avx2 & fma …
claudiushaag Dec 3, 2024
62da6de
Conda-package (#39)
claudiushaag Dec 13, 2024
9570e40
Update README.md
sanathkeshav Dec 13, 2024
e8895e7
modified way to provide microstructure input in json (#43)
sanathkeshav Apr 1, 2025
86332d3
Update CHANGELOG entries
IshaanDesai Apr 1, 2025
49f4ee7
Add PR template (#45)
IshaanDesai Apr 2, 2025
680ae3c
Add dependabot config file
IshaanDesai Apr 3, 2025
64f70a4
added --version support for FANS (#50)
sanathkeshav Apr 17, 2025
5fece66
changed conda install fans to conda install conda-forge::fans in Read…
sanathkeshav Apr 17, 2025
3d07376
Remove Ubuntu focal from testing and Docker support (#51)
IshaanDesai Apr 24, 2025
c2da6ab
Remove OpenMP as a dependency as it is not used in the code
IshaanDesai May 2, 2025
3b64e43
Add support for MacOS with ARM CPUs (CMake + GitHub Action) (#25)
siggmo May 5, 2025
646c32e
Remove MPI initialization from pyFANS and add an integration test for…
IshaanDesai May 6, 2025
2142eaf
Add pytests for FANS (#55)
sanathkeshav May 12, 2025
6d8382e
Material model for grain boundary diffusion in polycrystals (#52)
sanathkeshav May 12, 2025
c5eaf8a
Update README.md
sanathkeshav May 19, 2025
54dd03a
Update README.md
sanathkeshav May 19, 2025
6960e64
Compiling on conda-forge's Macs (#59)
claudiushaag May 20, 2025
7c36d8a
Update CMakeLists.txt
sanathkeshav May 20, 2025
68bb0d0
Delete CMakePresets.json
sanathkeshav May 20, 2025
e508c38
Mixed BC support for FANS (#58)
sanathkeshav May 20, 2025
5aba266
Update Changelog
IshaanDesai May 21, 2025
f3e2431
added msutils as pypi dependency to pixi environment and bump python …
sanathkeshav May 21, 2025
48c617d
Rework existing README (#54)
IshaanDesai May 21, 2025
9a9ffc3
bump version
sanathkeshav May 21, 2025
055e4c7
Update pixi lock file to sync with workspace
sanathkeshav May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Add a short description of your contribution here. Skip this if the title is self-explanatory -->

Checklist:

- [ ] I made sure that the CI passed before I ask for a review.
- [ ] I added a summary of the changes (compared to the last release) in the `CHANGELOG.md`.
- [ ] If necessary, I made changes to the documentation and/or added new content.
- [ ] I will remember to squash-and-merge, providing a useful summary of the changes of this PR.
27 changes: 25 additions & 2 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ jobs:
strategy:
fail-fast: false
matrix:
UBUNTU_VERSION: [noble, jammy, focal]
UBUNTU_VERSION: [noble, jammy]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up pixi
uses: prefix-dev/[email protected]

- name: Generate build directory
run: mkdir -p ${{ env.FANS_BUILD_DIR }}

Expand Down Expand Up @@ -67,10 +70,30 @@ jobs:

- name: Tests
working-directory: ${{ env.FANS_BUILD_DIR }}
run: su -c "ctest" ${{ env.FANS_MPI_USER }}
run: |
su -c "ctest" ${{ env.FANS_MPI_USER }}

- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ format('Ubuntu {0}', matrix.UBUNTU_VERSION) }} CTest logs
path: ${{ env.FANS_BUILD_DIR }}/Testing/Temporary/LastTest.log

# ────────────────────────────────────────────────────────────────
# Pytest checks
# ────────────────────────────────────────────────────────────────
- name: Install Pixi Python deps
run: |
pixi --version
pixi install

- name: Run pytest checks on HDF5 output
run: pixi run test

- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ format('Ubuntu {0}', matrix.UBUNTU_VERSION) }} PyTest logs
path: |
**/pytest*.xml
**/.pytest_cache
102 changes: 102 additions & 0 deletions .github/workflows/build_and_test_mac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build and test macOS 15
# Builds FANS for macOS 15 on Apple Silicon CPU and runs the tests.

on:
push:
branches:
- main
- develop
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}

jobs:
build-macos:
name: macOS 15
runs-on: macos-15
env:
FANS_BUILD_DIR: build
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install FANS dependencies
run: |
brew install gnu-time cmake gcc@14
brew install open-mpi --build-from-source --cc=gcc-14
brew install hdf5-mpi --build-from-source --cc=gcc-14
brew install fftw eigen

- name: Set up pixi
uses: prefix-dev/[email protected]

- name: Generate build directory
run: mkdir -p ${{ env.FANS_BUILD_DIR }}

- name: Configure
working-directory: ${{ env.FANS_BUILD_DIR }}
env:
CC: gcc-14
CXX: g++-14
MPICC: mpicc
MPICXX: mpicxx
run: |
cmake --version
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..

- uses: actions/upload-artifact@v4
if: failure()
with:
name: macOS 15 CMakeCache
path: ${{ env.FANS_BUILD_DIR }}/CMakeCache.txt
- uses: actions/upload-artifact@v4
if: failure()
with:
name: macOS 15 CMakeLogs
path: '${{ env.FANS_BUILD_DIR }}/CMakeFiles/*.log'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: macOS 15 CompileCommands
path: ${{ env.FANS_BUILD_DIR }}/compile_commands.json

- name: Compile
working-directory: ${{ env.FANS_BUILD_DIR }}
run:
cmake --build . -j $(nproc) || cmake --build . -j1

- name: Tests
working-directory: ${{ env.FANS_BUILD_DIR }}
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest

- uses: actions/upload-artifact@v4
if: failure()
with:
name: macOS 15 CTest logs
path: ${{ env.FANS_BUILD_DIR }}/Testing/Temporary/LastTest.log

# ────────────────────────────────────────────────────────────────
# Pytest checks
# ────────────────────────────────────────────────────────────────
- name: Install Pixi Python deps
run: |
pixi --version
pixi install

- name: Run pytest checks on HDF5 output
run: pixi run test

- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ format('Ubuntu {0}', matrix.UBUNTU_VERSION) }} PyTest logs
path: |
**/pytest*.xml
**/.pytest_cache
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build-and-push:
strategy:
matrix:
ubuntu-version: [noble, jammy, focal]
ubuntu-version: [noble, jammy]

runs-on: ubuntu-latest

Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/test_pyfans.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test PyFans

on:
push:
branches:
- main
- develop
pull_request:
branches:
- "*"

jobs:
test-pyfans:
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: Install dependencies
run: |
apt update
apt install -y wget python3-venv

- name: Install preCICE
run: |
wget https://github.com/precice/precice/releases/download/v3.2.0/libprecice3_3.2.0_noble.deb
apt install -y ./libprecice3_3.2.0_noble.deb

- name: Install the Micro Manager
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install micro-manager-precice

- name: Configure
working-directory: ${{ env.FANS_BUILD_DIR }}
run: |
cmake .. -DFANS_LIBRARY_FOR_MICRO_MANAGER=ON
make

- name: Run a dummy macro-micro coupling test
run: |
. .venv/bin/activate
cd test/test_pyfans
python3 macro-cube.py & micro-manager-precice micro-manager-config.json
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,15 @@ test/input_files/**/*.json
**/scratch/

# Test microstructure files
!sphere.h5
!sphere32.h5

# Test input files
!test_LinearElastic.json
!test_LinearThermal.json
!test_PseudoPlastic.json
!test_J2Plasticity.json
!test_MixedBCs.json

# pixi environments
.pixi
*.egg-info
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# FANS Changelog

## v0.4.0

- Support compilaion on MacOS X via conda-forge https://github.com/DataAnalyticsEngineering/FANS/pull/59
- Add support for macroscale mixed stress-strain boundary conditions https://github.com/DataAnalyticsEngineering/FANS/pull/58
- Add grain boundary diffusion material model for polycrystals https://github.com/DataAnalyticsEngineering/FANS/pull/52
- Add a pixi environment for the FANS_dashboard and some tests https://github.com/DataAnalyticsEngineering/FANS/pull/55
- Remove MPI initialization from pyFANS and add an integration test for it https://github.com/DataAnalyticsEngineering/FANS/pull/46
- Native support for MacOS https://github.com/DataAnalyticsEngineering/FANS/pull/25
- Remove Ubuntu 20.04 from testing and Docker support https://github.com/DataAnalyticsEngineering/FANS/pull/51
- Add support for `--version` command line argument for checking the version of FANS
- Modify way to provide micro structure in JSON input https://github.com/DataAnalyticsEngineering/FANS/pull/43
- Add conda package for FANS https://github.com/DataAnalyticsEngineering/FANS/pull/39
- Introduce system for checking compiler flags: `avx2` & `fma` https://github.com/DataAnalyticsEngineering/FANS/pull/34
- Add `results_prefix` field in the JSON input https://github.com/DataAnalyticsEngineering/FANS/pull/36
- Build FANS as a library to be coupled to a macro-scale simulation via preCICE and the Micro Manager https://github.com/DataAnalyticsEngineering/FANS/pull/23

## v0.3.0

- Added Linear thermal and mechanical triclinic material models https://github.com/DataAnalyticsEngineering/FANS/pull/32
Expand Down
45 changes: 34 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.0...3.28)
cmake_minimum_required(VERSION 3.21)

# ##############################################################################
# GENERAL SETTINGS
# ##############################################################################

project(FANS
VERSION 0.3.0
VERSION 0.4.0
LANGUAGES C CXX
)

Expand All @@ -17,7 +17,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)

# with -fno-implicit-templates I get linker errors when using std:: stuff
# TODO: should be developer specific, by using e.g. CMake Presets
set(CMAKE_CXX_FLAGS "-fmax-errors=1 -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})

# IPO
Expand Down Expand Up @@ -54,9 +54,12 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# From https://stackoverflow.com/questions/73248130/how-to-avoid-the-removal-of-the-rpath-during-cmake-install-step

# Set RPATH to be relative and honor user overrides, whether at the command line or FetchContent
set(RPATH_BASE "$ORIGIN")
if(APPLE)
set(RPATH_BASE "@loader_path")
else()
set(RPATH_BASE "$ORIGIN")
endif()
file(RELATIVE_PATH REL_PATH_LIB
"/${CMAKE_INSTALL_BINDIR}/"
"/${CMAKE_INSTALL_LIBDIR}/")
Expand All @@ -81,12 +84,21 @@ find_package(HDF5 REQUIRED COMPONENTS CXX)

find_package(Eigen3 REQUIRED)

find_package(OpenMP REQUIRED)

find_package(MPI REQUIRED)

find_package(FFTW3 REQUIRED COMPONENTS DOUBLE MPI)

option(FANS_LIBRARY_FOR_MICRO_MANAGER "Building FANS as a library to be used by the Micro Manager." OFF)

if (FANS_LIBRARY_FOR_MICRO_MANAGER)
include(FetchContent)
FetchContent_Declare(
pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.12.0
)
FetchContent_MakeAvailable(pybind11)
endif()

# ##############################################################################
# TARGETS
# ##############################################################################
Expand All @@ -100,7 +112,7 @@ endif ()
add_library(FANS::FANS ALIAS FANS_FANS)

if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm|aarch64")
target_compile_options(FANS_FANS PUBLIC -march=armv8-a+simd+fp+crypto)

elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
target_compile_options(FANS_FANS PUBLIC -mavx2 -mfma)
endif ()
Expand All @@ -115,6 +127,10 @@ add_custom_command(
COMMENT "Create a symlink for FANS executable to ${CMAKE_CURRENT_SOURCE_DIR}/test/"
)

if (FANS_LIBRARY_FOR_MICRO_MANAGER)
add_subdirectory(pyfans)
endif ()

# ##############################################################################
# HEADERS
# ##############################################################################
Expand All @@ -132,13 +148,23 @@ set_property(TARGET FANS_FANS PROPERTY PUBLIC_HEADER
include/solverFP.h
include/solver.h
include/setup.h
include/mixedBCs.h

include/material_models/LinearThermal.h
include/material_models/GBDiffusion.h

include/material_models/LinearElastic.h
include/material_models/PseudoPlastic.h
include/material_models/J2Plasticity.h
)

# version.h is generated and added to the build include directory
configure_file(
"${PROJECT_SOURCE_DIR}/include/version.h.in"
"${PROJECT_BINARY_DIR}/include/version.h" @ONLY
)
target_include_directories(FANS_main PRIVATE "${PROJECT_BINARY_DIR}/include")

# ##############################################################################
# SOURCES
# ##############################################################################
Expand Down Expand Up @@ -175,9 +201,6 @@ target_compile_definitions(FANS_FANS PUBLIC ${FFTW3_DEFINITIONS})

target_link_libraries(FANS_FANS PUBLIC Eigen3::Eigen)

target_link_libraries(FANS_FANS PUBLIC OpenMP::OpenMP_CXX)


target_link_libraries(FANS_main PRIVATE FANS::FANS)

# ##############################################################################
Expand Down
Loading
Loading