Exposing dagmc support through the capi.

This commit is contained in:
Patrick Shriwise 2018-10-01 17:05:41 -05:00
parent f0e3461dfd
commit e5ad7f9d77
4 changed files with 18 additions and 3 deletions

View file

@ -1,9 +1,9 @@
#ifdef DAGMC
#ifndef OPENMC_DAGMC_H
#define OPENMC_DAGMC_H
#ifdef DAGMC
#include "DagMC.hpp"
#include "openmc/cell.h"
#include "openmc/surface.h"
@ -20,3 +20,5 @@ extern "C" void free_memory_dagmc();
#endif // OPENMC_DAGMC_H
#endif
extern "C" bool dagmc_enabled();

View file

@ -38,6 +38,8 @@ else:
from unittest.mock import Mock
_dll = Mock()
__dagmc_enabled__ = bool(_dll.dagmc_enabled())
from .error import *
from .core import *
from .nuclide import *

View file

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

View file

@ -1,9 +1,10 @@
from tests.testing_harness import TestHarness
import os
import pytest
import openmc
pytestmark = pytest.mark.skipif(
os.environ.get('DAGMC') != 'y',
not openmc.capi.__dagmc_enabled__,
reason="DAGMC CAD geometry is not enabled.")
def test_dagmc():