| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Fourier-Accelerated Nodal Solver (FANS) is an FFT-based homogenization solver for microscale multiphysics problems. FANS is written in C++, built using CMake, and it has MPI parallelization.
Want to get started immediately?
FANS is available as a precompiled binary on conda-forge. Package managers such as conda, mamba, micromamba, and Pixi can be used to install FANS from the conda-forge channel.
Use Pixi (recommended):
# Install Pixi (if not already installed)
curl -fsSL https://pixi.sh/install.sh | sh
# Install FANS via Pixi
pixi global install fans
# Verify installation
FANS --versionThat's it! No dependencies to install, no compilation needed 🚀
To get started immediately, we include ready to use example input files and microstructures you can use as templates to create your own.
Recommended for: Developers, contributors, HPC users, or those needing custom builds.
FANS requires the following dependencies:
| Dependency | Purpose | |
|---|---|---|
| C++ Compiler | (GCC, Clang, etc.) | C++17 or newer |
| CMake | Build system | ≥ 3.21 |
| MPI | Parallel computing | (OpenMPI, MPICH, Intel MPI) |
| HDF5 | Data I/O | with MPI support |
| FFTW3 | FFT computations | with MPI support |
| Eigen3 | Linear algebra | ≥ 3.4 |
| nlohmann-json | JSON parsing | ≥ 3.11 |
| spdlog | Logging | ≥ 1.17 |
This uses the repository's pixi.toml to define the dev environment.
# Clone the repository
git clone https://github.com/DataAnalyticsEngineering/FANS.git
cd FANS
# Enter development environment (all dependencies pre-installed!)
pixi shell -e devWe recommend installing the dependencies using apt:
apt-get install -y \
build-essential \
cmake \
git \
file \
libhdf5-dev \
libhdf5-openmpi-dev \
libopenmpi-dev \
libeigen3-dev \
libfftw3-dev \
libfftw3-mpi-dev \
nlohmann-json3-dev \
libspdlog-devWe recommend installing the dependencies using brew:
brew install gnu-time cmake gcc@15
brew install open-mpi --build-from-source --cc=gcc-15
brew install hdf5-mpi --build-from-source --cc=gcc-15
brew install fftw eigen nlohmann-json spdlog
# Set environment variables
export CC=gcc-15 CXX=g++-15 MPICC=mpicc MPICXX=mpicxxSpack is a flexible package manager for building and managing software stacks in high-performance computing environments. Install Spack by following these installation instructions. Once Spack is set up, install the required dependencies:
spack install cmake
spack install mpi
spack install hdf5+cxx+mpi
spack install eigen
spack install fftw+mpi
spack install nlohmann-json
spack install spdlog
# Load dependencies
spack load cmake mpi hdf5 eigen fftw nlohmann-json spdlogAdditionally, optimized FFTW implementations can be used depending on your system's architecture:
Pre-configured Docker images are available for containerized deployments. See docker/README.md for further details.
# Clone the repository
git clone https://github.com/DataAnalyticsEngineering/FANS.git
cd FANS
# Create build directory
mkdir build && cd build
# Configure (basic)
cmake ..
# Build
cmake --build . -j
# Run tests with 8 mpi processes
cd ../test
./run_tests.sh -n 8Build options:
| CMake Option | Description | Default |
|---|---|---|
| CMAKE_BUILD_TYPE | Build type: Debug, Release, RelWithDebInfo | NONE |
| CMAKE_INTERPROCEDURAL_OPTIMIZATION | Enable link-time optimization (LTO) | ON (if supported) |
| FANS_BUILD_STATIC | Build static library | OFF |
| CMAKE_INSTALL_PREFIX | Installation directory | System default |
| FANS_ENABLE_SANITIZERS | Enable runtime sanitizers (AddressSanitizer and LeakSanitizer) for memory debugging | OFF |
FANS includes FANS_Dashboard.ipynb, a comprehensive pipeline for post-processing, visualization, and analysis of simulation results. We recommend setting up a Python virtual environment via Pixi with all required Python dependencies in an isolated environment:
# Install and activate the dashboard environment
pixi shell -e dashboardThe dashboard environment includes:
See FANS_Dashboard for further details.
FANS requires a JSON input file specifying the problem parameters. Example input files can be found in the test/input_files directory. It is recommended to use these files as a reference to create your input file.
"microstructure": {
"filepath": "microstructures/sphere32.h5",
"datasetname": "/sphere/32x32x32/ms",
"L": [1.0, 1.0, 1.0]
}"problem_type": "mechanical",
"strain_type": "small",
"materials": [
{
"phases": [0],
"matmodel": "PseudoPlasticLinearHardening",
"material_properties": {
"bulk_modulus": [62.5000],
"shear_modulus": [28.8462],
"yield_stress": [0.1],
"hardening_parameter": [0.0]
}
},
{
"phases": [1],
"matmodel": "LinearElasticIsotropic",
"material_properties": {
"bulk_modulus": [222.222],
"shear_modulus": [166.6667]
}
}
]phases: An array of phase IDs (material labels) from the microstructure that use this material model.
matmodel: The constitutive model for this material group. Available models include:
LinearThermalIsotropic for linear isotropic conductive material model.
LinearThermalTriclinic for linear triclinic conductive material model.
GBDiffusion for diffusion model with transversely isotropic grain boundary and isotropic bulk for polycrystalline materials.
LinearElasticIsotropic for linear isotropic elastic material model.
LinearElasticTriclinic for linear triclinic elastic material model.
PseudoPlasticLinearHardening / PseudoPlasticNonLinearHardening for plasticity mimicking model with linear/nonlinear hardening.
J2ViscoPlastic_LinearIsotropicHardening / J2ViscoPlastic_NonLinearIsotropicHardening for rate-independent / dependent J2 plasticity model with kinematic and linear/nonlinear isotropic hardening.
SaintVenantKirchhoff for the hyperelastic Saint Venant-Kirchhoff material model.
CompressibleNeoHookean for the compressible Neo-Hookean material model.
FiniteStrainJ2Plasticity for rate-independent finite-strain J2 plasticity with linear isotropic hardening.
material_properties: Material parameters specific to the chosen model. Properties are defined as arrays, where each element corresponds to one of the phases listed in the phases array.
"FE_type": "HEX8",
"method": "cg",
"error_parameters":{
"measure": "Linfinity",
"type": "absolute",
"tolerance": 1e-10
},
"n_it": 100,"macroscale_loading": [
[
[0.004, -0.002, -0.002, 0, 0, 0],
[0.008, -0.004, -0.004, 0, 0, 0],
[0.012, -0.006, -0.006, 0, 0, 0],
[0.016, -0.008, -0.008, 0, 0, 0],
],
[
[0, 0, 0, 0.002, 0, 0],
[0, 0, 0, 0.004, 0, 0],
[0, 0, 0, 0.006, 0, 0],
[0, 0, 0, 0.008, 0, 0],
]
],In the case of path/time-dependent loading, as shown, for example, in plasticity problems, the macroscale_loading array can include multiple steps with corresponding loading conditions.
FANS also supports mixed boundary conditions, where some components can be strain-controlled while others are stress-controlled:
"macroscale_loading": [{
"strain_indices" : [2,3,4,5],
"stress_indices" : [0,1],
"strain" : [[0.005 , 0.0, 0.0, 0.0],
[0.010 , 0.0, 0.0, 0.0]],
"stress" : [[0.0, 0.0],
[0.0, 0.0]]
}]"results": ["stress_average", "strain_average", "absolute_error", "phase_stress_average", "phase_strain_average",
"microstructure", "displacement", "displacement_fluctuation", "stress", "strain"]results: This array lists the quantities that should be stored in the results HDF5 file during the simulation. Each string in the array corresponds to a specific result:
Additional material model-specific results can be included depending on the problem type and material model. For plasticity models, internal variables such as plastic_strain, isotropic_hardening_variable, etc., are available. Append _gp to these field names (e.g., plastic_strain_gp) to output data at all Gauss points.
Funded by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy - EXC 2075 – 390740016. Contributions by Felix Fritzen are funded by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) within the Heisenberg program - DFG-FR2702/8 - 406068690; DFG-FR2702/10 - 517847245 and through NFDI-MatWerk - NFDI 38/1 - 460247524. We acknowledge the support of the Stuttgart Center for Simulation Science (SimTech).
| Back | FazBrowse Home | New Git URL |