Skip to content

Commit

Permalink
add heat equation example with video output
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Jan 30, 2021
1 parent d04cf5a commit 44699e9
Show file tree
Hide file tree
Showing 12 changed files with 131,365 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(EXAMPLES_LIST
custom-matrix-format
custom-stopping-criterion
ginkgo-overhead
heat-equation
minimal-cuda-solver
papi-logging
par-ilu-convergence
Expand Down
12 changes: 12 additions & 0 deletions examples/heat-equation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(target_name "heat-equation")
find_package(OpenCV)

if (OpenCV_FOUND)
add_executable(${target_name} ${target_name}.cpp)
target_link_libraries(${target_name} Ginkgo::ginkgo ${OpenCV_LIBS})
target_include_directories(${target_name} PRIVATE ${PROJECT_SOURCE_DIR})
configure_file(data/initial.mtx data/initial.mtx COPYONLY)
configure_file(data/source.mtx data/source.mtx COPYONLY)
else()
message("OpenCV not found, skipping heat-equation example")
endif()
19 changes: 19 additions & 0 deletions examples/heat-equation/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# set up script
if [ $# -ne 1 ]; then
echo -e "Usage: $0 GINKGO_BUILD_DIRECTORY"
exit 1
fi
BUILD_DIR=$1
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" &>/dev/null && pwd )

source ${THIS_DIR}/../build-setup.sh

# build
${CXX} -std=c++14 -o ${THIS_DIR}/heat-equation \
${THIS_DIR}/heat-equation.cpp \
-I${THIS_DIR}/../../include -I${BUILD_DIR}/include \
`pkg-config --cflags opencv4` \
-L${THIS_DIR} ${LINK_FLAGS} \
`pkg-config --libs opencv4`
Loading

0 comments on commit 44699e9

Please sign in to comment.