<commit_before>import openmc
import openmc.capi
from openmc.stats import Box

import pytest
from tests.testing_harness import PyAPITestHarness

pytestmark = pytest.mark.skipif(
    not openmc.capi._dagmc_enabled(),
    reason="DAGMC CAD geometry is not enabled.")

def test_dagmc():
    model = openmc.model.Model()

    # settings
    model.settings.batches = 5
    model.settings.inactive = 0
    model.settings.particles = 100

    source = openmc.Source(space=Box([-4, -4, -4],
                                     [ 4,  4,  4]))
    model.settings.source = source

    model.settings.dagmc = True

    # tally
    tally = openmc.Tally()
    tally.scores = ['total']
    tally.filters = [openmc.CellFilter(1)]
    model.tallies = [tally]

    # materials
    u235 = openmc.Material()
    u235.add_nuclide('U235', 1.0, 'ao')
    u235.set_density('g/cc', 11)
    u235.id = 40

    water = openmc.Material()
    water.add_nuclide('H1', 2.0, 'ao')
    water.add_nuclide('O16', 1.0, 'ao')
    water.set_density('g/cc', 1.0)
    water.id = 41

    mats = openmc.Materials([u235, water])
    model.materials = mats

    harness = PyAPITestHarness('statepoint.5.h5', model=model)
    harness.main()
<commit_msg>Re-adding SAB tables to water material.<commit_after>import openmc
import openmc.capi
from openmc.stats import Box

import pytest
from tests.testing_harness import PyAPITestHarness

pytestmark = pytest.mark.skipif(
    not openmc.capi._dagmc_enabled(),
    reason="DAGMC CAD geometry is not enabled.")

def test_dagmc():
    model = openmc.model.Model()

    # settings
    model.settings.batches = 5
    model.settings.inactive = 0
    model.settings.particles = 100

    source = openmc.Source(space=Box([-4, -4, -4],
                                     [ 4,  4,  4]))
    model.settings.source = source

    model.settings.dagmc = True

    # tally
    tally = openmc.Tally()
    tally.scores = ['total']
    tally.filters = [openmc.CellFilter(1)]
    model.tallies = [tally]

    # materials
    u235 = openmc.Material()
    u235.add_nuclide('U235', 1.0, 'ao')
    u235.set_density('g/cc', 11)
    u235.id = 40

    water = openmc.Material()
    water.add_nuclide('H1', 2.0, 'ao')
    water.add_nuclide('O16', 1.0, 'ao')
    water.set_density('g/cc', 1.0)
    water.add_s_alpha_beta('c_H_in_H2O')
    water.id = 41

    mats = openmc.Materials([u235, water])
    model.materials = mats

    harness = PyAPITestHarness('statepoint.5.h5', model=model)
    harness.main()

{'fraction_non_alphanumeric': 0.13502619911326078, 'fraction_numerical': 0.03990326481257558, 'mean_word_length': 2.7492447129909365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4537611', 'n_tokens_mistral': 979, 'n_tokens_neox': 898, 'n_words': 178}