Giter Club home page Giter Club logo

papillon-ndl's Introduction

Papillon Nuclear Data Library

CMake Workflow Documentation Status License DOI

The Papillon Nuclear Data Library (NDL) is a C++/Python library for reading, sampling, and interacting with continuous energy nuclear data, stored in the ACE nuclear data format.

For examples of how to use the library in both C++ and Python, take a look at the documentation site. That is where you will also be able to fined more detailed installation instructions.

License

PapillonNDL is provided under the terms and conditions of the GPLv3 license.

Dependencies

The library may be built on Unix-like operating systems or on Windows. All that is required is cmake >= 3.11, and a C++ compiler which supports the C++20 standard. For Unix-like systems, the recommended compilers are GCC >= 11 or Clang >= 15. On Windows, you should have MSVC >= 19.29. In order to build the Python interface, Python >= 3.5 should be installed on your system, in addition to the Python development libraries and header files.

Tests are not built by default, and should only be needed for developers. You can turn them on by using -DPNDL_TESTS=ON with cmake.

Install

To build PapillonNDL, navigate to the directory where you would like to keep the source files, and then run the following commands:

$ git clone https://github.com/HunterBelanger/papillon-ndl.git
$ cd papillon-ndl
$ cmake -E make_directory build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ cmake --build . --target install

If you do NOT want to build the Python bindings for PapillonNDL, then you should add the flag -DPNDL_PYTHON=OFF to the cmake command.

papillon-ndl's People

Contributors

furutaka avatar hunterbelanger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

papillon-ndl's Issues

Energy Grid Interpolation Rounding Error

Currently, it appears that round-off error is occurring when an EnergyGrid instance is constructed directly from an std::vector<double>, as it first converts all of the values to floats, and then saves them as doubles. This is a remnant of when I used to store XS data as floats. It should suffice to just pass the energy argument to the energy_values_ member in the class initialization, and remove the entire for loop at line 63.

energy_values_[i] = static_cast<float>(energy[i]);

Outdated Install Documentation

While the installation documentation does state that GCC >= 11 is needed to building PapillonNDL, it currently still has distribution-specific installation instruction. Some of these distributions (mainly Debian / Ubuntu) do not yet have GCC 11 however. This needs to be updated.

Also, update the C++17 mention on the docs homepage to C++20.

Additionally, the new PNDL_SHARED and PNDL_INSTALL cmake options should be documented in the installation instructions.

Use std::span and ranges

Now that the move to C++20 has been initiated, the ACE class should be modified to return instances of std::span, and also make use of the new ranges library, when returning transformed segments of the ACE file.

Lambdas will be needed to interface with the python bindings however, as Pybind11 does not support spans. These will just have
to be converted into vectors on the C++ side, and then Pybind will be able to handle them normally.

Problem streaming ZAID

I just noticed a problem, where when I stream a ZAID with leading zeros in the A portion (i.e. H1), I end up getting 11, instead of 1001. This is because I stream

out << zaid.Z() << zaid.A();

I should probably use fixed precision when streaming the A portion.

Support for URR Probability Tables

Support for reading and sampling the standard URR probability tables should be added. As these are temperature dependent, they should probably only be added to STNeutron and not to CENeutronBase.

Move to GPL3

While the CeCILL license is a good license in general, I have now come to realize that Article 13 may be problematic. Additionally, it allows one to pass to the EUPL, which then allows a move to non-copyleft licenses. Because of these two problems, the license should be changed from CeCILL-2.1 to GPL3+. This will require updates to the LICENSE file, and all source files.

Exceptions thrown when reading Lib80x TSL files

There are currently several TSL files distributed with Lib80x which cannot be read, as PNDL throws an exception due to negative PDF values in the incoherent inelastic distributions. Looking at one from Al27 for example, I see a PDF of -1.033976E-19. It is very likely that this could just be set to zero without any problem, but I am still somewhat hesitant about doing this. I will go through all of Lib80x at some point, and see just how many files can and cannot be read. It might also be interesting to remake all of the problematic TSL files with FRENDY, to see if that has better tendencies than NJOY.

Read ACE File with Multiple Tables

There can possibly be several different ACE tables in an ACE file. One common example of this would be a single file for a given nuclide which contains the ACE tables for all the desired temperatures. MCNP for example explicitly allows for this and has an entry in the xsdir indicating where to start reading the file for the desired table. In practice, however, I think this functionality is rarely used ? Currently, PNDL cannot treat this case, and would only read the first ACE table in the file.

Doppler Broadening

I have written an implementation of the Sigma1 algorithm to perform doppler broadening, but it has not yet been added to the library. This must be added, and a new type of cross section should be created, allowing users to supply a temperature argument, and receive the cross section at the desired temperature (so long as that temperature is above the initial temperature).

Here are the general requirments to accomplish this:

  • Add the Sigma1 implementation to the library
  • Add new methods to EnergyGrid, defining the start point of the URR
  • Create a new S1CrossSection class
  • Create new Reaction template specialization Reaction<S1CrossSection>, which should be aliased as S1Reaction
  • Create new CENeutron template specialization CENeutron<S1CrossSection>, which should be aliased as S1Neutron

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.