Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI_fissionEnergyReleased.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#include <HAPI.hpp>
12
13namespace GIDI {
14
15namespace Functions {
16
17/*! \class FissionEnergyRelease
18 * Class to store GNDS <**fissionEnergyRelease**> node.
19 */
20
21/* *********************************************************************************************************//**
22 * @param a_construction [in] Used to pass user options for parsing.
23 * @param a_node [in] The HAPI::Node to be parsed to construct the instance.
24 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
25 * @param a_parent [in] The parent GIDI::Suite.
26 ***********************************************************************************************************/
27
28FissionEnergyRelease::FissionEnergyRelease( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *a_parent ) :
29 Function1dForm( a_construction, a_node, a_setupInfo, FormType::fissionEnergyRelease1d, a_parent ) {
30
31 m_promptProductKE = data1dParse( a_construction, a_node.child( GIDI_promptProductKEChars ).first_child( ), a_setupInfo, nullptr );
32 m_promptNeutronKE = data1dParse( a_construction, a_node.child( GIDI_promptNeutronKEChars ).first_child( ), a_setupInfo, nullptr );
33 m_delayedNeutronKE = data1dParse( a_construction, a_node.child( GIDI_delayedNeutronKEChars ).first_child( ), a_setupInfo, nullptr );
34 m_promptGammaEnergy = data1dParse( a_construction, a_node.child( GIDI_promptGammaEnergyChars ).first_child( ), a_setupInfo, nullptr );
35 m_delayedGammaEnergy = data1dParse( a_construction, a_node.child( GIDI_delayedGammaEnergyChars ).first_child( ), a_setupInfo, nullptr );
36 m_delayedBetaEnergy = data1dParse( a_construction, a_node.child( GIDI_delayedBetaEnergyChars ).first_child( ), a_setupInfo, nullptr );
37 m_neutrinoEnergy = data1dParse( a_construction, a_node.child( GIDI_neutrinoEnergyChars ).first_child( ), a_setupInfo, nullptr );
38 m_nonNeutrinoEnergy = data1dParse( a_construction, a_node.child( GIDI_nonNeutrinoEnergyChars ).first_child( ), a_setupInfo, nullptr );
39 m_totalEnergy = data1dParse( a_construction, a_node.child( GIDI_totalEnergyChars ).first_child( ), a_setupInfo, nullptr );
40}
41
42/* *********************************************************************************************************//**
43 ***********************************************************************************************************/
44
46
47 if( m_promptProductKE != nullptr ) delete m_promptProductKE;
48 if( m_promptNeutronKE != nullptr ) delete m_promptNeutronKE;
49 if( m_delayedNeutronKE != nullptr ) delete m_delayedNeutronKE;
50 if( m_promptGammaEnergy != nullptr ) delete m_promptGammaEnergy;
51 if( m_delayedGammaEnergy != nullptr ) delete m_delayedGammaEnergy;
52 if( m_delayedBetaEnergy != nullptr ) delete m_delayedBetaEnergy;
53 if( m_neutrinoEnergy != nullptr ) delete m_neutrinoEnergy;
54 if( m_nonNeutrinoEnergy != nullptr ) delete m_nonNeutrinoEnergy;
55 if( m_totalEnergy != nullptr ) delete m_totalEnergy;
56}
57
58/* *********************************************************************************************************//**
59 * Returns the multi-group Q-value.
60 *
61 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
62 * @param a_settings [in] Specifies the requested label.
63 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
64 *
65 * @return Multi-group Q-value.
66 ***********************************************************************************************************/
67
69
70 Vector vector( 0 );
71
73 Gridded1d const *gridded1d = dynamic_cast<Gridded1d const *>( m_delayedNeutronKE );
74
75 if( gridded1d != nullptr ) vector += gridded1d->data( );
76
77 gridded1d = dynamic_cast<Gridded1d const *>( m_delayedGammaEnergy );
78 if( gridded1d != nullptr ) vector += gridded1d->data( );
79
80 gridded1d = dynamic_cast<Gridded1d const *>( m_delayedBetaEnergy );
81 if( gridded1d != nullptr ) vector += gridded1d->data( );
82 }
83
84 return( vector );
85}
86
87/* *********************************************************************************************************//**
88 * Fills the argument *a_writeInfo* with the XML lines that represent *this*. Recursively enters each sub-node.
89 *
90 * @param a_writeInfo [in/out] Instance containing incremental indentation and other information and stores the appended lines.
91 * @param a_indent [in] The amount to indent *this* node.
92 ***********************************************************************************************************/
93
94void FissionEnergyRelease::toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent ) const {
95
96 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
97
98 a_writeInfo.addNodeStarter( a_indent, moniker( ), a_writeInfo.addAttribute( GIDI_labelChars, label( ) ) );
99
100 energyReleaseToXMLList( a_writeInfo, GIDI_promptProductKEChars, indent2, m_promptProductKE );
101 energyReleaseToXMLList( a_writeInfo, GIDI_promptNeutronKEChars, indent2, m_promptNeutronKE );
102 energyReleaseToXMLList( a_writeInfo, GIDI_delayedNeutronKEChars, indent2, m_delayedNeutronKE );
103 energyReleaseToXMLList( a_writeInfo, GIDI_promptGammaEnergyChars, indent2, m_promptGammaEnergy );
104 energyReleaseToXMLList( a_writeInfo, GIDI_delayedGammaEnergyChars, indent2, m_delayedGammaEnergy );
105 energyReleaseToXMLList( a_writeInfo, GIDI_delayedBetaEnergyChars, indent2, m_delayedBetaEnergy );
106 energyReleaseToXMLList( a_writeInfo, GIDI_neutrinoEnergyChars, indent2, m_neutrinoEnergy );
107 energyReleaseToXMLList( a_writeInfo, GIDI_nonNeutrinoEnergyChars, indent2, m_nonNeutrinoEnergy );
108 energyReleaseToXMLList( a_writeInfo, GIDI_totalEnergyChars, indent2, m_totalEnergy );
109
110 a_writeInfo.addNodeEnder( moniker( ) );
111}
112
113/* *********************************************************************************************************//**
114 * Fills the argument *a_writeInfo* with the XML lines that represent *this*. Recursively enters each sub-node.
115 *
116 * @param a_writeInfo [in/out] Instance containing incremental indentation and other information and stores the appended lines.
117 * @param a_moniker [in] The moniker for the energy type.
118 * @param a_indent [in] The amount to indent *this* node.
119 * @param a_function [in] The component of the energy released in fission.
120 ***********************************************************************************************************/
121
122void FissionEnergyRelease::energyReleaseToXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_moniker, std::string const &a_indent, Function1dForm *a_function ) const {
123
124 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
125
126 if( a_function == nullptr ) return;
127
128 a_writeInfo.addNodeStarter( a_indent, a_moniker, "" );
129 a_function->toXMLList( a_writeInfo, indent2 );
130 a_writeInfo.addNodeEnder( a_moniker );
131}
132
133} // End namespace Functions.
134
135} // End namespace GIDI.
#define GIDI_promptGammaEnergyChars
Definition GIDI.hpp:402
#define GIDI_totalEnergyChars
Definition GIDI.hpp:407
#define GIDI_promptNeutronKEChars
Definition GIDI.hpp:400
#define GIDI_delayedNeutronKEChars
Definition GIDI.hpp:401
#define GIDI_neutrinoEnergyChars
Definition GIDI.hpp:405
#define GIDI_delayedGammaEnergyChars
Definition GIDI.hpp:403
#define GIDI_nonNeutrinoEnergyChars
Definition GIDI.hpp:406
#define GIDI_labelChars
Definition GIDI.hpp:438
#define GIDI_promptProductKEChars
Definition GIDI.hpp:399
#define GIDI_delayedBetaEnergyChars
Definition GIDI.hpp:404
#define LUPI_maybeUnused
std::string const & label() const
Definition GIDI.hpp:658
Vector multiGroupQ(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo) const
void toXMLList(GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
FissionEnergyRelease(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *a_parent)
Function1dForm(std::string const &a_moniker, FormType a_type, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
Definition GIDI_form.cc:348
void toXMLList(GUPI::WriteInfo &a_writeInfo, std::string const &a_indent) const
Definition GIDI.hpp:1023
DelayedNeutrons delayedNeutrons() const
Definition GIDI.hpp:3727
std::vector< double > & data()
Definition GIDI_data.hpp:81
std::string const & moniker() const
Definition GUPI.hpp:102
void addNodeEnder(std::string const &a_moniker)
Definition GUPI.hpp:59
std::string incrementalIndent(std::string const &indent)
Definition GUPI.hpp:52
void addNodeStarter(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:55
std::string addAttribute(std::string const &a_name, std::string const &a_value) const
Definition GUPI.hpp:60
Node first_child() const
Definition HAPI_Node.cc:82
Node child(const char *name) const
Definition HAPI_Node.cc:72
Definition GIDI.hpp:32
Functions::Function1dForm * data1dParse(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *parent)
FormType
Definition GIDI.hpp:118
@ fissionEnergyRelease1d
Definition GIDI.hpp:125