mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Exposing dagmc support through the capi.
This commit is contained in:
parent
f0e3461dfd
commit
e5ad7f9d77
4 changed files with 18 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 *
|
||||
|
|
|
|||
|
|
@ -142,3 +142,13 @@ void free_memory_dagmc()
|
|||
|
||||
}
|
||||
#endif
|
||||
|
||||
bool dagmc_enabled()
|
||||
{
|
||||
#ifdef DAGMC
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue