Skip to content

Commit

Permalink
Make TMAP8 optional
Browse files Browse the repository at this point in the history
Refs #52

This aligns with the status of Cardinal, which was also made optional in #53
  • Loading branch information
cticenhour committed Aug 29, 2024
1 parent d5de85f commit e9de1d8
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 113 deletions.
61 changes: 25 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,10 @@ else
endif
FRAMEWORK_DIR := $(MOOSE_DIR)/framework

# Use the TMAP8 submodule if it exists and TMAP8_DIR is not set
# If it doesn't exist, and TMAP8_DIR is not set, then look for it adjacent to the application
TMAP8_SUBMODULE := $(CURDIR)/tmap8
ifneq ($(wildcard $(TMAP8_SUBMODULE)/Makefile),)
TMAP8_DIR ?= $(TMAP8_SUBMODULE)
else
TMAP8_DIR ?= $(shell dirname `pwd`)/tmap8
endif

# Check for optional dependencies and, if found, configure for building.
include config/check_deps.mk

# ENABLE_CARDINAL = yes by default, but is set to "no" automatically if Cardinal is not found via CARDINAL_DIR.
# ENABLE_CARDINAL = yes by default, but is set to "no" automatically if Cardinal is not found via CARDINAL_DIR.
ifeq ($(ENABLE_CARDINAL),yes)
include config/configure_cardinal.mk
endif
Expand All @@ -56,53 +47,51 @@ include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk

################################## MODULES ####################################
# To use certain physics included with MOOSE, set variables below to
# yes as needed. Or set ALL_MODULES to yes to turn on everything (overrides
# other set variables).
# The default MOOSE modules used with FENIX are activated below. To turn on more
# modules, set their respective variables to yes. One can also set ALL_MODULES
# to yes to turn on everything (overrides other set variables).
#
# Additional modules may be turned on by optional dependencies - please
# reference config/dep_modules.mk to review those that might be available
# in your installation configuration.

ALL_MODULES := no

CHEMICAL_REACTIONS := yes
CHEMICAL_REACTIONS := no
CONTACT := no
ELECTROMAGNETICS := yes
EXTERNAL_PETSC_SOLVER := no
FLUID_PROPERTIES := yes
FLUID_PROPERTIES := no
FSI := no
FUNCTIONAL_EXPANSION_TOOLS := no
GEOCHEMISTRY := no
HEAT_TRANSFER := yes
HEAT_TRANSFER := no
LEVEL_SET := no
MISC := yes
NAVIER_STOKES := yes
MISC := no
NAVIER_STOKES := no
OPTIMIZATION := no
PERIDYNAMICS := no
PHASE_FIELD := yes
PHASE_FIELD := no
POROUS_FLOW := no
RAY_TRACING := yes
REACTOR := yes
RDG := yes
REACTOR := no
RDG := no
RICHARDS := no
SCALAR_TRANSPORT := yes
SOLID_MECHANICS := yes
SOLID_PROPERTIES := yes
SCALAR_TRANSPORT := no
SOLID_MECHANICS := no
SOLID_PROPERTIES := no
STOCHASTIC_TOOLS := yes
THERMAL_HYDRAULICS := yes
THERMAL_HYDRAULICS := no
XFEM := no

# Enable modules required by optional dependencies
include config/dep_modules.mk

include $(MOOSE_DIR)/modules/modules.mk
###############################################################################

# TMAP8
APPLICATION_DIR := $(TMAP8_DIR)
APPLICATION_NAME := tmap8
BUILD_EXEC := no
GEN_REVISION := no
include $(FRAMEWORK_DIR)/app.mk

# Cardinal
ifeq ($(ENABLE_CARDINAL),yes)
include config/build_cardinal.mk
endif
# Build optional dependencies
include config/build_deps.mk

# FENIX
APPLICATION_DIR := $(CURDIR)
Expand Down
37 changes: 0 additions & 37 deletions config/build_cardinal.mk

This file was deleted.

50 changes: 50 additions & 0 deletions config/build_deps.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# TMAP8
ifeq ($(ENABLE_TMAP8),yes)
libmesh_CXXFLAGS += -DENABLE_TMAP8
APPLICATION_DIR := $(TMAP8_DIR)
APPLICATION_NAME := tmap8
BUILD_EXEC := no
GEN_REVISION := no
include $(FRAMEWORK_DIR)/app.mk
endif

# Cardinal
ifeq ($(ENABLE_CARDINAL),yes)
# 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
endif
16 changes: 14 additions & 2 deletions config/check_deps.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ define n

endef

# Set default values for Cardinal location and ENABLE_CARDINAL.
# Set default values for dependency locations, or use user-defined environment variable
TMAP8_DIR ?= $(CURDIR)/tmap8
CARDINAL_DIR ?= $(CURDIR)/cardinal

# Set defaults for optional dependencies
ENABLE_TMAP8 := yes
ENABLE_CARDINAL := yes

# Check for CARDINAL_CONTENT within CARDINAL_DIR.
# Check for content within dependency directories
TMAP8_CONTENT := $(shell ls $(TMAP8_DIR) 2> /dev/null)
CARDINAL_CONTENT := $(shell ls $(CARDINAL_DIR) 2> /dev/null)

ifeq ($(TMAP8_CONTENT),)
$(warning $n"TMAP8 does not seem to be available. If usage of TMAP8 is desired within FENIX, make sure that either the submodule is checked out$nor that TMAP8_DIR points to a location with the TMAP8 source. $n$nIn the meantime, FENIX will be built without TMAP8.")
ENABLE_TMAP8 := no
else
$(info FENIX is using TMAP8 from $(TMAP8_DIR))
endif

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
Expand Down
27 changes: 27 additions & 0 deletions config/dep_modules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# TMAP8
ifeq ($(ENABLE_TMAP8),yes)
CHEMICAL_REACTIONS := yes
FLUID_PROPERTIES := yes
HEAT_TRANSFER := yes
MISC := yes
NAVIER_STOKES := yes
PHASE_FIELD := yes
RAY_TRACING := yes
RDG := yes
SCALAR_TRANSPORT := yes
SOLID_PROPERTIES := yes
SOLID_MECHANICS := yes
THERMAL_HYDRAULICS := yes
endif

# Cardinal
ifeq ($(ENABLE_CARDINAL),yes)
FLUID_PROPERTIES := yes
HEAT_TRANSFER := yes
NAVIER_STOKES := yes
REACTOR := yes
SOLID_PROPERTIES := yes
STOCHASTIC_TOOLS := yes
SOLID_MECHANICS := yes
THERMAL_HYDRAULICS := yes
endif
12 changes: 12 additions & 0 deletions doc/content/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ The copies of MOOSE, TMAP8, and Cardinal provided with FENIX have been fully tes
FENIX version, and is guaranteed to work with all current FENIX tests.
!alert-end!

!alert! tip title=Disabling TMAP8
TMAP8 is an optional dependency of FENIX and can be disabled to speed up build times, if TMAP8
capabilities are not needed. This can be done by simply not downloading the TMAP8 submodule
(i.e., not performing the `git submodule update --init tmap8` command above.)
!alert-end!

!alert! tip title=Disabling Cardinal
Cardinal is an optional dependency of FENIX and can be disabled to speed up build times, if Cardinal
capabilities are not needed. This can be done by simply not downloading the Cardinal submodule
Expand Down Expand Up @@ -190,6 +196,12 @@ git submodule update --recursive contrib/DAGMC
git submodule update contrib/moab
```

!alert! tip title=Disabling TMAP8
TMAP8 is an optional dependency of FENIX and can be disabled to speed up build times, if TMAP8
capabilities are not needed. This can be done by simply not downloading the TMAP8 submodule
(i.e., not performing the `git submodule update tmap8` command above.)
!alert-end!

!alert! tip title=Disabling Cardinal
Cardinal is an optional dependency of FENIX and can be disabled to speed up build times, if Cardinal
capabilities are not needed. This can be done by simply not downloading the Cardinal submodule
Expand Down
8 changes: 8 additions & 0 deletions src/base/FenixApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
#include "MooseSyntax.h"

// contribs
#ifdef ENABLE_TMAP8
#include "TMAP8App.h"
#endif

#ifdef ENABLE_CARDINAL
#include "CardinalApp.h"
#endif
Expand Down Expand Up @@ -48,7 +51,9 @@ FenixApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
Registry::registerObjectsTo(f, {"FenixApp"});
Registry::registerActionsTo(af, {"FenixApp"});

#ifdef ENABLE_TMAP8
TMAP8App::registerAll(f, af, s);
#endif

#ifdef ENABLE_CARDINAL
CardinalApp::registerAll(f, af, s);
Expand All @@ -62,7 +67,10 @@ FenixApp::registerApps()
{
registerApp(FenixApp);
ModulesApp::registerApps();

#ifdef ENABLE_TMAP8
TMAP8App::registerApps();
#endif

#ifdef ENABLE_CARDINAL
CardinalApp::registerApps();
Expand Down
Loading

0 comments on commit e9de1d8

Please sign in to comment.