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.
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.
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.
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).
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?