Commit graph

99 commits

Author SHA1 Message Date
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
davidjohnlong
cc2017786b Rename custom source library and function and move to anonymous namespace 2020-03-12 09:29:28 +00:00
davidjohnlong
3f7afb7b4f
Adjust naming of custom source function and library for clarity
Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
2020-03-12 08:14:31 +00:00
davidjohnlong
d355347e8e
Remove unnecessary variable in src/source.cpp
Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
2020-03-12 08:10:49 +00:00
davidjohnlong
907459d02f Implement new fixed source bank model for custom library source. Additional non-member functions in source.cpp with function pointer saved in model namespace allow custom library to be opened, sampled as needed in initialize_history and closed. 2020-03-06 16:03:15 +00:00
davidjohnlong
0ae1077a39 Implement the new fixed source bank model. For a fixed source calcultion the primary source bank is not allocated memory and source particles can not be read/written to files. The source particles for each history are now sampled at the start of initialize_history() through call to sample_external_source() with the appropriate seed. The timing stats for sampling has been removed from the output since this processing is now part of the transport timer 2020-03-05 19:23:51 +00:00
Paul Romano
c5dbff356a Fixes to custom source feature 2020-02-17 15:45:50 -06:00
Andrew Davis
441c284c52 Refactor into function as suggested by review 2020-02-12 13:06:30 +00:00
Andrew Davis
acce6941c3 line removal from review 2020-02-12 12:48:54 +00:00
Andrew Davis
c6949e5e53 Updated spelling mistakes 2020-02-12 12:44:46 +00:00
Andrew Davis
d4835f49ec Updated the source routines according to passing seed to prn 2020-02-12 12:37:21 +00:00
Andrew Davis
55f85b1924 updated signatures according to new changes in how seed is set 2020-02-12 12:37:21 +00:00
Andrew Davis
8f515b504a Wrapped the first instance trying to use dlopen in a posix safety ifdef 2020-02-12 12:37:21 +00:00
Andrew Davis
7adc619c88 Stylistic changes 2020-02-12 12:37:21 +00:00
Andrew Davis
21bf7243eb Added missing fixed source subroutine 2020-02-12 12:37:21 +00:00