Updating CAPI dagmc_enabled exposure.

This commit is contained in:
Patrick Shriwise 2018-10-02 21:26:24 -05:00
parent e573f250f7
commit 3323ffc5c2
4 changed files with 8 additions and 14 deletions

View file

@ -21,4 +21,8 @@ extern "C" void free_memory_dagmc();
#endif
extern "C" bool dagmc_enabled();
#ifdef DAGMC
extern "C" constexpr bool dagmc_enabled = true;
#else
extern "C" constexpr bool dagmc_enabled = false;
#endif

View file

@ -12,7 +12,7 @@ objects in the :mod:`openmc.capi` subpackage, for example:
"""
from ctypes import CDLL
from ctypes import CDLL, c_bool
import os
import sys
@ -38,7 +38,7 @@ else:
from unittest.mock import Mock
_dll = Mock()
__dagmc_enabled__ = bool(_dll.dagmc_enabled())
dagmc_enabled = bool(c_bool.in_dll(_dll, "dagmc_enabled"))
from .error import *
from .core import *

View file

@ -142,13 +142,3 @@ void free_memory_dagmc()
}
#endif
bool dagmc_enabled()
{
#ifdef DAGMC
return true;
#else
return false;
#endif
}

View file

@ -4,7 +4,7 @@ import pytest
import openmc
pytestmark = pytest.mark.skipif(
not openmc.capi.__dagmc_enabled__,
not openmc.capi.dagmc_enabled,
reason="DAGMC CAD geometry is not enabled.")
def test_dagmc():