Skip to content

Instantly share code, notes, and snippets.

@pshriwise
pshriwise / threaded_scaling.py
Last active March 13, 2025 05:09
A script for checking scaling of a DAGMC model.
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
@pshriwise
pshriwise / groups_to_block_mats.py
Last active March 28, 2024 03:54
A code snippet for converting DAGMC Cubit groups to blocks and material assignments
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:
@pshriwise
pshriwise / dagmc_material_swap.ipynb
Last active October 24, 2023 05:10
How to swap materials in a DAGMC .h5m file using PyMOAB
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pshriwise
pshriwise / SFR.ipynb
Last active September 2, 2023 01:50
SFR Model ID Weridness
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pshriwise
pshriwise / angular_filters_after.ipynb
Last active August 10, 2023 20:36
SurfaceFilter and MuFitler combination
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pshriwise
pshriwise / decay_heat_ex.ipynb
Last active August 1, 2023 18:35
Example of depletion cooling times and decay heat extraction for Radiant GAIN
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pshriwise
pshriwise / main.cpp
Last active October 12, 2022 15:06
Plucker Triangle Test Functions
#include "position.h"
#include "plucker.h"
int main() {
}
@pshriwise
pshriwise / build_cardinal_aurora.sh
Created August 18, 2022 04:37
Script for building Cardinal & Aurora with same MOOSE installation. All dependencies use the HDF5 version from MOOSE
#!/bin/bash
# stop script on returned error code
set -e
# SCRIPT PARAMETERS
topdir=$HOME/aurora_build
compile_cores=20
# GLOBAL VARS
@pshriwise
pshriwise / triso_compact_mats.ipynb
Last active July 13, 2022 04:48
Example of fuel material per compact in TRISO problem
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pshriwise
pshriwise / Session1.ipynb
Created May 25, 2022 14:24
Session1 Notebook ICTP Summer School 2022
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.