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

#include <GIDI.hpp>

Inheritance diagram for GIDI::Array3d:

Public Member Functions

 Array3d (HAPI::Node const &a_node, SetupInfo &a_setupInfo, int a_useSystem_strtod)
 ~Array3d ()
std::size_t size () const
Matrix matrix (std::size_t a_index) const
void modifiedMultiGroupElasticForTNSL (std::size_t maxTNSL_index)
void toXMLList (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent) const
Public Member Functions inherited from GIDI::Form
 Form (FormType a_type)
 Form (std::string const &a_moniker, FormType a_type, std::string const &a_label)
 Form (HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, Suite *a_suite=nullptr)
 Form (Form const &a_form)
virtual ~Form ()
Formoperator= (Form const &a_rhs)
Suiteparent () const
std::string const & label () const
void setLabel (std::string const &a_label)
virtual std::string actualMoniker () const
std::string const & keyName () const
void setKeyName (std::string const &a_keyName)
std::string const & keyValue () const
virtual void setKeyValue (std::string const &a_keyName) const
FormType type () const
Form const * sibling (std::string a_label) const
GUPI::AncestryfindInAncestry3 (LUPI_maybeUnused std::string const &a_item)
GUPI::Ancestry const * findInAncestry3 (LUPI_maybeUnused std::string const &a_item) const
std::string xlinkItemKey () const
Public Member Functions inherited from GUPI::Ancestry
 Ancestry (std::string const &a_moniker, std::string const &a_attribute="")
virtual ~Ancestry ()
Ancestryoperator= (Ancestry const &a_ancestry)
std::string const & moniker () const
void setMoniker (std::string const &a_moniker)
Ancestryancestor ()
Ancestry const * ancestor () const
void setAncestor (Ancestry *a_ancestor)
std::string attribute () const
Ancestryroot ()
Ancestry const * root () const
bool isChild (Ancestry *a_instance)
bool isParent (Ancestry *a_parent)
bool isRoot () const
AncestryfindInAncestry (std::string const &a_href)
Ancestry const * findInAncestry (std::string const &a_href) const
virtual AncestryfindInAncestry3 (std::string const &a_item)=0
virtual Ancestry const * findInAncestry3 (std::string const &a_item) const =0
virtual LUPI_HOST void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
std::string toXLink () const
void printXML () const

Additional Inherited Members

Static Public Member Functions inherited from GUPI::Ancestry
static std::string buildXLinkItemKey (std::string const &a_name, std::string const &a_key)

Detailed Description

Class to store a 3d array.

Definition at line 965 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Array3d()

GIDI::Array3d::Array3d ( HAPI::Node const & a_node,
SetupInfo & a_setupInfo,
int a_useSystem_strtod )
Parameters
a_node[in] The HAPI::Node to be parsed and used to construct the Array3d.
a_setupInfo[in] Information create my the Protare constructor to help in parsing.
a_useSystem_strtod[in] Flag passed to the function nfu_stringToListOfDoubles.

Definition at line 29 of file GIDI_array3d.cc.

29 :
30 Form( a_node, a_setupInfo, FormType::array3d ),
31 m_array( a_node, a_setupInfo, 3, a_useSystem_strtod ) {
32
33}
Form(FormType a_type)
Definition GIDI_form.cc:25

◆ ~Array3d()

GIDI::Array3d::~Array3d ( )

Definition at line 38 of file GIDI_array3d.cc.

38 {
39
40}

Member Function Documentation

◆ matrix()

Matrix GIDI::Array3d::matrix ( std::size_t a_index) const

Returns the matrix that represents the specified 3rd dimension. That is the matrix M[i][j] for all i, j of A2d[i][j][a_index]. This is mainly used for multi-group, Legendre expanded transfer matrices where a specific Legendre order is requested. This is, the matrix represent the energy_in as rows and the energy_outp as columns for a specific Legendre order.

Parameters
a_index[in] The requested index for the 3rd dimension.

Definition at line 66 of file GIDI_array3d.cc.

66 {
67
68 if( size( ) <= a_index ) {
69 Matrix matrix( 0, 0 );
70 return( matrix );
71 }
72
73 std::size_t numberOfOrders = static_cast<std::size_t>( m_array.m_shape[2] );
74 std::size_t rows = static_cast<std::size_t>( m_array.m_shape[0] );
75 std::size_t columns = static_cast<std::size_t>( m_array.m_shape[1] );
76 Matrix matrix( rows, columns );
77
78 std::size_t lengthSum = 0;
79 for( std::size_t i1 = 0; i1 < m_array.m_numberOfStarts; ++i1 ) {
80 std::size_t start = static_cast<std::size_t>( m_array.m_starts[i1] );
81 std::size_t length = static_cast<std::size_t>( m_array.m_lengths[i1] );
82
83 std::size_t energyInIndex = start / ( numberOfOrders * columns );
84 std::size_t energyOutIndex = start % ( numberOfOrders * columns );
85 std::size_t orderIndex = energyOutIndex % numberOfOrders;
86 energyOutIndex /= numberOfOrders;
87
88 std::size_t step = a_index - orderIndex;
89 if( orderIndex > a_index ) {
90 ++energyOutIndex;
91 if( energyOutIndex >= columns ) {
92 energyOutIndex = 0;
93 ++energyInIndex;
94 }
95 step += numberOfOrders;
96 }
97 std::size_t dataIndex = lengthSum + step;
98 for( ; step < length; step += numberOfOrders ) {
99 matrix.set( energyInIndex, energyOutIndex, m_array.m_dValues[dataIndex] );
100 ++energyOutIndex;
101 if( energyOutIndex >= columns ) {
102 energyOutIndex = 0;
103 ++energyInIndex;
104 }
105 dataIndex += numberOfOrders;
106 }
107 lengthSum += length;
108 }
109
110 return( matrix );
111}
std::size_t size() const
Definition GIDI.hpp:974
Matrix matrix(std::size_t a_index) const

Referenced by matrix(), and GIDI::Product::multiGroupProductMatrix().

◆ modifiedMultiGroupElasticForTNSL()

void GIDI::Array3d::modifiedMultiGroupElasticForTNSL ( std::size_t a_maxTNSL_index)

Only for internal use. Called by ProtareTNSL instance to zero the lower energy multi-group data covered by the ProtareSingle that contains the TNSL data covers the lower energy multi-group data.

Parameters
a_maxTNSL_index[in] All elements up to "row" a_maxTNSL_index exclusive are zero-ed.

Definition at line 49 of file GIDI_array3d.cc.

49 {
50
51 auto const &m_shape = m_array.shape( );
52 std::size_t maxFlatIndex = a_maxTNSL_index * m_shape[1] * m_shape[2];
53
54 m_array.setToValueInFlatRange( 0, maxFlatIndex, 0.0 );
55}

◆ size()

std::size_t GIDI::Array3d::size ( ) const
inline

The length of the 3d diminsion.

Definition at line 974 of file GIDI.hpp.

Referenced by matrix(), and GIDI::Product::maximumLegendreOrder().

◆ toXMLList()

void GIDI::Array3d::toXMLList ( GUPI::WriteInfo & a_writeInfo,
std::string const & a_indent ) const
inlinevirtual

Fills the argument a_writeInfo with the XML lines that represent this. Recursively enters each sub-node.

Parameters
a_writeInfo[in/out] Instance containing incremental indentation and other information and stores the appended lines.
a_indent[in] The amount to indent this node.

Reimplemented from GUPI::Ancestry.

Definition at line 979 of file GIDI.hpp.

979{ m_array.toXMLList( a_writeInfo, a_indent ); }

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