Add flag for NCrystal

This commit is contained in:
Jose Ignacio Marquez Damian 2022-11-18 18:26:31 +01:00
parent 54745f5076
commit 91f939a391
4 changed files with 19 additions and 0 deletions

View file

@ -20,6 +20,8 @@ namespace openmc {
// Global variable declarations
//==============================================================================
extern "C" const bool NCRYSTAL_ENABLED;
namespace settings {
// Boolean flags

View file

@ -42,6 +42,9 @@ else:
def _dagmc_enabled():
return c_bool.in_dll(_dll, "DAGMC_ENABLED").value
def _ncrystal_enabled():
return c_bool.in_dll(_dll, "NCRYSTAL_ENABLED").value
def _coord_levels():
return c_int.in_dll(_dll, "n_coord_levels").value

View file

@ -36,6 +36,13 @@ namespace openmc {
// Global variables
//==============================================================================
#ifdef NCRYSTAL
const bool NCRYSTAL_ENABLED = true;
#else
const bool NCRYSTAL_ENABLED = false;
#endif
namespace settings {
// Default values for boolean flags

View file

@ -1,7 +1,14 @@
import numpy as np
import openmc
import openmc.lib
import pytest
from tests.testing_harness import PyAPITestHarness
pytestmark = pytest.mark.skipif(
not openmc.lib._ncrystal_enabled(),
reason="NCrystal materials are not enabled.")
def compute_angular_distribution(cfg, E0, N):
"""Return a openmc.model.Model() object for a monoenergetic pencil
beam hitting a 1 mm sphere filled with the material defined by