forked from idaholab/fenix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request idaholab#53 from cticenhour/add_cardinal
Add Cardinal to FENIX
- Loading branch information
Showing
25 changed files
with
406 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Contents in this directory are used for the generation of apptainer images using the `ApptainerGenerator` script found in MOOSE at `scripts/apptainer_generator.py`. | ||
|
||
In particular: | ||
|
||
- `app_envrionment`: Appends to the environment in the container to add `OPENMC_CROSS_SECTIONS` | ||
- `app_post_post_install`: Copies the cross section download script for use in testing | ||
- `app_post_pre_make`: Sets extra variables for the build and builds the extra dependencies (openmc, dagmc) before the main build so that the `MAKEFLAGS` variable can be set for parallel builds. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export OPENMC_CROSS_SECTIONS=/opt/fenix/share/fenix/endfb-vii.1-hdf5/cross_sections.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Download cross sections | ||
umask 022 | ||
FROM_XS_SCRIPT=${APPLICATION_DIR}/cardinal/scripts/download-openmc-cross-sections.sh | ||
XS_SCRIPT=${MOOSE_PREFIX}/share/${BINARY_NAME}/download-openmc-cross-sections.sh | ||
cp ${FROM_XS_SCRIPT} ${XS_SCRIPT} | ||
chmod +x ${XS_SCRIPT} | ||
${XS_SCRIPT} ${MOOSE_PREFIX}/share/fenix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export CARDINAL_CONTRIB_INSTALL_DIR=/opt/fenix/contrib | ||
export HDF5_ROOT=${PETSC_DIR} | ||
export ENABLE_DAGMC=ON | ||
make build_openmc MAKEFLAGS=-j${MOOSE_JOBS} | ||
make build_dagmc MAKEFLAGS=-j${MOOSE_JOBS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Add OpenMC flags | ||
ADDITIONAL_CPPFLAGS += $(HDF5_INCLUDES) $(OPENMC_INCLUDES) | ||
libmesh_CXXFLAGS += -DENABLE_OPENMC_COUPLING | ||
|
||
# Add DagMC flags (-DDAGMC is used in OpenMC) | ||
libmesh_CXXFLAGS += -DENABLE_DAGMC -DDAGMC | ||
|
||
# Configure and build MOAB, DagMC, and then OpenMC | ||
include $(CARDINAL_DIR)/config/moab.mk | ||
include $(CARDINAL_DIR)/config/dagmc.mk | ||
|
||
# autoconf-archive puts some arguments (e.g. -std=c++17) into the compiler | ||
# variable rather than the compiler flags variable. | ||
# | ||
# cmake allows this, but wants any compiler arguments to be | ||
# semicolon-separated, not space-separated | ||
# libmesh_CC, etc., were defined in build.mk | ||
space := $(subst ,, ) | ||
LIBMESH_CC_LIST := $(subst $(space),;,$(libmesh_CC)) | ||
LIBMESH_CXX_LIST := $(subst $(space),;,$(libmesh_CXX)) | ||
LIBMESH_F90_LIST := $(subst $(space),;,$(libmesh_F90)) | ||
|
||
ENABLE_DAGMC := ON | ||
include $(CARDINAL_DIR)/config/openmc.mk | ||
|
||
# Cardinal | ||
libmesh_CXXFLAGS += -DENABLE_CARDINAL | ||
APPLICATION_DIR := $(CARDINAL_DIR) | ||
APPLICATION_NAME := cardinal | ||
BUILD_EXEC := no | ||
GEN_REVISION := yes | ||
include $(FRAMEWORK_DIR)/app.mk | ||
|
||
# app_objects are defined in moose.mk and built according to the rules in build.mk | ||
# We need to build these first so we get include dirs | ||
$(app_objects): build_moab build_dagmc build_openmc | ||
$(test_objects): build_moab build_dagmc build_openmc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
define n | ||
|
||
|
||
endef | ||
|
||
# Set default values for Cardinal location and ENABLE_CARDINAL. | ||
CARDINAL_DIR ?= $(CURDIR)/cardinal | ||
ENABLE_CARDINAL := yes | ||
|
||
# Check for CARDINAL_CONTENT within CARDINAL_DIR. | ||
CARDINAL_CONTENT := $(shell ls $(CARDINAL_DIR) 2> /dev/null) | ||
|
||
ifeq ($(CARDINAL_CONTENT),) | ||
$(warning $n"Cardinal does not seem to be available. If usage of Cardinal is desired within FENIX, make sure that either the submodule is checked out$nor that CARDINAL_DIR points to a location with the Cardinal source. $n$nIn the meantime, FENIX will be built without Cardinal.") | ||
ENABLE_CARDINAL := no | ||
else | ||
$(info FENIX is using Cardinal from $(CARDINAL_DIR)) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Cardinal contrib variables | ||
CARDINAL_CONTRIB_DIR := $(CARDINAL_DIR)/contrib | ||
CARDINAL_CONTRIB_INSTALL_DIR ?= $(CARDINAL_DIR)/install | ||
OPENMC_INSTALL_DIR := $(CARDINAL_CONTRIB_INSTALL_DIR) | ||
OPENMC_LIBDIR := $(OPENMC_INSTALL_DIR)/lib | ||
OPENMC_BUILDDIR := $(CARDINAL_DIR)/build/openmc | ||
OPENMC_INSTALL_DIR := $(CARDINAL_CONTRIB_INSTALL_DIR) | ||
OPENMC_INCLUDES := -I$(OPENMC_INSTALL_DIR)/include | ||
OPENMC_LIBDIR := $(OPENMC_INSTALL_DIR)/lib | ||
OPENMC_LIB := $(OPENMC_LIBDIR)/libopenmc.so | ||
|
||
PETSC_DIR ?= $(MOOSE_DIR)/petsc | ||
PETSC_ARCH ?= arch-moose | ||
LIBMESH_DIR ?= $(MOOSE_DIR)/libmesh/installed/ | ||
|
||
# This is the Eigen3 location on CIVET. If you are using MOOSE's conda environment, | ||
# you don't need to set these variables, because conda sets them for you. The only | ||
# scenario where you might need to manually set these is if you're not using the | ||
# conda environment. You will get a compile error about FindEigen3.cmake if you | ||
# do indeed need to set these. | ||
EIGEN3_DIR ?= $(LIBMESH_DIR)/include | ||
Eigen3_DIR ?= $(EIGEN3_DIR) | ||
|
||
# If HDF5_DIR is set, use those settings to link HDF5 to OpenMC. | ||
# Otherwise, use the PETSc location, as the self-built HDF5 libraries will be housed within. | ||
ifeq ($(HDF5_DIR),) | ||
HDF5_DIR := $(PETSC_DIR) | ||
export HDF5_DIR | ||
endif | ||
|
||
# HDF5_ROOT is used in makefiles for the Cardinal third-party dependencies. | ||
# Set it using HDF5_DIR | ||
HDF5_ROOT := $(HDF5_DIR) | ||
export HDF5_ROOT | ||
|
||
HDF5_INCLUDE_DIR ?= $(HDF5_DIR)/include | ||
HDF5_LIBDIR ?= $(HDF5_DIR)/lib | ||
# This is used in $(FRAMEWORK_DIR)/build.mk | ||
HDF5_INCLUDES := -I$(HDF5_INCLUDE_DIR) -I$(HDF5_DIR)/include | ||
|
||
# BUILD_TYPE will be passed to CMake via CMAKE_BUILD_TYPE | ||
ifeq ($(METHOD),dbg) | ||
BUILD_TYPE := Debug | ||
else | ||
BUILD_TYPE := Release | ||
endif | ||
|
||
DAGMC_BUILDDIR := $(CARDINAL_DIR)/build/DAGMC | ||
DAGMC_INSTALL_DIR := $(CARDINAL_CONTRIB_INSTALL_DIR) | ||
|
||
MOAB_BUILDDIR := $(CARDINAL_DIR)/build/moab | ||
MOAB_INSTALL_DIR := $(CARDINAL_CONTRIB_INSTALL_DIR) | ||
|
||
# Set default values for all third party dependencies | ||
OPENMC_DIR ?= $(CARDINAL_CONTRIB_DIR)/openmc | ||
DAGMC_DIR ?= $(CARDINAL_CONTRIB_DIR)/DAGMC | ||
MOAB_DIR ?= $(CARDINAL_CONTRIB_DIR)/moab | ||
|
||
# Use compiler info discovered by PETSC | ||
ifeq ($(PETSC_ARCH),) | ||
include $(PETSC_DIR)/$(PETSC_ARCH)/lib/petsc/conf/petscvariables | ||
else | ||
include $(PETSC_DIR)/lib/petsc/conf/petscvariables | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ifeq ($(ENABLE_CARDINAL),yes) | ||
# Cardinal contrib flags used in app.mk targets | ||
CARDINAL_EXTERNAL_FLAGS := -L$(CARDINAL_DIR)/lib $(CC_LINKER_SLFLAG)$(CARDINAL_DIR)/lib $(BLASLAPACK_LIB) $(PETSC_EXTERNAL_LIB_BASIC) -L$(OPENMC_LIBDIR) -L$(HDF5_LIBDIR) -lopenmc -ldagmc -lMOAB $(CC_LINKER_SLFLAG)$(OPENMC_LIBDIR) $(CC_LINKER_SLFLAG)$(HDF5_LIBDIR) | ||
|
||
# EXTERNAL_FLAGS is used in rules for app.mk | ||
$(app_LIB): EXTERNAL_FLAGS := $(CARDINAL_EXTERNAL_FLAGS) | ||
$(app_test_LIB): EXTERNAL_FLAGS := $(CARDINAL_EXTERNAL_FLAGS) | ||
$(app_EXEC): EXTERNAL_FLAGS := $(CARDINAL_EXTERNAL_FLAGS) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
- source/** | ||
- media/** | ||
- ~source/auxkernels/NekSpatialBinComponentAux.md | ||
- ~source/timesteppers/NekTimeStepper.md | ||
- ~source/mesh/NekRSMesh.md | ||
- ~source/postprocessors/boundary_specs.md | ||
- ~source/postprocessors/NekHeatFluxIntegral.md | ||
- ~source/postprocessors/NekNumRanks.md | ||
- ~source/postprocessors/NekMassFluxWeightedSideAverage.md | ||
- ~source/postprocessors/NekMassFluxWeightedSideIntegral.md | ||
- ~source/postprocessors/NekPressureSurfaceForce.md | ||
- ~source/postprocessors/NekScalarValuePostprocessor.md | ||
- ~source/postprocessors/NekSideAverage.md | ||
- ~source/postprocessors/NekSideExtremeValue.md | ||
- ~source/postprocessors/NekSideIntegral.md | ||
- ~source/postprocessors/NekUsrWrkBoundaryIntegral.md | ||
- ~source/postprocessors/NekVolumeAverage.md | ||
- ~source/postprocessors/NekVolumeExtremeValue.md | ||
- ~source/postprocessors/NekVolumeIntegral.md | ||
- ~source/postprocessors/PecletNumber.md | ||
- ~source/postprocessors/ReynoldsNumber.md | ||
- ~source/problems/NekRSProblem.md | ||
- ~source/problems/NekRSSeparateDomainProblem.md | ||
- ~source/problems/nek_classes.md | ||
- ~source/problems/nondimensional_problem.md | ||
- ~source/problems/output_solution.md | ||
- ~source/problems/NekRSStandaloneProblem.md | ||
- ~source/userobjects/NekBinnedPlaneAverage.md | ||
- ~source/userobjects/NekBinnedPlaneIntegral.md | ||
- ~source/userobjects/NekBinnedSideAverage.md | ||
- ~source/userobjects/NekBinnedSideIntegral.md | ||
- ~source/userobjects/NekBinnedVolumeAverage.md | ||
- ~source/userobjects/NekBinnedVolumeIntegral.md | ||
- ~source/userobjects/NekScalarValue.md | ||
- ~source/userobjects/velocity_component.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.