Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 42 additions & 0 deletions .github/workflows/regression.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Regression Tests

on:
schedule:
- cron: "0 0 * * *"
push:
branches: [main]
workflow_dispatch:
pull_request:
branches:
- main

jobs:
run-tests:
runs-on: [self-hosted]
strategy:
fail-fast: false
steps:
- name: checkout testapp
uses: actions/checkout@v4
- name: checkout opensn
uses: actions/checkout@v4
with:
repository: Open-Sn/opensn
path: opensn
- name: install opensn
shell: bash
run: |
module load opensn/clang/17 python3/3.12.3
cd opensn && mkdir build && mkdir install && cd build
cmake -DOPENSN_WITH_PYTHON=True -DCMAKE_INSTALL_PREFIX=../install .. && make -j && make install
- name: compile app
shell: bash
run: |
module load opensn/clang/17 python3/3.12.3
cd OpenSnApp && mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=../../opensn/install .. && make -j
- name: test examples
shell: bash
run: |
module load opensn/clang/17 python3/3.12.3
test/run_tests -d test/diffusion -j 32 -v 1 -w 3
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.git
cmake-build-debug/
cmake-build-debug
.idea
bin
build*/

# root Makefile is generated by CMake automatically
Makefile

# Latex compile files
*.aux
*.lof
*.log
*.lot
*.synctex.gz
*.toc
*.pdf

# All vtk mesh files
/*.vtu
/*.pvtu

# All exodus files
/*.e

# python files
.DS_Store
._.DS_Store
*.pyc
*.pmesh
__pycache__
**/__pycache__

*-private.sh

#visual studio code files
.vscode/

test/**/out/

#Scratch directory
scratch/
66 changes: 66 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
cmake_minimum_required(VERSION 3.14)
project(OpenSnApp LANGUAGES C CXX)

find_package(MPI REQUIRED)
find_package(VTK REQUIRED COMPONENTS
CommonCore
CommonDataModel
IOLegacy
IOCore
IOXML
ParallelCore
IOParallelXML
FiltersCore
IOEnSight
IOExodus
)
find_package(OpenSn REQUIRED)

find_package(pybind11 REQUIRED)

find_package(caliper REQUIRED)

find_package(Python REQUIRED COMPONENTS Interpreter Development)

file(GLOB_RECURSE DIFFUSION_SRCS CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/src/diffusion/*.cc)

# Python module
add_library(diffapp MODULE
src/main.cc
src/diff_py_app.cc
src/diffusion.cc
${DIFFUSION_SRCS}
)

execute_process(
COMMAND python3 -m pybind11 --includes
OUTPUT_VARIABLE PYBIND11_INCLUDE_FLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "-I" "" PYBIND11_INCLUDE_DIRS "${PYBIND11_INCLUDE_FLAGS}")
separate_arguments(PYBIND11_INCLUDE_DIRS)

target_include_directories(diffapp
PRIVATE
${PROJECT_SOURCE_DIR}/diffusion
${PYBIND11_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/external
${OpenSn_INSTALL_PREFIX}/include/opensn
)
target_link_libraries(diffapp PRIVATE opensn::libopensn opensn::libopensnpy MPI::MPI_CXX caliper pybind11::module Python::Python)

set_target_properties(diffapp PROPERTIES
PREFIX "" # remove "lib" prefix
OUTPUT_NAME "diffapp" # Python import name
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/python
)

# Optional executable
add_executable(diff_app_exec src/main.cc src/diff_py_app.cc src/diffusion.cc ${DIFFUSION_SRCS})
target_include_directories(diff_app_exec PRIVATE
${PROJECT_SOURCE_DIR}/diffusion
${PROJECT_SOURCE_DIR}/external
${PYBIND11_INCLUDE_DIRS}
${OpenSn_INSTALL_PREFIX}/include/opensn
)
target_link_libraries(diff_app_exec PRIVATE opensn::libopensn opensn::libopensnpy MPI::MPI_C caliper pybind11::module Python::Python)
5 changes: 5 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_subdirectory("paraview")

set(TARGET external)
add_library(${TARGET} STATIC
$<TARGET_OBJECTS:ThirdPartyParaView>)
16 changes: 16 additions & 0 deletions external/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ThirdParty

This directory contains third party projects distributed with OpenSn
by permission of their respective licences.
For additional details, please refer to the list that follows, as well as
the license files contained in each subdirectory and/or on the original
project website.

## Directory: paraview
- Project: ParaView
- Website: <https://www.paraview.org/>
- License: BSD-3-Clause
- Information: This directory contains a partial version of the ParaView
source files. The directory structure does not necessarily conform to that
of the original ParaView project and the file `CMakeLists.txt` is written
by the developers of OpenSn specifically for the OpenSn project.
Loading