Commit graph

113 commits

Author SHA1 Message Date
Gavin Ridley
2172907bcf refactor particle source import/export 2023-03-31 14:17:04 -04:00
Patrick Shriwise
d0988327fe Applying formatter 2023-01-13 00:00:16 -06:00
Patrick Shriwise
4195d1e8ca Restoring blank lines in settings.cpp and source.cpp 2023-01-12 23:20:11 -06:00
NybergWISC
bd60956d20 Second round of comments. volume method is now implemented from Mesh instead of UnstructuredMesh 2022-12-29 09:23:14 -06:00
NybergWISC
9f6d536959 Commit including most of the sampling work in distribution_spatial.cpp and testing 2022-12-29 09:23:12 -06:00
NybergWISC
80077ed3fd New changes to spatial distribution and source to include mesh sources. Made some edits suggested by Shriwise, now compiles successfully 2022-12-29 09:22:34 -06:00
Paul Romano
185920a7f1 Allow source particles with energy below cutoff (will just deposit energy) 2022-12-05 16:19:58 -06:00
Paul Romano
2e433653cc Avoid warning message on clang 2022-10-21 07:08:53 -05:00
Paul Romano
5d441251fc
Apply @pshriwise suggestions from code review
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
2022-09-30 13:56:01 -05:00
Paul Romano
3e5c9d83c5 Expand source rejection to cells, materials, and universes 2022-09-26 13:25:41 -05:00
Paul Romano
aff6316642 Simple rejection based on a vector of cell IDs 2022-09-26 13:25:41 -05:00
Gavin Ridley
cf278af281 helpful error message for excessive energy spectrum rejection rate 2022-09-21 12:07:42 -04:00
Paul Romano
b1267f0544 Allow openmc_sample_external_source to produce multiple samples 2022-07-15 20:12:10 -05:00
Paul Romano
953b35e742 Add openmc_sample_external_source function and Python binding 2022-07-15 07:21:08 -05:00
Paul Romano
4d538282f6 clang-formatize source.cpp 2022-01-12 12:02:45 -06:00
Olaf Schumann
d93df33dfb Implementation of time distribution for the source 2022-01-05 21:06:09 +00:00
Paul Romano
ef61563079 Ensure time is propagated to secondary particles 2022-01-05 07:43:43 -06:00
Paul Romano
1bc2bd8460 Apply clang-format on entire source 2021-08-11 11:41:49 -05:00
Gavin Ridley
061156e79a address PR comments 2021-05-03 18:03:06 -04:00
Gavin Ridley
ad4e1c9f4a remove std:: from vector,unique_ptr,make_unique,array 2021-05-03 18:01:27 -04:00
Gavin Ridley
2af4c9cd92 use base class to handle layout of particle data 2021-05-03 17:57:41 -04:00
YoungHui Park
f40c7aac7e Set surf_id of IndependentSource with default value 2021-01-18 14:36:05 -06:00
YoungHui Park
aa838872c4 Resolve rebase leftover 2021-01-18 14:36:05 -06:00
YoungHui Park
f2bdae918c Change the way surface source reading flag is given 2021-01-18 14:36:04 -06:00
YoungHui Park
f388ac2e1e Rename variables for better readability 2021-01-18 14:36:04 -06:00
YoungHui Park
b5f6dacb7d Add setting parameter for surface source file reading 2021-01-18 14:36:04 -06:00
YoungHui Park
1c155526e9 Add missing argument 2021-01-18 14:36:04 -06:00
Paul Romano
b57ee1f757
Fix class name in comment in source.cpp
Co-authored-by: DanShort12 <66615563+DanShort12@users.noreply.github.com>
2020-10-27 16:03:11 -05:00
Paul Romano
9af5541e88 Make Source::sample() method const 2020-10-27 10:02:03 -05:00
Paul Romano
b271399f63 Allow read_source_bank to be distributed or not 2020-10-27 10:02:00 -05:00
Paul Romano
0bb39005bc Rename source classes 2020-10-23 14:11:34 -05:00
Paul Romano
5a60133d5b Implement SourceFile derived from SourceDistribution 2020-10-23 06:56:14 -05:00
Paul Romano
3f62fab565 Add wrapper class for custom sources 2020-10-22 15:50:30 -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
8f71ed2a1d Store sites from source file in SourceDistribution 2020-10-22 15:07:23 -05: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
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
Paul Romano
1e61efe40e
Merge pull request #1627 from drewejohnson/fmt-msg-output
Delay formatting of some messages unless they're going to be printed
2020-08-06 14:22:06 -05:00
Andrew Johnson
bd76dbd9a2
Apply templated write_message to source.cpp 2020-08-06 07:05:02 -04:00
Sterling Harper
a5ef3dc405 Sample source sites in parallel 2020-08-05 18:34:12 -04: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
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
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
67e846c4d5 Load new serializable form of source function
Updates the SourceDistribution to optionally look for a function
template accepting char* as the second argument.
If serialization is defined as an attribute on the source element
provided in the settings.xml then the new form with serialization will
be used. Otherwise the existing form to load the custom source as-is
from the library will be used.
2020-07-31 11:48:00 +01:00
Yue JIN
10889172ce Fix to allow build in VS2019 2020-07-15 16:23:07 +08:00
davidjohnlong
ce135cc4a9 Refactor fixed source sampling so call to custom library is made from call to sample_external_source() 2020-03-12 17:02:22 +00:00
davidjohnlong
eac442f31c Move function description to header file 2020-03-12 09:34:38 +00:00