Merge branch 'develop' into photon-new

This commit is contained in:
amandalund 2018-08-02 12:22:15 -05:00
commit 6e0f6b02bf
6 changed files with 260 additions and 105 deletions

76
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at openmc@anl.gov. All complaints will
be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated to
maintain confidentiality with regard to the reporter of an incident. However,
note that some project team members may have a legal obligation to report
certain forms of harassment because of their affiliation (for example, staff and
faculty at universities in the United States). Further details of specific
enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org

46
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,46 @@
# Contributing to OpenMC
Welcome, and thank you for considering contributing to OpenMC! We look forward
to welcoming new members to the community and will do our best to help you get
up to speed.
## Code of Conduct
Participants in the OpenMC project are expected to follow and uphold the [Code
of Conduct](CODE_OF_CONDUCT.md). Please report any unacceptable behavior to
openmc@anl.gov.
## Resources
- [GitHub Repository](https://github.com/mit-crpg/openmc)
- [Documentation](http://openmc.readthedocs.io/en/latest)
- [User's Mailing List](openmc-users@googlegroups.com)
- [Developer's Mailing List](openmc-dev@googlegroups.com)
- [Slack Community](https://openmc.slack.com/signup) (If you don't see your
domain listed, contact openmc@anl.gov)
## How to Report Bugs
OpenMC is hosted on GitHub and all bugs are reported and tracked through the
[Issues](https://github.com/mit-crpg/openmc/issues) listed on GitHub.
## How to Suggest Enhancements
We welcome suggestions for new features or enhancements to the code and
encourage you to submit them as Issues on GitHub. However, it's important to
recognize that our development team is relatively small and does not have
unlimited time to devote to new feature suggestions. If you are interested in
working on the feature you are requesting, indicate so in the issue and the
development team will be happy to discuss it.
## How to Submit Changes
All changes to OpenMC happen through pull requests. For a full overview of the
process, see the developer's guide section on [Development
Workflow](http://openmc.readthedocs.io/en/latest/devguide/workflow.html).
## Code Style
Before you run off to make changes to the code, please have a look at our [style
guide](http://openmc.readthedocs.io/en/latest/devguide/styleguide.html), which
is used when reviewing new contributions.

58
README.md Normal file
View file

@ -0,0 +1,58 @@
# OpenMC Monte Carlo Particle Transport Code
[![License](https://img.shields.io/github/license/mit-crpg/openmc.svg)](http://openmc.readthedocs.io/en/latest/license.html)
[![Travis CI build status (Linux)](https://travis-ci.org/mit-crpg/openmc.svg?branch=develop)](https://travis-ci.org/mit-crpg/openmc)
[![Code Coverage](https://coveralls.io/repos/github/mit-crpg/openmc/badge.svg?branch=develop)](https://coveralls.io/github/mit-crpg/openmc?branch=develop)
The OpenMC project aims to provide a fully-featured Monte Carlo particle
transport code based on modern methods. It is a constructive solid geometry,
continuous-energy transport code that uses HDF5 format cross sections. The
project started under the Computational Reactor Physics Group at MIT.
Complete documentation on the usage of OpenMC is hosted on Read the Docs (both
for the [latest release](http://openmc.readthedocs.io/en/stable/) and
[developmental](http://openmc.readthedocs.io/en/latest/) version). If you are
interested in the project or would like to help and contribute, please send a
message to the OpenMC User's Group [mailing
list](https://groups.google.com/forum/?fromgroups=#!forum/openmc-users).
## Installation
Detailed [installation
instructions](http://openmc.readthedocs.io/en/stable/usersguide/install.html)
can be found in the User's Guide.
## Citing
If you use OpenMC in your research, please consider giving proper attribution by
citing the following publication:
- Paul K. Romano, Nicholas E. Horelik, Bryan R. Herman, Adam G. Nelson, Benoit
Forget, and Kord Smith, "[OpenMC: A State-of-the-Art Monte Carlo Code for
Research and Development](https://doi.org/10.1016/j.anucene.2014.07.048),"
*Ann. Nucl. Energy*, **82**, 90--97 (2015).
## Troubleshooting
If you run into problems compiling, installing, or running OpenMC, first check
the [Troubleshooting
section](http://openmc.readthedocs.io/en/stable/usersguide/troubleshoot.html) in
the User's Guide. If you are not able to find a solution to your problem there,
please send a message to the User's Group [mailing
list](https://groups.google.com/forum/?fromgroups=#!forum/openmc-users).
## Reporting Bugs
OpenMC is hosted on GitHub and all bugs are reported and tracked through the
[Issues](https://github.com/mit-crpg/openmc/issues) feature on GitHub. However,
GitHub Issues should not be used for common troubleshooting purposes. If you are
having trouble installing the code or getting your model to run properly, you
should first send a message to the User's Group mailing list. If it turns out
your issue really is a bug in the code, an issue will then be created on
GitHub. If you want to request that a feature be added to the code, you may
create an Issue on github.
## License
OpenMC is distributed under the MIT/X
[license](http://openmc.readthedocs.io/en/stable/license.html).

View file

@ -182,37 +182,83 @@ Always use C++-style comments (``//``) as opposed to C-style (``/**/``). (It
is more difficult to comment out a large section of code that uses C-style
comments.)
Header files should always use include guards with the following style (See
`SF.8 <http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#sf8-use-include-guards-for-all-h-files>`_:
.. code-block:: C++
#ifndef MODULE_NAME_H
#define MODULE_NAME_H
...
content
...
#endif // MODULE_NAME_H
Do not use C-style casting. Always use the C++-style casts ``static_cast``,
``const_cast``, or ``reinterpret_cast``. (See `ES.49 <http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast>`_)
Source Files
------------
Use a ``.cpp`` suffix for code files and ``.h`` for header files.
Header files should always use include guards with the following style (See
`SF.8 <http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#sf8-use-include-guards-for-all-h-files>`_):
.. code-block:: C++
#ifndef OPENMC_MODULE_NAME_H
#define OPENMC_MODULE_NAME_H
namespace openmc {
...
content
...
}
#endif // OPENMC_MODULE_NAME_H
Avoid hidden dependencies by always including a related header file first,
followed by C/C++ library includes, other library includes, and then local
includes. For example:
.. code-block:: C++
// foo.cpp
#include "foo.h"
#include <cstddef>
#include <iostream>
#include <vector>
#include "hdf5.h"
#include "pugixml.hpp"
#include "error.h"
#include "random_lcg.h"
Naming
------
In general, write your code in lower-case. Having code in all caps does not
enhance code readability or otherwise.
Struct and class names should be CamelCase, e.g. ``HexLattice``.
Functions (including member functions) should be lower-case with underscores,
e.g. ``get_indices``.
Local variables, global variables, and struct/class attributes should be
lower-case with underscores (e.g. ``n_cells``) except for physics symbols that
are written differently by convention (e.g. ``E`` for energy).
Local variables, global variables, and struct/class member variables should be
lower-case with underscores (e.g., ``n_cells``) except for physics symbols that
are written differently by convention (e.g., ``E`` for energy). Data members of
classes (but not structs) additionally have trailing underscores (e.g.,
``a_class_member_``).
Const variables should be in upper-case with underscores, e.g. ``SQRT_PI``.
Accessors and mutators (get and set functions) may be named like
variables. These often correspond to actual member variables, but this is not
required. For example, ``int count()`` and ``void set_count(int count)``.
Variables declared constexpr or const that have static storage duration (exist
for the duration of the program) should be upper-case with underscores,
e.g., ``SQRT_PI``.
Use C++-style declarator layout (see `NL.18
<http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#nl18-use-c-style-declarator-layout>`_):
pointer and reference operators in declarations should be placed adject to the
base type rather than the variable name. Avoid declaring multiple names in a
single declaration to avoid confusion:
.. code-block:: C++
T* p; // good
T& p; // good
T *p; // bad
T* p, q; // misleading
Curly braces
------------
@ -280,6 +326,13 @@ the same line or omit the braces entirely.
for (int i = 0; i < 5; i++) content();
Documentation
-------------
Classes, structs, and functions are to be annotated for the `Doxygen
<http://www.stack.nl/~dimitri/doxygen/>`_ documentation generation tool. Use the
``\`` form of Doxygen commands, e.g., ``\brief`` instead of ``@brief``.
------
Python
------
@ -288,15 +341,17 @@ Style for Python code should follow PEP8_.
Docstrings for functions and methods should follow numpydoc_ style.
Python code should work with both Python 2.7+ and Python 3.0+.
Python code should work with Python 3.4+.
Use of third-party Python packages should be limited to numpy_, scipy_, and
h5py_. Use of other third-party packages must be implemented as optional
dependencies rather than required dependencies.
Use of third-party Python packages should be limited to numpy_, scipy_,
matplotlib_, pandas_, and h5py_. Use of other third-party packages must be
implemented as optional dependencies rather than required dependencies.
.. _C++ Core Guidelines: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
.. _numpydoc: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
.. _numpy: http://www.numpy.org/
.. _scipy: http://www.scipy.org/
.. _scipy: https://www.scipy.org/
.. _matplotlib: https://matplotlib.org/
.. _pandas: https://pandas.pydata.org/
.. _h5py: http://www.h5py.org/

View file

@ -1,80 +0,0 @@
==========================================
OpenMC Monte Carlo Particle Transport Code
==========================================
|licensebadge| |travisbadge| |coverallsbadge|
The OpenMC project aims to provide a fully-featured Monte Carlo particle
transport code based on modern methods. It is a constructive solid geometry,
continuous-energy transport code that uses HDF5 format cross sections. The
project started under the Computational Reactor Physics Group at MIT.
Complete documentation on the usage of OpenMC is hosted on Read the Docs (both
for the `latest release`_ and developmental_ version). If you are interested in
the project or would like to help and contribute, please send a message to the
OpenMC User's Group `mailing list`_.
------------
Installation
------------
Detailed `installation instructions`_ can be found in the User's Guide.
------
Citing
------
If you use OpenMC in your research, please consider giving proper attribution by
citing the following publication:
- Paul K. Romano, Nicholas E. Horelik, Bryan R. Herman, Adam G. Nelson, Benoit
Forget, and Kord Smith, "`OpenMC: A State-of-the-Art Monte Carlo Code for
Research and Development <https://doi.org/10.1016/j.anucene.2014.07.048>`_,"
*Ann. Nucl. Energy*, **82**, 90--97 (2015).
---------------
Troubleshooting
---------------
If you run into problems compiling, installing, or running OpenMC, first check
the `Troubleshooting section`_ in the User's Guide. If you are not able to find
a solution to your problem there, please send a message to the User's Group
`mailing list`_.
--------------
Reporting Bugs
--------------
OpenMC is hosted on GitHub and all bugs are reported and tracked through the
Issues_ feature on GitHub. However, GitHub Issues should not be used for common
troubleshooting purposes. If you are having trouble installing the code or
getting your model to run properly, you should first send a message to the
User's Group `mailing list`_. If it turns out your issue really is a bug in the
code, an issue will then be created on GitHub. If you want to request that a
feature be added to the code, you may create an Issue on github.
-------
License
-------
OpenMC is distributed under the MIT/X license_.
.. _latest release: http://openmc.readthedocs.io/en/stable/
.. _developmental: http://openmc.readthedocs.io/en/latest/
.. _mailing list: https://groups.google.com/forum/?fromgroups=#!forum/openmc-users
.. _installation instructions: http://openmc.readthedocs.io/en/stable/usersguide/install.html
.. _Troubleshooting section: http://openmc.readthedocs.io/en/stable/usersguide/troubleshoot.html
.. _Issues: https://github.com/mit-crpg/openmc/issues
.. _license: http://openmc.readthedocs.io/en/stable/license.html
.. |licensebadge| image:: https://img.shields.io/github/license/mit-crpg/openmc.svg
:target: http://openmc.readthedocs.io/en/latest/license.html
:alt: License
.. |travisbadge| image:: https://travis-ci.org/mit-crpg/openmc.svg?branch=develop
:target: https://travis-ci.org/mit-crpg/openmc
:alt: Travis CI build status (Linux)
.. |coverallsbadge| image:: https://coveralls.io/repos/github/mit-crpg/openmc/badge.svg?branch=develop
:target: https://coveralls.io/github/mit-crpg/openmc?branch=develop
:alt: Code Coverage

View file

@ -736,7 +736,7 @@ contains
! find which material is associated with this cell (material_index
! is the index into the materials array)
if (present(instance)) then
material_index = cells(index) % material(instance)
material_index = cells(index) % material(instance + 1)
else
material_index = cells(index) % material(1)
end if