Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI_collapse.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#include "GIDI.hpp"
11
12namespace GIDI {
13
14static Vector collapseVector( Vector const &a_vector, std::vector<std::size_t> const &a_collapseIndices,
15 std::vector<double> const &a_weight, bool a_normalize );
16static void multiGroupSetup( Transporting::MultiGroup const &a_boundaries, ptwXPoints **a_boundaries_xs,
17 Transporting::Flux const &a_flux, ptwXYPoints **a_fluxes_xys, ptwXPoints **a_multiGroupFlux );
18
19/* *********************************************************************************************************//**
20 * Collapses a multi-group vector.
21 *
22 * @param a_vector [in] The Vector to collapse.
23 * @param a_settings [in] Specifies the uncollapsed and collapsed multi-group information and the flux.
24 * @param a_particles [in] The list of particles to be transported.
25 * @param a_temperature [in] The temperature of the flux to use when collapsing.
26 *
27 * @return Returns the collapsed Vector.
28 ***********************************************************************************************************/
29
30Vector collapse( Vector const &a_vector, Transporting::Settings const &a_settings, Transporting::Particles const &a_particles, double a_temperature ) {
31
32 Transporting::Particle const *projectile( a_particles.particle( a_settings.projectileID( ) ) );
33 Transporting::ProcessedFlux const *flux( projectile->nearestProcessedFluxToTemperature( a_temperature ) );
34 std::vector<double> const &multiGroupFlux( flux->multiGroupFlux( ) );
35 std::vector<std::size_t> const &collapseIndices( projectile->collapseIndices( ) );
36
37 return( collapseVector( a_vector, collapseIndices, multiGroupFlux, true ) );
38}
39
40/* *********************************************************************************************************//**
41 * Collapses a multi-group vector.
42 *
43 * @param a_vector [in] The Vector to collapse.
44 * @param a_collapseIndices [in] Maps uncollapsed indices to collapsed indices.
45 * @param a_weight [in] The uncollapsed flux weighting.
46 * @param a_normalize [in] If true, divide each collapsed value by it corresponding collapsed weight value.
47 * @return Returns the collapsed Vector.
48 ***********************************************************************************************************/
49
50static Vector collapseVector( Vector const &a_vector, std::vector<std::size_t> const &a_collapseIndices,
51 std::vector<double> const &a_weight, bool a_normalize ) {
52
53 std::size_t n1( a_collapseIndices.size( ) - 1 );
54 std::size_t index1( a_collapseIndices[0] );
55 Vector vectorCollapsed( n1 );
56
57 if( a_vector.size( ) > 0 ) {
58 for( std::size_t i1 = 0; i1 < n1; ++i1 ) {
59 std::size_t index2( a_collapseIndices[i1+1] );
60 double fluxSum = 0;
61 double valueSum = 0;
62
63 for( std::size_t i2 = index1; i2 < index2; ++i2 ) {
64 fluxSum += a_weight[i2];
65 valueSum += a_weight[i2] * a_vector[i2];
66 }
67 if( a_normalize && ( fluxSum != 0 ) ) valueSum /= fluxSum;
68 vectorCollapsed[i1] = valueSum;
69 index1 = index2;
70 }
71 }
72
73 return( vectorCollapsed );
74}
75
76/* *********************************************************************************************************//**
77 * Collapses a multi-group matrix.
78 *
79 * @param a_matrix [in] The Matrix to collapse.
80 * @param a_settings [in] Specifies the uncollapsed and collapsed multi-group information and the flux.
81 * @param a_particles [in] The list of particles to be transported.
82 * @param a_temperature [in] The temperature of the flux to use when collapsing.
83 * @param a_productID [in] Particle id of the outgoing particle.
84 * @return Returns the collapsed Matrix.
85 ***********************************************************************************************************/
86
87Matrix collapse( Matrix const &a_matrix, Transporting::Settings const &a_settings, Transporting::Particles const &a_particles, double a_temperature, std::string const &a_productID ) {
88
89 if( a_matrix.size( ) == 0 ) return( a_settings.multiGroupZeroMatrix( a_particles, a_productID, true ) );
90
91 Transporting::Particle const *projectile( a_particles.particle( a_settings.projectileID( ) ) );
92 Transporting::ProcessedFlux const *flux( projectile->nearestProcessedFluxToTemperature( a_temperature ) );
93 std::vector<double> const &multiGroupFlux( flux->multiGroupFlux( ) );
94 std::vector<std::size_t> const &projectileCollapseIndices( projectile->collapseIndices( ) );
95
96 Transporting::Particle const *product( a_particles.particle( a_productID ) );
97 std::size_t n2 = product->numberOfGroups( );
98
99 std::vector<std::size_t> productCollapseIndices( product->collapseIndices( ) );
100 productCollapseIndices[0] = 0;
101 productCollapseIndices[n2] = a_matrix[0].size( );
102
103 std::vector<double> conservationWeight( a_matrix[0].size( ), 1. );
104 if( product->conserve() == Transporting::Conserve::energyOut ) {
105 std::vector<double> boundaries = product->fineMultiGroup().boundaries();
106 for( std::size_t i1 = 0; i1 < boundaries.size() - 1; ++i1 ) {
107 conservationWeight[i1] = 0.5 * (boundaries[i1] + boundaries[i1+1]);
108 }
109 }
110
111 Matrix productCollapsed( 0, 0 );
112 for( std::size_t i1 = 0; i1 < a_matrix.size( ); ++i1 ) {
113 productCollapsed.push_back( collapseVector( a_matrix[i1], productCollapseIndices, conservationWeight, false ) );
114 }
115
116 Matrix productCollapsedTranspose = productCollapsed.transpose( );
117 Matrix collapsedTranspose( 0, 0 );
118 for( std::size_t i2 = 0; i2 < n2; ++i2 ) {
119 collapsedTranspose.push_back( collapseVector( productCollapsedTranspose[i2], projectileCollapseIndices, multiGroupFlux, true ) );
120 }
121
122 if( product->conserve() == Transporting::Conserve::energyOut ) {
123 double denominator = 1;
124 std::vector<double> boundaries = product->multiGroup().boundaries();
125 for( std::size_t i1 = 0; i1 < boundaries.size() - 1; ++i1 ) {
126 denominator = 0.5 * (boundaries[i1] + boundaries[i1+1]);
127 collapsedTranspose[i1] /= denominator;
128 }
129 }
130
131 return( collapsedTranspose.transpose( ) );
132}
133
134/* *********************************************************************************************************//**
135 * Transport correct a vector.
136 *
137 * @param a_vector [in] The Vector to transport correct.
138 * @param a_transportCorrection [in] The Vector that has the transport correction terms.
139 * @return Returns the collapsed Matrix.
140 ***********************************************************************************************************/
141
142Vector transportCorrect( Vector const &a_vector, Vector const &a_transportCorrection ) {
143
144 return( a_vector - a_transportCorrection );
145}
146
147/* *********************************************************************************************************//**
148 * Transport correct a Matrix.
149 *
150 * @param a_matrix [in] The Matrix to transport correct.
151 * @param a_transportCorrection [in] The Vector that has the transport correction terms.
152 * @return Returns the collapsed Matrix.
153 ***********************************************************************************************************/
154
155Matrix transportCorrect( Matrix const &a_matrix, Vector const &a_transportCorrection ) {
156
157 std::size_t size = a_transportCorrection.size( );
158 Matrix corrected( a_matrix );
159
160 if( size == 0 ) return( corrected );
161 if( a_matrix.size( ) == 0 ) {
162 corrected = Matrix( size, size ); }
163 else {
164 if( size != a_matrix.size( ) ) throw Exception( "transportCorrect: matrix rows different than vector size." );
165 }
166
167 for( std::size_t index = 0; index < size; ++index ) corrected[index][index] -= a_transportCorrection[index];
168 return( corrected );
169}
170
171/*! \class MultiGroupCalulationInformation
172 * This class stores data as needed to multi-group data. Since the flux may be temperature dependent, an instance of this
173 * should only be used for one temperature.
174 */
175
176/* *********************************************************************************************************//**
177 * Constructor.
178 *
179 * @param a_multiGroup [in] The multi-group boundaries.
180 * @param a_flux [in] The flux weighting.
181 ***********************************************************************************************************/
182
184 m_multiGroup( a_multiGroup ),
185 m_flux( a_flux ),
186 m_boundaries_xs( nullptr ),
187 m_fluxes_xys( nullptr ),
188 m_multiGroupFlux( nullptr ) {
189
191}
192
193/* *********************************************************************************************************//**
194 * Destructor that frees allocated memory.
195 ***********************************************************************************************************/
196
203
204/* *********************************************************************************************************//**
205 * Returns a flux weighted multi-group version of the function *a_function*.
206 *
207 * @param a_boundaries [in] List of multi-group boundaries.
208 * @param a_function [in] Function to multi-group.
209 * @param a_flux [in] Flux to use for weighting.
210 *
211 * @return Returns the multi-grouped Vector of *a_function*.
212 ***********************************************************************************************************/
213
214Vector multiGroupXYs1d( Transporting::MultiGroup const &a_boundaries, Functions::XYs1d const &a_function, Transporting::Flux const &a_flux ) {
215
216 std::vector<double> const &boundaries = a_boundaries.boundaries( );
217 int64_t boundariesSize = static_cast<int64_t>( boundaries.size( ) );
218 ptwXPoints *boundaries_xs = ptwX_create( nullptr, boundariesSize, boundariesSize, &(boundaries[0]) );
219 if( boundaries_xs == nullptr ) throw Exception( "GIDI::multiGroup: ptwX_create failed." );
220
221 Transporting::Flux_order const &flux_order_0 = a_flux[0];
222 double const *energies = flux_order_0.energies( );
223 double const *fluxes = flux_order_0.fluxes( );
225 12, 1e-3, static_cast<int64_t>( flux_order_0.size( ) ), 10, static_cast<int64_t>( flux_order_0.size( ) ), energies, fluxes, 0 );
226 if( fluxes_xys == nullptr ) {
227 ptwX_free( boundaries_xs );
228 throw Exception( "GIDI::multiGroup: ptwXY_createFrom_Xs_Ys failed." );
229 }
230
231 ptwXPoints *multiGroupFlux = ptwXY_groupOneFunction( nullptr, fluxes_xys, boundaries_xs, ptwXY_group_normType_none, nullptr );
232 if( multiGroupFlux == nullptr ) {
233 ptwX_free( boundaries_xs );
234 ptwXY_free( fluxes_xys );
235 throw Exception( "GIDI::multiGroup: ptwXY_groupOneFunction failed." );
236 }
237
238 ptwXYPoints *ptwXY = ptwXY_clone2( nullptr, a_function.ptwXY( ) );
239 ptwXPoints *groups = nullptr;
240 if( ptwXY != nullptr ) {
241 ptwXY_mutualifyDomains( nullptr, ptwXY, 1e-12, 1e-12, 1, fluxes_xys, 1e-12, 1e-12, 1 );
242 groups = ptwXY_groupTwoFunctions( nullptr, ptwXY, fluxes_xys, boundaries_xs, ptwXY_group_normType_norm, multiGroupFlux );
243 }
244 ptwX_free( boundaries_xs );
245 ptwXY_free( fluxes_xys );
246 ptwX_free( multiGroupFlux );
247 ptwXY_free( ptwXY );
248 if( groups == nullptr ) throw Exception( "GIDI::multiGroup: ptwXY_groupTwoFunctions failed." );
249
250 Vector vector( static_cast<std::size_t>( ptwX_length( nullptr, groups ) ), ptwX_getPointAtIndex( nullptr, groups, 0 ) );
251 ptwX_free( groups );
252
253 return( vector );
254}
255
256/* *********************************************************************************************************//**
257 * This function returns a flux weighted multi-group version of the product of *a_function1* times * *a_function2*.
258 * The caller owns the returned instance and is respondible for deleting it (i.e., freeing its memory when no longer needed).
259 *
260 * @param a_multiGroupCalulationInformation [in] Store multi-group boundary and flux data used for multi-grouping.
261 * @param a_function1 [in] First function of the product.
262 * @param a_function2 [in] Second function of the product, generally a reaction's cross section.
263 *
264 * @return Returns the multi-grouped Vector.
265 ***********************************************************************************************************/
266
267Vector *multiGroupTwoXYs1ds( MultiGroupCalulationInformation const &a_multiGroupCalulationInformation, Functions::XYs1d const &a_function1,
268 Functions::XYs1d const &a_function2 ) {
269
270 ptwXPoints *boundaries_xs = const_cast<ptwXPoints *>( a_multiGroupCalulationInformation.m_boundaries_xs );
271 ptwXPoints *multiGroupFlux = const_cast<ptwXPoints * >( a_multiGroupCalulationInformation.m_multiGroupFlux );
272 ptwXYPoints *ptwXY1 = nullptr, *ptwXY2 = nullptr, *fluxes_xys = nullptr;
273 ptwXPoints *groups = nullptr;
274 std::string errorMessage( "GIDI::multiGroupTwoXYs1ds: ptwXY_clone2 for a_function1 failed." );
275 statusMessageReporting *smr = nullptr;
276
277 ptwXY1 = ptwXY_clone2( smr, a_function1.ptwXY( ) );
278 if( ptwXY1 != nullptr ) {
279 ptwXY2 = ptwXY_clone2( smr, a_function2.ptwXY( ) );
280 if( ptwXY2 == nullptr ) {
281 errorMessage = "GIDI::multiGroupTwoXYs1ds: ptwXY_clone2 for a_function2 failed."; }
282 else {
283 double min1, min2, max1, max2;
284
285 ptwXY_domainMin( smr, ptwXY1, &min1 );
286 ptwXY_domainMax( smr, ptwXY1, &max1 );
287 ptwXY_domainMin( smr, ptwXY2, &min2 );
288 ptwXY_domainMax( smr, ptwXY2, &max2 );
289 fluxes_xys = ptwXY_domainSlice( smr, const_cast<ptwXYPoints *>( a_multiGroupCalulationInformation.m_fluxes_xys ),
290 std::max( min1, min2 ), std::min( max1, max2), 10, 1 );
291
292 if( fluxes_xys == nullptr ) {
293 errorMessage = "GIDI::multiGroupTwoXYs1ds: ptwXY_domainSlice for flux failed."; }
294 else {
295 ptwXY_mutualifyDomains( smr, ptwXY1, 1e-12, 1e-12, 1, ptwXY2, 1e-12, 1e-12, 1 );
296 ptwXY_mutualifyDomains( smr, ptwXY1, 1e-12, 1e-12, 1, fluxes_xys, 1e-12, 1e-12, 1 );
297 ptwXY_mutualifyDomains( smr, fluxes_xys, 1e-12, 1e-12, 1, ptwXY2, 1e-12, 1e-12, 1 );
298 groups = ptwXY_groupThreeFunctions( smr, ptwXY1, ptwXY2, fluxes_xys, boundaries_xs, ptwXY_group_normType_norm, multiGroupFlux );
299 }
300 }
301 }
302 ptwXY_free( ptwXY1 );
303 ptwXY_free( ptwXY2 );
304 ptwXY_free( fluxes_xys );
305
306 if( groups == nullptr ) {
307 throw Exception( errorMessage );
308 }
309
310 Vector *vector = new Vector( static_cast<std::size_t>( ptwX_length( smr, groups ) ), ptwX_getPointAtIndex( smr, groups, 0 ) );
311 ptwX_free( groups );
312
313 return( vector );
314}
315
316/* *********************************************************************************************************//**
317 * Setups *a_boundaries_xs*, *a_fluxes_xys* and *a_multiGroupFlux* as needed by multi-grouping functions. Calling code are
318 * responsible for free-ing *a_boundaries_xs*, *a_fluxes_xys* and *a_multiGroupFlux*.
319 *
320 * @param a_boundaries [in] List of multi-group boundaries.
321 * @param a_boundaries_xs [out] A ptwXPoints representation of *a_boundaries*.
322 * @param a_flux [in] Flux to use for weighting.
323 * @param a_fluxes_xys [out] A ptwXYPoints representation of *a_flux*.
324 * @param a_multiGroupFlux [out] A ptwYPoints multi-grouped representation of *a_fluxes_xys*.
325 ***********************************************************************************************************/
326
327static void multiGroupSetup( Transporting::MultiGroup const &a_boundaries, ptwXPoints **a_boundaries_xs,
328 Transporting::Flux const &a_flux, ptwXYPoints **a_fluxes_xys, ptwXPoints **a_multiGroupFlux ) {
329
330 std::vector<double> const &boundaries = a_boundaries.boundaries( );
331 int64_t boundariesSize = static_cast<int64_t>( boundaries.size( ) );
332 *a_boundaries_xs = ptwX_create( nullptr, boundariesSize, boundariesSize, &(boundaries[0]) );
333 if( *a_boundaries_xs == nullptr ) throw Exception( "GIDI::multiGroup: ptwX_create failed." );
334
335 Transporting::Flux_order const &flux_order_0 = a_flux[0];
336 double const *energies = flux_order_0.energies( );
337 double const *fluxes = flux_order_0.fluxes( );
339 12, 1e-3, static_cast<int64_t>( flux_order_0.size( ) ), 10, static_cast<int64_t>( flux_order_0.size( ) ), energies, fluxes, 0 );
340 if( *a_fluxes_xys == nullptr ) {
341 *a_boundaries_xs = ptwX_free( *a_boundaries_xs );
342 throw Exception( "GIDI::multiGroup: ptwXY_createFrom_Xs_Ys failed." );
343 }
344
345 *a_multiGroupFlux = ptwXY_groupOneFunction( nullptr, *a_fluxes_xys, *a_boundaries_xs, ptwXY_group_normType_none, nullptr );
346 if( *a_multiGroupFlux == nullptr ) {
347 *a_boundaries_xs = ptwX_free( *a_boundaries_xs );
348 *a_fluxes_xys = ptwXY_free( *a_fluxes_xys );
349 throw Exception( "GIDI::multiGroup: ptwXY_groupOneFunction failed." );
350 }
351}
352
353/* *********************************************************************************************************//**
354 * This function finds a component's data that can be multi-grouped (generally a **Functions::XYs1d** instance, multi-groups it with
355 * the boundaries and flux data in *a_multiGroupCalulationInformation* with weight *a_crossSection* and adds/replaces with style
356 * label *a_heatedMultiGroupLabel*.
357 *
358 * @param a_heatedMultiGroupLabel [in] The label of the style for the multi-group data being added.
359 * @param a_multiGroupCalulationInformation [in] Store multi-group boundary and flux data used for multi-grouping.
360 * @param a_component [in] The Component whose data will be multi-grouped.
361 * @param a_weight [in] An additional function to weight the data with. This is generally a reactions cross section.
362 ***********************************************************************************************************/
363
364void calculate1dMultiGroupDataInComponent( LUPI_maybeUnused ProtareSingle const *a_protare, std::string const &a_heatedMultiGroupLabel,
365 MultiGroupCalulationInformation const &a_multiGroupCalulationInformation, Component &a_component, Functions::XYs1d const &a_weight ) {
366
367 Functions::XYs1d const *xys1d = static_cast<Functions::XYs1d const *>( a_component.findInstanceOfTypeInLineage( a_heatedMultiGroupLabel, GIDI_XYs1dChars ) );
368 Functions::XYs1d const *xys1d2{ nullptr };
369
370 if( xys1d == nullptr ) {
371 Functions::Constant1d const *constand1d =
372 static_cast<Functions::Constant1d const *>( a_component.findInstanceOfTypeInLineage( a_heatedMultiGroupLabel, GIDI_constant1dChars ) );
373 if( constand1d != nullptr ) {
374 xys1d2 = GIDI::Functions::XYs1d::makeConstantXYs1d( GIDI::Axes( ), constand1d->domainMin( ), constand1d->domainMax( ), constand1d->value( ) ); }
375 else {
377 static_cast<Functions::Regions1d const *>( a_component.findInstanceOfTypeInLineage( a_heatedMultiGroupLabel, GIDI_regions1dChars ) );
378 if( regions1d != nullptr ) {
379 xys1d2 = regions1d->asXYs1d( true, 1e-4, 1e-6, 1e-6 ); }
380 else {
382 static_cast<Functions::Branching1d const *>( a_component.findInstanceOfTypeInLineage( a_heatedMultiGroupLabel, GIDI_branching1dChars ) );
383 if( branching1d != nullptr ) {
384 xys1d2 = Functions::XYs1d::makeConstantXYs1d( GIDI::Axes( ), a_weight.domainMin( ), a_weight.domainMax( ), branching1d->multiplicity( ) ); }
385 else {
387 static_cast<Functions::Polynomial1d const *>( a_component.findInstanceOfTypeInLineage( a_heatedMultiGroupLabel, GIDI_polynomial1dChars ) );
388 if( polynomial1d != nullptr ) {
389 xys1d2 = polynomial1d->asXYs1d( true, 1e-4, 1e-6, 1e-6 ); }
390 else {
391 throw Exception( "calculate1dMultiGroupDataInComponent: from findInstanceOfTypeInLineage, no XYs1d, Constant1d, Regions1d, Branching1d or Polynomial1d form found in "
392 + a_component.toXLink( ) + "." );
393 }
394 }
395 }
396 }
397 xys1d = xys1d2;
398 }
399
400 Vector *vector = multiGroupTwoXYs1ds( a_multiGroupCalulationInformation, *xys1d, a_weight );
401 Functions::Gridded1d *gridded1d = a_component.get<Functions::Gridded1d>( a_heatedMultiGroupLabel );
402 gridded1d->setData( *vector );
403 delete vector;
404 delete xys1d2;
405}
406
407/* *********************************************************************************************************//**
408 * This function
409 *
410 * @param a_multiGroupCalulationInformation [in] Store multi-group boundary and flux data used for multi-grouping.
411 * @param a_weight [in] An additional function to weight the data with. This is generally a reactions cross section.
412 * @param a_evaluated [in] This is the evaluated form of the fission energy released.
413 * @param a_gridded1d [in] This is the current multi-grouped form whose data will be replace.
414 ***********************************************************************************************************/
415
416void calculate1dMultiGroupFissionEnergyRelease( MultiGroupCalulationInformation const &a_multiGroupCalulationInformation, Functions::XYs1d const &a_weight,
417 Functions::Function1dForm const *a_evaluated, Functions::Function1dForm *a_gridded1d ) {
418
419 if( a_gridded1d == nullptr ) return;
420
421 Functions::XYs1d const *xys1d = nullptr;
422 Functions::Gridded1d *gridded1d = static_cast<Functions::Gridded1d *>( a_gridded1d );
423
424 if( a_evaluated->moniker( ) == GIDI_XYs1dChars ) {
425 xys1d = static_cast<Functions::XYs1d const *>( a_evaluated ); }
426 else if( a_evaluated->moniker( ) == GIDI_polynomial1dChars ) {
427 Functions::Polynomial1d const *polynomial1d = static_cast<Functions::Polynomial1d const *>( a_evaluated );
428 xys1d = polynomial1d->asXYs1d( true, 1e-4, 1e-6, 1e-6 ); }
429 else {
430 throw Exception( "calculate1dMultiGroupFissionEnergyRelease: form not XYs1d or Polynomial1d: " + a_evaluated->toXLink( ) + "." );
431 }
432
433 Vector *vector = multiGroupTwoXYs1ds( a_multiGroupCalulationInformation, *xys1d, a_weight );
434 gridded1d->setData( *vector );
435 delete vector;
436
437 if( a_evaluated != xys1d ) delete xys1d;
438}
439
440}
#define GIDI_regions1dChars
Definition GIDI.hpp:292
#define GIDI_XYs1dChars
Definition GIDI.hpp:288
#define GIDI_branching1dChars
Definition GIDI.hpp:296
#define GIDI_constant1dChars
Definition GIDI.hpp:287
#define GIDI_polynomial1dChars
Definition GIDI.hpp:290
#define LUPI_maybeUnused
double domainMax() const
Definition GIDI.hpp:1068
double domainMin() const
Definition GIDI.hpp:1067
void setData(Vector const &a_data)
Definition GIDI.hpp:1255
ptwXYPoints const * ptwXY() const
Definition GIDI.hpp:1101
double domainMax() const
Definition GIDI.hpp:1115
double domainMin() const
Definition GIDI.hpp:1114
XYs1d * asXYs1d(bool a_asLinlin, double a_accuray, double a_lowerEps, double a_upperEps) const
static XYs1d * makeConstantXYs1d(Axes const &a_axes, double a_domainMin, double a_domainMax, double a_value)
std::size_t size() const
Matrix transpose()
void push_back(Vector const &a_vector)
Transporting::Flux const & m_flux
Definition GIDI.hpp:5496
Transporting::MultiGroup const & m_multiGroup
Definition GIDI.hpp:5495
MultiGroupCalulationInformation(Transporting::MultiGroup const &a_multiGroup, Transporting::Flux const &a_flux)
Form const * findInstanceOfTypeInLineage(std::string const &_label, std::string const &a_moniker) const
T * get(std::size_t a_Index)
Definition GIDI.hpp:2642
std::size_t size() const
Definition GIDI.hpp:3554
double const * fluxes() const
Definition GIDI.hpp:3557
double const * energies() const
Definition GIDI.hpp:3555
std::vector< double > const & boundaries() const
Definition GIDI.hpp:3501
std::vector< std::size_t > const & collapseIndices() const
Definition GIDI.hpp:3672
ProcessedFlux const * nearestProcessedFluxToTemperature(double a_temperature) const
Particle const * particle(std::string const &a_particleID) const
Matrix multiGroupZeroMatrix(Particles const &a_particles, std::string const &a_particleID, bool a_collapse=true) const
std::string const & projectileID() const
Definition GIDI.hpp:3725
std::size_t size() const
Definition GIDI_data.hpp:79
std::string const & moniker() const
Definition GUPI.hpp:102
std::string toXLink() const
Definition GIDI.hpp:32
Vector multiGroupXYs1d(Transporting::MultiGroup const &a_boundaries, Functions::XYs1d const &a_function, Transporting::Flux const &a_flux)
void calculate1dMultiGroupFissionEnergyRelease(MultiGroupCalulationInformation const &a_multiGroupCalulationInformation, Functions::XYs1d const &a_weight, Functions::Function1dForm const *a_evaluated, Functions::Function1dForm *a_gridded1d)
void calculate1dMultiGroupDataInComponent(ProtareSingle const *a_protare, std::string const &a_heatedMultiGroupLabel, MultiGroupCalulationInformation const &a_multiGroupCalulationInformation, Component &a_component, Functions::XYs1d const &a_crossSection)
Vector transportCorrect(Vector const &a_vector, Vector const &a_transportCorrection)
Vector collapse(Vector const &a_vector, Transporting::Settings const &a_settings, Transporting::Particles const &a_particles, double a_temperature)
Vector * multiGroupTwoXYs1ds(MultiGroupCalulationInformation const &a_multiGroupCalulationInformation, Functions::XYs1d const &a_function1, Functions::XYs1d const &a_function2)
ptwXYPoints * ptwXY_domainSlice(statusMessageReporting *smr, ptwXYPoints *ptwXY, double domainMin, double domainMax, int64_t secondarySize, int fill)
Definition ptwXY_core.c:422
ptwXYPoints * ptwXY_clone2(statusMessageReporting *smr, ptwXYPoints const *ptwXY)
Definition ptwXY_core.c:312
char const * ptwXY_interpolationToString(ptwXY_interpolation interpolation)
@ ptwXY_group_normType_none
Definition ptwXY.h:31
@ ptwXY_group_normType_norm
Definition ptwXY.h:31
ptwXPoints * ptwXY_groupTwoFunctions(statusMessageReporting *smr, ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, ptwXPoints *groupBoundaries, ptwXY_group_normType normType, ptwXPoints *ptwX_norm)
@ ptwXY_interpolationLinLin
Definition ptwXY.h:37
struct ptwXYPoints_s ptwXYPoints
nfu_status ptwXY_mutualifyDomains(statusMessageReporting *smr, ptwXYPoints *ptwXY1, double lowerEps1, double upperEps1, int positiveXOnly1, ptwXYPoints *ptwXY2, double lowerEps2, double upperEps2, int positiveXOnly2)
ptwXYPoints * ptwXY_createFrom_Xs_Ys(statusMessageReporting *smr, ptwXY_interpolation interpolation, char const *interpolationString, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, int64_t length, double const *Xs, double const *Ys, int userFlag)
Definition ptwXY_core.c:138
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
Definition ptwXY_core.c:782
ptwXPoints * ptwXY_groupThreeFunctions(statusMessageReporting *smr, ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, ptwXYPoints *ptwXY3, ptwXPoints *groupBoundaries, ptwXY_group_normType normType, ptwXPoints *ptwX_norm)
ptwXPoints * ptwXY_groupOneFunction(statusMessageReporting *smr, ptwXYPoints *ptwXY, ptwXPoints *groupBoundaries, ptwXY_group_normType normType, ptwXPoints *ptwX_norm)
nfu_status ptwXY_domainMax(statusMessageReporting *smr, ptwXYPoints *ptwXY, double *value)
nfu_status ptwXY_domainMin(statusMessageReporting *smr, ptwXYPoints *ptwXY, double *value)
int64_t ptwX_length(statusMessageReporting *smr, ptwXPoints *ptwX)
Definition ptwX_core.c:222
double * ptwX_getPointAtIndex(statusMessageReporting *smr, ptwXPoints *ptwX, int64_t index)
Definition ptwX_core.c:280
struct ptwXPoints_s ptwXPoints
ptwXPoints * ptwX_create(statusMessageReporting *smr, int64_t size, int64_t length, double const *xs)
Definition ptwX_core.c:54
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition ptwX_core.c:213