mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Updating CAPI dagmc_enabled exposure.
This commit is contained in:
parent
e573f250f7
commit
3323ffc5c2
4 changed files with 8 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 *
|
||||
|
|
|
|||
|
|
@ -142,13 +142,3 @@ void free_memory_dagmc()
|
|||
|
||||
}
|
||||
#endif
|
||||
|
||||
bool dagmc_enabled()
|
||||
{
|
||||
#ifdef DAGMC
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue