Skip to content

Commit

Permalink
Merge branch 'release-v0.5.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Herman committed Mar 26, 2014
2 parents ef004c4 + ffe4e16 commit fea6a80
Show file tree
Hide file tree
Showing 199 changed files with 48,950 additions and 5,289 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Compiled objects and modules
*.a
*.o
*.mod
*.log
Expand All @@ -18,6 +19,7 @@ src/openmc

# Documentation builds
docs/build
docs/source/_images/*.pdf

# xml-fortran reader
src/xml-fortran/xmlreader
Expand All @@ -26,4 +28,7 @@ src/xml-fortran/xmlreader
src/templates/*.f90

# Test results error file
results_error.dat
results_error.dat

# HDF5 files
*.h5
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2013 Massachusetts Institute of Technology
Copyright (c) 2011-2014 Massachusetts Institute of Technology

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
1,716 changes: 1,716 additions & 0 deletions data/cross_sections_nndc.xml

Large diffs are not rendered by default.

96 changes: 96 additions & 0 deletions data/get_nndc_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/usr/bin/env python

from __future__ import print_function
import os
import shutil
import subprocess
import sys
import tarfile

try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen

baseUrl = 'http://www.nndc.bnl.gov/endf/b7.1/aceFiles/'
files = ['ENDF-B-VII.1-neutron-293.6K.tar.gz',
'ENDF-B-VII.1-neutron-300K.tar.gz',
'ENDF-B-VII.1-neutron-900K.tar.gz',
'ENDF-B-VII.1-neutron-1500K.tar.gz',
'ENDF-B-VII.1-tsl.tar.gz']
block_size = 16384

# ==============================================================================
# DOWNLOAD FILES FROM NNDC SITE

filesComplete = []
for f in files:
# Establish connection to URL
url = baseUrl + f
req = urlopen(url)

# Get file size from header
file_size = int(req.info().getheaders('Content-Length')[0])
downloaded = 0

# Check if file already downloaded
if os.path.exists(f):
if os.path.getsize(f) == file_size:
print('Skipping ' + f)
filesComplete.append(f)
continue
else:
if sys.version_info[0] < 3:
overwrite = raw_input('Overwrite {0}? ([y]/n) '.format(f))
else:
overwrite = input('Overwrite {0}? ([y]/n) '.format(f))
if overwrite.lower().startswith('n'):
continue

# Copy file to disk
print('Downloading {0}... '.format(f), end='')
with open(f, 'wb') as fh:
while True:
chunk = req.read(block_size)
if not chunk: break
fh.write(chunk)
downloaded += len(chunk)
status = '{0:10} [{1:3.2f}%]'.format(downloaded, downloaded * 100. / file_size)
print(status + chr(8)*len(status), end='')
print('')
filesComplete.append(f)

# ==============================================================================
# EXTRACT FILES FROM TGZ

for f in files:
if not f in filesComplete:
continue

# Extract files
suffix = f[f.rindex('-') + 1:].rstrip('.tar.gz')
with tarfile.open(f, 'r') as tgz:
print('Extracting {0}...'.format(f))
tgz.extractall(path='nndc/' + suffix)

# ==============================================================================
# COPY CROSS_SECTIONS.XML

print('Copying cross_sections_nndc.xml...')
shutil.copyfile('cross_sections_nndc.xml', 'nndc/cross_sections.xml')

# ==============================================================================
# PROMPT USER TO DELETE .TAR.GZ FILES

# Ask user to delete
if sys.version_info[0] < 3:
response = raw_input('Delete *.tar.gz files? ([y]/n) ')
else:
response = input('Delete *.tar.gz files? ([y]/n) ')

# Delete files if requested
if not response or response.lower().startswith('y'):
for f in files:
if os.path.exists(f):
print('Removing {0}...'.format(f))
os.remove(f)
4 changes: 4 additions & 0 deletions data/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ work with a few common cross section sources.
- **cross_sections_ascii.xml** -- This file matches ENDF/B-VII.0 cross sections
distributed with MCNP5 / MCNP6 beta.

- **cross_sections_nndc.xml** -- This file matches ENDF/B-VII.1 cross sections
distributed from the `NNDC website`_.

- **cross_sections_serpent.xml** -- This file matches ENDF/B-VII.0 cross
sections distributed with Serpent 1.1.7.

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

.. _user's guide: http://mit-crpg.github.io/openmc/usersguide/install.html#cross-section-configuration
.. _NNDC website: http://www.nndc.bnl.gov/endf/b7.1/acefiles.html
20 changes: 17 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
IMAGEDIR = source/_images

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

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
# SVG to PDF conversion
SVG2PDF = inkscape
PDFS = $(patsubst %.svg,%.pdf,$(wildcard $(IMAGEDIR)/*.svg))


.PHONY: help images clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest

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

# Pattern rule for converting SVG to PDF
%.pdf: %.svg
$(SVG2PDF) -f $< -A $@

# Rule to build PDFs
images: $(PDFS)

clean:
-rm -rf $(BUILDDIR)/*
-rm $(PDFS)

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down Expand Up @@ -91,14 +105,14 @@ epub:
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

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

latexpdf:
latexpdf: images
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
Expand Down
Binary file added docs/source/_images/3dba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added docs/source/_images/Tracks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 4 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

# General information about the project.
project = u'OpenMC'
copyright = u'2011-2013, Massachusetts Institute of Technology'
copyright = u'2011-2014, Massachusetts Institute of Technology'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -121,7 +121,7 @@

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = '../img/openmc.png'
html_logo = '_images/openmc.png'

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand Down Expand Up @@ -188,6 +188,8 @@
u'Massachusetts Institute of Technology', 'manual'),
]

latex_elements = {'preamble': '\\usepackage{enumitem}\\setlistdepth{9}'}

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
Expand Down
2 changes: 1 addition & 1 deletion docs/source/devguide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ as debugging.
structures
styleguide
workflow
xml-fortran
xml-parsing
statepoint
voxel
Loading

0 comments on commit fea6a80

Please sign in to comment.