Commit graph

294 commits

Author SHA1 Message Date
Paul Romano
9af5541e88 Make Source::sample() method const 2020-10-27 10:02:03 -05:00
Paul Romano
0bb39005bc Rename source classes 2020-10-23 14:11:34 -05:00
Paul Romano
713469bf59 Make regular source distributions obey the same interface as custom sources 2020-10-22 15:07:28 -05:00
Paul Romano
7228bba307 Use nbsphinx for rendering Jupyter notebooks in documentation 2020-10-14 07:57:52 -05:00
Gavin Ridley
350df166fb fix ResultsList construction in pincell_depletion restart example 2020-10-08 19:57:36 -04:00
Paul Romano
6ab74d1278
Merge pull request #1640 from cjwyett/develop
Making the example modelling more consistent and repetitive.
2020-08-31 13:53:24 -05:00
Cyrus Wyett
e6aada5975
Update examples/jupyter/hexagonal-lattice.ipynb
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
2020-08-31 14:07:03 +01:00
Paul Romano
726adfb46c
Merge pull request #1623 from DanShort12/serialised_custom_source
Add support for serialized custom sources
2020-08-31 07:35:49 -05:00
Dan Short
21e8d91e90 Requested updates to source
Rename sample_source -> sample.
Use std::string as type of argument to openmc_create_source.
Use reinterpret_cast when accessing dlsym.
Also moves check for dlerror to be before the attempt to create the
source (avoids null reference if fails) and capture error message
before dlclose, so that the error message is still available.
Formatting updates and some refactoring for examples and tests.
2020-08-28 09:49:36 +01:00
Cyrus Wyett
7eab3055f5
Another iteration on hexagonal lattice.
In the original example the rings were constructed as 'inner_ring', 'outer_ring' and 'middle_ring'. This naming convention only really works for 3-ringed lattices.   

The example has been slightly modified to contain a fourth ring. The lattice is constructed as:

`lattice.universes = [outer_ring, ring_1, ring_2, inner_ring]`

Which is much more translatable to lattices of any size. 

This commit also incorporates feedback on the criticality search tutorial changes.
2020-08-28 08:55:12 +01:00
Cyrus Wyett
b1d309faaa
Clearer naming in candu and triso
There is a loop in candu that isn't incredibly readable, although I'm not quite sure how/if it can be improved:
`for i, (r, n, a) in enumerate(zip(ring_radii, num_pins, angles)):
    for j in range(n):`
Also de-abbreviated some of triso, e.g:
`trisos = [openmc.model.TRISO(outer_radius, triso_univ, c) for c in centers]`
Became:
`trisos = [openmc.model.TRISO(outer_radius, triso_univ, center) for center in centers]`

Let me know if you don't like it and it'll be changed.
2020-08-26 05:16:47 +01:00
Cyrus Wyett
148ca44c45
Incorporate feedback on settings definition
Also got rid of warnings by removing manually set ID's for cells. The ID for zirconium, for example was set to 2 which conflicted with an already defined material with an automatically generated ID of 2. Same for some others.

There is a part of the notebook that talks about ID's so I left that one alone. After the central point about ID's is made there's little point in keeping them in for the cells (unless you like looking at pink warning messages).
2020-08-25 15:11:46 +01:00
Cyrus Wyett
59ce6d1a7b
Mistake: Uploaded the correct files for hexagonal and search 2020-08-25 13:35:54 +01:00
Cyrus Wyett
befc9e6fe9
Clean up criticality search (pls read comment)
Did a bit more for this one:
a) Got rid of warning messages that came from setting the root universe's ID to 0.
b) Moved source building to above the settings definition (rather than in the middle of it.)  
c) Removed `bracketed_method='bisect'` as this is the default argument.

Perhaps there should be a default tolerance as well? And is there a good reason to default `print_iterations` to false?
2020-08-25 12:40:41 +01:00
Cyrus Wyett
284871e0ba
cleanup hexagonal lattice 2020-08-25 12:19:44 +01:00
Dan Short
821e7d9825 Remove old source_sampling custom source method
Custom sources are now created only through the new class-based method,
which supports parameterization.
New method also slightly adjusted to create the source as managed by a
unique_ptr.
Examples and tests updated to align with this approach.
Documentation updated.
2020-08-21 12:05:43 +01:00
Cyrus Wyett
afbf0e6216
Add files via upload 2020-08-21 07:25:34 +01:00
Cyrus Wyett
b2412adb74
Add files via upload 2020-08-15 07:11:22 +01:00
Cyrus Wyett
3cb21a6f03
Get rid of warnings 2020-08-15 07:04:17 +01:00
Cyrus Wyett
8f6caffcf2
Add files via upload 2020-08-15 06:55:49 +01:00
Cyrus Wyett
e7b7c402fc
Add files via upload 2020-08-15 06:53:12 +01:00
Andrew Johnson
fe12fb1e96
Merge pull request #1635 from cjwyett/patch-2
Fix #1634
2020-08-10 08:38:00 -04:00
Cyrus Wyett
1a2af8eb54
Fix #1634 2020-08-09 05:22:07 +01:00
Cyrus Wyett
c37f0e6657
Remove word "Fortran"
Not sure if this is right?
2020-08-09 00:53:23 +01:00
Dan Short
0bb5030ee0 Rename create -> openmc_create_source 2020-08-05 16:02:52 +01:00
Dan Short
fae474869c Remove external destroy method
OpenMC will call delete directly on the CustomSource.
2020-08-05 16:00:49 +01:00
Dan Short
64a4c96a94 Rename serialized -> parameterized
Updates to examples and tests to refer to parameterized sources rather
than serialized sources.
Small update to source.h to remove reference to serialized parameters.
2020-08-05 15:53:48 +01:00
Dan Short
9c1b318e78 Only instantiate custom source once
In the existing custom_source implementation, the source will only be
created once. This is much more efficient than the custom serialized
source, where each sampling will create a new instance of the class.
As there could be many samples, this introduces an overhead,
particularly if the operations to instantiate the class are not trivial.
This implementation defines an abstract class, which is then used by the
custom classes to allow the custom serialized class to be created based
on the plugin, sampled from, and then destroyed.
Update documentation and test to reflect this.
2020-08-03 17:38:12 +01:00
Dan Short
8bb10563c1 Pass serialization as parameter attribute
Changes the implementation of the serialization to be on an attribute of
the source XML element within settings.xml. This removes the need for a
new file containing the serialization.
Parameters are provided as a key-value string, separated by a comma and
a space, although the implementation can change this is required.
Change example values to align with existing custom_source to make
comparisons easier.
Update documentation to be consistent.
2020-08-03 14:24:17 +01:00
Dan Short
7770010cf1 Formatting updates
Use American English consistently.
A small tweak to a brace in the SerializedSource.
2020-07-31 16:55:00 +01:00
Dan Short
175d57c126 Load the serialized representation from file once
The previous implementation had each sampling run reading from the
serialized file. This introduced a large I/O overhead and the
performance was much slower than the equivalent run with the
unserialized source.
2020-07-31 13:25:46 +01:00
Dan Short
d4e7fa5d87 Add description of serialized XML file to README 2020-07-31 13:22:29 +01:00
Dan Short
59594fea70 Add copy of existing show_flux.py 2020-07-31 11:48:53 +01:00
Dan Short
62e194e0d6 Add README to describe usage of serialized source 2020-07-31 11:48:32 +01:00
Dan Short
6b193882c3 Class and sampling function of serialized source
Generates a source ring in a similar manner to the existing
custom_source example.
Allows the radius and energy to be defined via a serialized
representation of the source.
Builds using CMake.
2020-07-31 11:41:43 +01:00
Dan Short
1b60181ddb Update build_xml to use serialization
File is largely based on the existing custom_source example.
Uses the serialization attribute on the source to
point to an XML file
containing the serialized representation of the source.
Also builds the serialized_source.xml file with some default values.
Uses a new name for the library containing the serializable source.
2020-07-31 10:29:23 +01:00
Patrick Shriwise
5f323bd8f3 Adding capability in the Python API to write a point-cloud dataset in VTK with user-specified data. 2020-04-24 12:06:52 -05:00
rockfool
a9bafd777a address minor comments 2020-04-06 21:04:39 -04:00
rockfool
d93e459087 rerun and update output 2020-04-06 18:39:53 -04:00
rockfool
e5052d1d0c Merge branch 'develop' of github.com:openmc-dev/openmc into develop 2020-04-06 18:34:07 -04:00
rockfool
388daec1aa add flux_3d.png 2020-04-06 18:33:25 -04:00
rockfool
61fe30709f remove zernike example 2020-04-01 12:14:03 -04:00
rockfool
606580d122 join two examples into one 2020-04-01 12:10:01 -04:00
Paul Romano
9b499b4096
Merge pull request #1527 from pshriwise/unstructured_mesh
Unstructured Mesh - Initial implementation
2020-03-31 08:54:56 -05:00
Patrick Shriwise
25fe1ef4f3 Updates to unstructured mesh example notebooks. 2020-03-27 11:39:12 -05:00
Patrick Shriwise
895249b6ca Addressing changes from PR review. 2020-03-25 03:21:39 -05:00
Patrick Shriwise
ca7cba57df
Apply @paulromano 's suggestions from code review.
Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
2020-03-25 03:14:58 -05:00
Patrick Shriwise
131acf4a7a Updating example notebooks to get rid of a weird library error. 2020-03-19 14:15:26 -05:00
Patrick Shriwise
3a7b22cc52 Some updates to the example file. 2020-03-19 14:15:26 -05:00
Patrick Shriwise
9d97756b1c Updates to the unstructured mesh documentation. 2020-03-19 14:15:26 -05:00