Skip to content

Commit

Permalink
Add dummy object to allow us to restrict DagMC tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
aprilnovak committed Jan 9, 2023
1 parent 34daeeb commit 9a7112f
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ENABLE_NEK ?= yes
ENABLE_OPENMC ?= yes

# Whether you want to build OpenMC with DAGMC support; set to anything except 'yes' to skip
ENABLE_DAGMC ?= yes
ENABLE_DAGMC ?= no

CARDINAL_DIR := $(abspath $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))))
CONTRIB_DIR := $(CARDINAL_DIR)/contrib
Expand Down Expand Up @@ -269,6 +269,11 @@ ifeq ($(ENABLE_OPENMC), yes)
libmesh_CXXFLAGS += -DENABLE_OPENMC_COUPLING
endif

ifeq ($(ENABLE_DAGMC), yes)
ADDITIONAL_CPPFLAGS += $(DAGMC_INCLUDES)
libmesh_CXXFLAGS += -DENABLE_DAGMC
endif

# ======================================================================================
# External apps
# ======================================================================================
Expand Down
34 changes: 34 additions & 0 deletions include/postprocessors/DagMCPostprocessor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/********************************************************************/
/* SOFTWARE COPYRIGHT NOTIFICATION */
/* Cardinal */
/* */
/* (c) 2021 UChicago Argonne, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by UChicago Argonne, LLC */
/* Under Contract No. DE-AC02-06CH11357 */
/* With the U. S. Department of Energy */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See LICENSE for full restrictions */
/********************************************************************/

#pragma once

#include "OpenMCPostprocessor.h"

/**
* Dummy object just for the sake of having an object for required_objects
*/
class DagMCPostprocessor : public OpenMCPostprocessor
{
public:
static InputParameters validParams();

DagMCPostprocessor(const InputParameters & parameters);

virtual Real getValue() override;
};
43 changes: 43 additions & 0 deletions src/postprocessors/DagMCPostprocessor.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/********************************************************************/
/* SOFTWARE COPYRIGHT NOTIFICATION */
/* Cardinal */
/* */
/* (c) 2021 UChicago Argonne, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by UChicago Argonne, LLC */
/* Under Contract No. DE-AC02-06CH11357 */
/* With the U. S. Department of Energy */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See LICENSE for full restrictions */
/********************************************************************/

#ifdef ENABLE_DAGMC

#include "DacMCPostprocessor.h"

InputParameters
DacMCPostprocessor::validParams()
{
InputParameters params = OpenMCPostprocessor::validParams();
return params;
}

DacMCPostprocessor::DacMCPostprocessor(const InputParameters & parameters)
: OpenMCPostprocessor(parameters)
{
mooseError("This class solely exists to have an object for checking whether "
"to run DagMC related tests");
}

Real
DacMCPostprocessor::getValue()
{
return 0.0;
}

#endif
2 changes: 1 addition & 1 deletion tutorials/dagmc/tests
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
min_parallel = 2
prereq = mesh
requirement = 'The system shall couple DAGMC OpenMC models to MOOSE.'
required_objects = 'OpenMCCellAverageProblem'
required_objects = 'DagMCPostprocessor'
[]
[]

0 comments on commit 9a7112f

Please sign in to comment.