This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import numpy as np | |
from scipy.spatial import Delaunay | |
from scipy.stats import qmc | |
import openmc | |
cube_corners = np.array([ | |
[0, 0, 0], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openmc | |
from openmc_cad_adapter import to_cubit_journal | |
import matplotlib.pyplot as plt | |
import numpy as np | |
# Define the coefficients of the plane | |
a, b, c, d = 1, 2, -3, 1 | |
plane = openmc.Plane(a, b, c, d) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python | |
import sys | |
from PySide6.QtWidgets import ( | |
QApplication, QTabWidget, QVBoxLayout, QWidget, QTreeWidget, QTreeWidgetItem, QMessageBox | |
) | |
from PySide6.QtCore import Qt, QThread, Signal | |
import openmc | |
class LoadGeometryThread(QThread): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python | |
for (group_name, group_id) in cubit.group_names_ids(): | |
# ignore group "picked". It is always present by default and isn't | |
# relevant for DAGMC metadata | |
if group_name == 'picked': | |
continue | |
tokens = group_name.split('_') | |
properties = [f'{p}:{v}' for p, v in zip(tokens[::2], tokens[1::2])] | |
new_name = '/'.join(properties) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python | |
import numpy as np | |
import sys | |
# sys.path.append( r"C:\Program Files\Coreform Cubit 2023.11\bin") | |
# import cubit | |
def compute_tri_surf_dist_err(surface_id=None): | |
"""Compute the maximum distance between a surface's triangles the closest point on a surface.""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from argparse import ArgumentParser | |
import sys | |
import os | |
args = ArgumentParser() | |
args.add_argument('document_id', help='Google Slides document ID') | |
args.add_argument('--output', help='Content in output', | |
choices=('html', 'iframe', 'link', 'pdf'), default='html') | |
args = args.parse_args() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from pathlib import Path | |
from matplotlib import pyplot as plt | |
import openmc | |
import numpy as np | |
def threaded_scaling(threads, model, openmc_exec='openmc', output_filename=None, particles_per_thread=10_000): | |
"""Run simulation with various threads and collect timing results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cubit | |
for (name, gid) in cubit.group_names_ids(): | |
# skip the 'picked' group and other groups | |
# that aren't materials | |
if name == 'picked' or 'mat' not in name: | |
continue | |
mat = name.split('/')[0].split(':')[1] | |
if not mat: |
NewerOlder