mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Add flag for NCrystal
This commit is contained in:
parent
54745f5076
commit
91f939a391
4 changed files with 19 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ namespace openmc {
|
|||
// Global variable declarations
|
||||
//==============================================================================
|
||||
|
||||
extern "C" const bool NCRYSTAL_ENABLED;
|
||||
|
||||
namespace settings {
|
||||
|
||||
// Boolean flags
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue