Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI::Transporting::Flux Class Reference

#include <GIDI.hpp>

Public Member Functions

 Flux (std::string const &a_label, double a_temperature_MeV)
 Flux (char const *a_label, double a_temperature_MeV)
 Flux (Flux const &a_flux)
 ~Flux ()
Flux_order const & operator[] (std::size_t a_order) const
std::size_t maxOrder () const
std::size_t size () const
std::string const & label () const
double temperature () const
void addFluxOrder (Flux_order const &a_fluxOrder)
ProcessedFlux process (std::vector< double > const &a_multiGroup) const
void print (std::string const &a_indent, bool a_outline=true, unsigned int a_valuesPerLine=10) const

Detailed Description

Specifies the flux data as a list of Flux_order's.

Definition at line 3567 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Flux() [1/3]

GIDI::Transporting::Flux::Flux ( std::string const & a_label,
double a_temperature )
Parameters
a_label[in] The label for the flux.
a_temperature[in] The temperature the

Definition at line 107 of file GIDI_settings_flux.cc.

107 :
108 m_label( a_label ),
109 m_temperature( a_temperature ) {
110
111}

Referenced by Flux().

◆ Flux() [2/3]

GIDI::Transporting::Flux::Flux ( char const * a_label,
double a_temperature )
Parameters
a_label[in] The label for the flux.
a_temperature[in] The temperature the

Definition at line 118 of file GIDI_settings_flux.cc.

118 :
119 m_label( a_label ),
120 m_temperature( a_temperature ) {
121
122}

◆ Flux() [3/3]

GIDI::Transporting::Flux::Flux ( Flux const & a_flux)
Parameters
a_flux[in] The Flux to copy.

Definition at line 128 of file GIDI_settings_flux.cc.

128 :
129 m_label( a_flux.label( ) ),
130 m_temperature( a_flux.temperature( ) ) {
131
132 for( std::size_t i1 = 0; i1 <= a_flux.maxOrder( ); ++i1 ) { addFluxOrder( a_flux[i1] ); }
133}
void addFluxOrder(Flux_order const &a_fluxOrder)

◆ ~Flux()

GIDI::Transporting::Flux::~Flux ( )

Definition at line 138 of file GIDI_settings_flux.cc.

138 {
139
140}

Member Function Documentation

◆ addFluxOrder()

void GIDI::Transporting::Flux::addFluxOrder ( Flux_order const & a_fluxOrder)

Adds a Flux_order. The Flux_order's must be added sequentially.

Parameters
a_fluxOrder[in] The Flux_order to add to this.

Definition at line 148 of file GIDI_settings_flux.cc.

148 {
149/*
150* Orders can only be added in sequence (e.g., 0 first, then 1, ...).
151*/
152 auto order = a_fluxOrder.order( );
153
154 if( order > m_fluxOrders.size( ) ) throw Exception( "Flux::addFluxOrder: order > m_fluxOrders.size( )." );
155 m_fluxOrders.push_back( a_fluxOrder );
156}

Referenced by Flux().

◆ label()

std::string const & GIDI::Transporting::Flux::label ( ) const
inline

Returns the value of the m_label member.

Definition at line 3585 of file GIDI.hpp.

Referenced by Flux().

◆ maxOrder()

std::size_t GIDI::Transporting::Flux::maxOrder ( ) const
inline

Returns the maximum number of Legendre orders for this.

Definition at line 3582 of file GIDI.hpp.

Referenced by Flux().

◆ operator[]()

Flux_order const & GIDI::Transporting::Flux::operator[] ( std::size_t a_order) const
inline

Returns the Flux_order for Legendre order a_order.

Definition at line 3580 of file GIDI.hpp.

◆ print()

void GIDI::Transporting::Flux::print ( std::string const & a_indent,
bool a_outline = true,
unsigned int a_valuesPerLine = 10 ) const

Print the Flux to std::cout. Mainly for debugging.

Parameters
a_indent[in] The std::string to print at the beginning.
a_outline[in] If true, does not print the flux values.
a_valuesPerLine[in] The number of points (i.e., energy, flux pairs) to print per line.

Definition at line 204 of file GIDI_settings_flux.cc.

204 {
205
206 std::cout << a_indent << "FLUX: label = '" << m_label << "': maximum order = " << ( size( ) - 1 ) << std::endl;
207 if( a_outline ) return;
208 for( std::vector<Flux_order>::const_iterator iter = m_fluxOrders.begin( ); iter < m_fluxOrders.end( ); ++iter )
209 iter->print( a_valuesPerLine );
210}
std::size_t size() const
Definition GIDI.hpp:3583

◆ process()

ProcessedFlux GIDI::Transporting::Flux::process ( std::vector< double > const & a_multiGroup) const

Multi-groups the flux and returns the result.

Parameters
a_multiGroup[in] The Flux to copy.
Returns
[in] The Multi-group flux.

Definition at line 165 of file GIDI_settings_flux.cc.

165 {
166/*
167 Currently only does l=0 flux.
168*/
169 std::size_t i1 = 0;
170 std::vector<double> groupedFlux;
171
172 int64_t size = static_cast<int64_t>( a_multiGroup.size( ) );
173 ptwXPoints *boundaries = ptwX_create( nullptr, size, size, &(a_multiGroup[0]) );
174 if( boundaries == nullptr ) throw Exception( "ptwX_create failted for boundaries." );
175
176 for( ; i1 < 1; ++i1 ) { // only do l=0 currenlty hence ' i1 < 1' test.
177 Flux_order const *__fluxOrder = &(m_fluxOrders[i1]);
179 10, 1e-3, 10, 10, static_cast<int64_t>( __fluxOrder->size( ) ), __fluxOrder->energies( ),
180 __fluxOrder->fluxes( ), 0 );
181 if( __flux == nullptr ) throw Exception( "ptwXY_createFrom_Xs_Ys failed for __flux." );
182
183 ptwXPoints *groupedFluxX = ptwXY_groupOneFunction( nullptr, __flux, boundaries, ptwXY_group_normType_none, nullptr );
184 if( groupedFluxX == nullptr ) throw Exception( "ptwXY_groupOneFunction failed for groupedFluxX." );
185
186 for( int i2 = 0; i2 < ptwX_length( nullptr, groupedFluxX ); ++i2 ) groupedFlux.push_back( ptwX_getPointAtIndex_Unsafely( groupedFluxX, i2 ) );
187
188 ptwX_free( groupedFluxX );
189 ptwXY_free( __flux );
190 }
191 ptwX_free( boundaries );
192
193 return( ProcessedFlux( temperature( ), groupedFlux ) );
194}
double temperature() const
Definition GIDI.hpp:3586
char const * ptwXY_interpolationToString(ptwXY_interpolation interpolation)
@ ptwXY_group_normType_none
Definition ptwXY.h:31
@ ptwXY_interpolationLinLin
Definition ptwXY.h:37
struct ptwXYPoints_s ptwXYPoints
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_groupOneFunction(statusMessageReporting *smr, ptwXYPoints *ptwXY, ptwXPoints *groupBoundaries, ptwXY_group_normType normType, ptwXPoints *ptwX_norm)
int64_t ptwX_length(statusMessageReporting *smr, ptwXPoints *ptwX)
Definition ptwX_core.c:222
double ptwX_getPointAtIndex_Unsafely(ptwXPoints *ptwX, int64_t index)
Definition ptwX_core.c:297
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

◆ size()

std::size_t GIDI::Transporting::Flux::size ( ) const
inline

Returns the number of stored Legendre orders.

Definition at line 3583 of file GIDI.hpp.

Referenced by print(), and process().

◆ temperature()

double GIDI::Transporting::Flux::temperature ( ) const
inline

Returns the value of the m_temperature member.

Definition at line 3586 of file GIDI.hpp.

Referenced by GIDI::Transporting::Particle::appendFlux(), Flux(), and process().


The documentation for this class was generated from the following files: