Skip to content

Commit fea6a80

Browse files
author
Bryan Herman
committed
Merge branch 'release-v0.5.4'
2 parents ef004c4 + ffe4e16 commit fea6a80

File tree

199 files changed

+48950
-5289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+48950
-5289
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Compiled objects and modules
2+
*.a
23
*.o
34
*.mod
45
*.log
@@ -18,6 +19,7 @@ src/openmc
1819

1920
# Documentation builds
2021
docs/build
22+
docs/source/_images/*.pdf
2123

2224
# xml-fortran reader
2325
src/xml-fortran/xmlreader
@@ -26,4 +28,7 @@ src/xml-fortran/xmlreader
2628
src/templates/*.f90
2729

2830
# Test results error file
29-
results_error.dat
31+
results_error.dat
32+
33+
# HDF5 files
34+
*.h5

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2011-2013 Massachusetts Institute of Technology
1+
Copyright (c) 2011-2014 Massachusetts Institute of Technology
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of
44
this software and associated documentation files (the "Software"), to deal in

data/cross_sections_nndc.xml

Lines changed: 1716 additions & 0 deletions
Large diffs are not rendered by default.

data/get_nndc_data.py

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env python
2+
3+
from __future__ import print_function
4+
import os
5+
import shutil
6+
import subprocess
7+
import sys
8+
import tarfile
9+
10+
try:
11+
from urllib.request import urlopen
12+
except ImportError:
13+
from urllib2 import urlopen
14+
15+
baseUrl = 'http://www.nndc.bnl.gov/endf/b7.1/aceFiles/'
16+
files = ['ENDF-B-VII.1-neutron-293.6K.tar.gz',
17+
'ENDF-B-VII.1-neutron-300K.tar.gz',
18+
'ENDF-B-VII.1-neutron-900K.tar.gz',
19+
'ENDF-B-VII.1-neutron-1500K.tar.gz',
20+
'ENDF-B-VII.1-tsl.tar.gz']
21+
block_size = 16384
22+
23+
# ==============================================================================
24+
# DOWNLOAD FILES FROM NNDC SITE
25+
26+
filesComplete = []
27+
for f in files:
28+
# Establish connection to URL
29+
url = baseUrl + f
30+
req = urlopen(url)
31+
32+
# Get file size from header
33+
file_size = int(req.info().getheaders('Content-Length')[0])
34+
downloaded = 0
35+
36+
# Check if file already downloaded
37+
if os.path.exists(f):
38+
if os.path.getsize(f) == file_size:
39+
print('Skipping ' + f)
40+
filesComplete.append(f)
41+
continue
42+
else:
43+
if sys.version_info[0] < 3:
44+
overwrite = raw_input('Overwrite {0}? ([y]/n) '.format(f))
45+
else:
46+
overwrite = input('Overwrite {0}? ([y]/n) '.format(f))
47+
if overwrite.lower().startswith('n'):
48+
continue
49+
50+
# Copy file to disk
51+
print('Downloading {0}... '.format(f), end='')
52+
with open(f, 'wb') as fh:
53+
while True:
54+
chunk = req.read(block_size)
55+
if not chunk: break
56+
fh.write(chunk)
57+
downloaded += len(chunk)
58+
status = '{0:10} [{1:3.2f}%]'.format(downloaded, downloaded * 100. / file_size)
59+
print(status + chr(8)*len(status), end='')
60+
print('')
61+
filesComplete.append(f)
62+
63+
# ==============================================================================
64+
# EXTRACT FILES FROM TGZ
65+
66+
for f in files:
67+
if not f in filesComplete:
68+
continue
69+
70+
# Extract files
71+
suffix = f[f.rindex('-') + 1:].rstrip('.tar.gz')
72+
with tarfile.open(f, 'r') as tgz:
73+
print('Extracting {0}...'.format(f))
74+
tgz.extractall(path='nndc/' + suffix)
75+
76+
# ==============================================================================
77+
# COPY CROSS_SECTIONS.XML
78+
79+
print('Copying cross_sections_nndc.xml...')
80+
shutil.copyfile('cross_sections_nndc.xml', 'nndc/cross_sections.xml')
81+
82+
# ==============================================================================
83+
# PROMPT USER TO DELETE .TAR.GZ FILES
84+
85+
# Ask user to delete
86+
if sys.version_info[0] < 3:
87+
response = raw_input('Delete *.tar.gz files? ([y]/n) ')
88+
else:
89+
response = input('Delete *.tar.gz files? ([y]/n) ')
90+
91+
# Delete files if requested
92+
if not response or response.lower().startswith('y'):
93+
for f in files:
94+
if os.path.exists(f):
95+
print('Removing {0}...'.format(f))
96+
os.remove(f)

data/readme.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ work with a few common cross section sources.
1515
- **cross_sections_ascii.xml** -- This file matches ENDF/B-VII.0 cross sections
1616
distributed with MCNP5 / MCNP6 beta.
1717

18+
- **cross_sections_nndc.xml** -- This file matches ENDF/B-VII.1 cross sections
19+
distributed from the `NNDC website`_.
20+
1821
- **cross_sections_serpent.xml** -- This file matches ENDF/B-VII.0 cross
1922
sections distributed with Serpent 1.1.7.
2023

@@ -31,3 +34,4 @@ element in your settings.xml, or set the CROSS_SECTIONS environment variable to
3134
the full path of the cross_sections.xml file.
3235

3336
.. _user's guide: http://mit-crpg.github.io/openmc/usersguide/install.html#cross-section-configuration
37+
.. _NNDC website: http://www.nndc.bnl.gov/endf/b7.1/acefiles.html

docs/Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = build
9+
IMAGEDIR = source/_images
910

1011
# Internal variables.
1112
PAPEROPT_a4 = -D latex_paper_size=a4
1213
PAPEROPT_letter = -D latex_paper_size=letter
1314
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
1415

15-
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
16+
# SVG to PDF conversion
17+
SVG2PDF = inkscape
18+
PDFS = $(patsubst %.svg,%.pdf,$(wildcard $(IMAGEDIR)/*.svg))
19+
20+
21+
.PHONY: help images clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
1622

1723
help:
1824
@echo "Please use \`make <target>' where <target> is one of"
@@ -33,8 +39,16 @@ help:
3339
@echo " linkcheck to check all external links for integrity"
3440
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
3541

42+
# Pattern rule for converting SVG to PDF
43+
%.pdf: %.svg
44+
$(SVG2PDF) -f $< -A $@
45+
46+
# Rule to build PDFs
47+
images: $(PDFS)
48+
3649
clean:
3750
-rm -rf $(BUILDDIR)/*
51+
-rm $(PDFS)
3852

3953
html:
4054
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@@ -91,14 +105,14 @@ epub:
91105
@echo
92106
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
93107

94-
latex:
108+
latex: images
95109
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
96110
@echo
97111
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
98112
@echo "Run \`make' in that directory to run these through (pdf)latex" \
99113
"(use \`make latexpdf' here to do that automatically)."
100114

101-
latexpdf:
115+
latexpdf: images
102116
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
103117
@echo "Running LaTeX files through pdflatex..."
104118
make -C $(BUILDDIR)/latex all-pdf

docs/source/_images/3dba.png

15.4 KB
Loading
File renamed without changes.
File renamed without changes.

docs/source/_images/Tracks.png

91.9 KB
Loading

0 commit comments

Comments
 (0)