Skip to content
Merged
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
26 changes: 23 additions & 3 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,50 @@ jobs:
strategy:
fail-fast: false
steps:
- name: checkout testapp
- name: checkout this repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: checkout opensn
uses: actions/checkout@v4
with:
repository: Open-Sn/opensn
path: opensn
- name: clean build directories
shell: bash
run: |
rm -rf opensn/build opensn/install ROM/build diffusion/build
- name: install opensn
shell: bash
run: |
module load opensn/gcc/14 python3/3.12.3
cd opensn && mkdir build && mkdir install && cd build
cmake -DCMAKE_INSTALL_PREFIX=../install .. && make -j && make install
- name: compile app
- name: compile rom
shell: bash
run: |
module load opensn/gcc/14 python3/3.12.3 libROM/1.0.0
export OpenSn_DIR=$PWD/opensn/install
cd ROM
mkdir build && cd build && cmake .. && make -j
- name: test examples
- name: test rom
shell: bash
run: |
module load opensn/gcc/14 python3/3.12.3 libROM/1.0.0
cd ROM
export PYTHONPATH=$PWD/python
cd examples/reed && python3 run_rom_reed.py --exe ../../build/rom_app_exec
- name: compile diffusion
shell: bash
run: |
module load opensn/gcc/14 python3/3.12.3
export OpenSn_DIR=$PWD/opensn/install
cd diffusion
mkdir build && cd build && cmake .. && make -j
- name: test diffusion
shell: bash
run: |
module load opensn/gcc/14 python3/3.12.3
cd diffusion
export PYTHONPATH=$PWD/python
test/run_tests -d test/diffusion
26 changes: 1 addition & 25 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ cmake-build-debug
.idea
bin
build*/
doc/documentation
doc/HTMLdocs
doc/whitepages

# root Makefile is generated by CMake automatically
Makefile

resources/Dependencies/lua-5.3.5/
resources/Dependencies/ncurses/
resources/Dependencies/readline/
resources/Dependencies/triangle/
resources/Dependencies/glew-2.1.0/

# Latex compile files
*.aux
*.lof
Expand All @@ -29,21 +20,10 @@ resources/Dependencies/glew-2.1.0/
# All vtk mesh files
/*.vtu
/*.pvtu
test/**/*.pvtu
test/**/*.vtu
test/modules/linear_boltzmann_solvers/dsa/SimTest_92b_DSA_PWLC.pvtu
test/modules/linear_boltzmann_solvers/dsa/SimTest_92b_DSA_PWLC_0.vtu
test/**/*.csv

tests/BigTests/*/solutions/

# All exodus files
/*.e

resources/Dependencies/.DS_Store

resources/.DS_Store

# python files
.DS_Store
._.DS_Store
Expand All @@ -54,14 +34,10 @@ __pycache__

*-private.sh

#Documentation
doc/generated_files

#visual studio code files
.vscode/

test/**/out/
tutorials/**/out/

#Scratch directory
scratch/
Expand Down Expand Up @@ -91,4 +67,4 @@ tutorials/**/*.py
examples/*/basis/*
examples/*/data/*
examples/*/output/*
examples/*/results/*
examples/*/results/*
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This repository contains example application that extend the capabilities of OpenSn.
A short description of each example is given below:

- [ROM](./ROM/README.md):
Reduced-Order Modeling Application
- **ROM**: Reduced-Order Modeling Application
- **Diffusion**: Diffusion Application (CFEM/DFEM)
2 changes: 0 additions & 2 deletions ROM/src/rom/steady_state_rom_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ SteadyStateROMSolver::Execute()
}
}

lbs_problem_->UpdateFieldFunctions();

rom_problem_->TakeSample(rom_options.param_id);
}
if (rom_options.phase == Phase::MERGE)
Expand Down
34 changes: 34 additions & 0 deletions diffusion/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
BasedOnStyle: LLVM
AlignTrailingComments: 'true'
AllowShortBlocksOnASingleLine: 'true'
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
AttributeMacros:
- __host__
- __device__
- __global__
- __shared__
- __managed__
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBraces: Allman
ColumnLimit: '100'
CommentPragmas: ''' ?[\\@][a-zA-Z].*$'''
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '2'
ContinuationIndentWidth: '2'
FixNamespaceComments: 'true'
IndentCaseLabels: 'true'
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'false'
SpaceBeforeParens: ControlStatements
SpacesBeforeTrailingComments: '1'
TabWidth: '2'
UseTab: Never
AlwaysBreakAfterReturnType: TopLevelDefinitions
AllowShortFunctionsOnASingleLine: InlineOnly

...
68 changes: 68 additions & 0 deletions diffusion/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-boost-*,
-objc-*,
-darwin-*,
-fuchsia-*,
-google-*,
-hicpp-*,
-linuxkernel-*,
-llvm*,
-mpi-*,
-zircon-*,
-cert-*,
-clang-analyzer-optin.mpi.MPI-Checker,
-bugprone-easily-swappable-parameters,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-use-default-member-init,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-use-enum-class,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-misc-include-cleaner,
-misc-const-correctness,
-misc-use-anonymous-namespace,
-misc-no-recursion,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
-modernize-use-ranges,
-modernize-use-constraints,
-modernize-use-std-numbers,
-modernize-use-default-member-init,
-modernize-loop-convert,
-modernize-use-designated-initializers,
-performance-avoid-endl,
-performance-enum-size,
-performance-unnecessary-value-param,
-portability-avoid-pragma-once,
-portability-template-virtual-member-function,
-readability-magic-numbers,
-readability-braces-around-statements,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-readability-else-after-return,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-redundant-member-init,
-readability-math-missing-parentheses,
-readability-convert-member-functions-to-static,
-readability-use-anyofallof,
-readability-container-contains,
-readability-redundant-access-specifiers,
-readability-avoid-nested-conditional-operator,
"
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
58 changes: 58 additions & 0 deletions diffusion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
cmake_minimum_required(VERSION 3.14)
project(OpenSnApp LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

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

include(CMakeFindDependencyMacro)

find_package(OpenSn REQUIRED)

message(STATUS "Found OpenSn ${OpenSn_VERSION} (from: ${OpenSn_DIR})")

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)

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}/src
${OpenSn_INSTALL_PREFIX}/include
${PROJECT_SOURCE_DIR}/blah/opensn/external
)

target_link_libraries(diff_app_exec PRIVATE
opensn::opensn
opensn::libopensnpy
MPI::MPI_CXX
caliper
pybind11::embed
Python::Python
)
Loading
Loading