Skip to content
/ Finch Public

Finite difference heat transfer using Cabana for additive manufacturing

License

Notifications You must be signed in to change notification settings

ORNL-MDF/Finch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d8dfd1e · Feb 24, 2025
Feb 14, 2025
Aug 15, 2024
Mar 21, 2024
Sep 5, 2024
Aug 26, 2024
Mar 21, 2024
Oct 16, 2023
Feb 6, 2024
Aug 8, 2024
Oct 2, 2024
Feb 12, 2024
Feb 12, 2024
Feb 5, 2024
Sep 5, 2024

Repository files navigation

Finch

Finite difference heat transfer using Cabana for additive manufacturing

Dependencies

Dependency Version Required Details
CMake 3.12+ Yes Build system
Cabana 0.6.1 Yes Performance portable particle/grid library
json 3.10+ Yes Input files

Build Finch

Building Finch requires Cabana, Kokkos & MPI (Cabana dependencies), and json (for input files). A simple example for building on CPU is shown below.

# First build Kokkos.
# Change this path to your local Kokkos location
export KOKKOS_DIR=$HOME/kokkos
pushd $KOKKOS_DIR
mkdir build
pushd build
cmake \
    -D CMAKE_INSTALL_PREFIX=install \
    -D CMAKE_BUILD_TYPE="Release" \
    .. ;
make -j install
popd
popd

# Next, build Cabana, pointing to the Kokkos install
# Change this path to your local Cabana location
export CABANA_DIR=$HOME/Cabana
pushd $CABANA_DIR
mkdir build
pushd build
# Note that Finch requires the Cabana::Grid sub-package, which requires MPI.
cmake \
    -D CMAKE_PREFIX_PATH=$KOKKOS_DIR/build/install \
    -D Cabana_ENABLE_GRID=ON \
    -D CMAKE_INSTALL_PREFIX=install \
    -D CMAKE_BUILD_TYPE="Release" \
    .. ;
make -j install
popd
popd

# The json library for input parsing will be automatically downloaded and included in the Finch build. 
# It can also be built externally and included in the same manner as Cabana if needed.

# Finally, build Finch
mkdir build
pushd build
cmake \
  -D CMAKE_BUILD_TYPE="Release" \
  -D CMAKE_PREFIX_PATH="$CABANA_DIR/build/install" \
  -D CMAKE_INSTALL_PREFIX=install \
  .. ;
make -j install

Run Finch

The main Finch examples can be run with the scripts provided in examples/. Inputs are described in more detail in the examples/README.

This includes generating a scan path (the provided script defines path to the executable and inputs for the example):

cd examples/create_scan_path
./run_example.sh

and simulating the heat transfer for a simple path:

cd examples/single_line
./run_example.sh

Citing

If you use Finch in your work, please cite the current release or version used from Zenodo.

License

Finch is distributed under an open source 3-clause BSD license.