Skip to content

Instantly share code, notes, and snippets.

@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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pshriwise
pshriwise / lattice_ex.py
Created March 2, 2022 12:56
Lattice within manually defined cells
import openmc
# constants
l = 1.0
h = 1.0
model = openmc.model.Model()
# materials
@pshriwise
pshriwise / check_homogenous.py
Last active February 5, 2022 03:46
Check for axial homogeneity in OpenMC model
#!/usr/bin/env python
import numpy as np
from progressbar import progressbar
import openmc
import openmc.lib
# main parameters
n_axial = 500
@pshriwise
pshriwise / dag_geom_ids.py
Created October 4, 2021 15:48
Print DAGMC Geom IDs
#! /bin/env python
from argparse import ArgumentParser
from pymoab import core, types
_VALID_GEOM_TYPES = ("Group", "Volume", "Surface", "Curve", "Vertex")
@pshriwise
pshriwise / box_bump_plot.py
Created September 1, 2021 20:41
Plot script for the BVH box extension study
import sys
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
from matplotlib.patches import Rectangle
from matplotlib.collections import PatchCollection
import os
import argparse as ap
import numpy as np
@pshriwise
pshriwise / Makefile
Last active April 29, 2021 23:14
A quick and dirty program for writing DAGMC volumes to screen and a TSV file
DAGMC_DIR=/home/shriwise/opt/dagmc
MOAB_DIR=/home/shriwise/opt/moab
DAGMC_LIB_DIR=$(DAGMC_DIR)/lib
MOAB_LIB_DIR=$(MOAB_DIR)/lib
CXX=g++
all:
$(CXX) dagmc_vols.cpp -I$(DAGMC_DIR)/include -I$(MOAB_DIR)/include -L$(DAGMC_LIB_DIR) -L$(MOAB_LIB_DIR) -ldagmc -lMOAB -Wl,-rpath=$(DAGMC_LIB_DIR) -Wl,-rpath=$(MOAB_LIB_DIR) -o dagmc_vols
@pshriwise
pshriwise / two_layer_sphere.jou
Created December 17, 2020 16:12
Trelis/Cubit Script for generation of a sphere hex mesh conforming to two sphere boundaries
reset
create sphere radius 1.4 inner radius 1.25
create sphere radius 1.25
merge all
webcut body all xplane
webcut body all yplane
webcut body all zplane
delete volume 3 4 5 6 7 8 9 10 11 12 13 14 15 16
merge all