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

#include <GIDI.hpp>

Inheritance diagram for GIDI::Grid:

Public Member Functions

 Grid (HAPI::Node const &a_node, SetupInfo &a_setupInfo, int a_useSystem_strtod)
 Grid (Grid const &a_grid)
std::size_t size () const
double & operator[] (std::size_t a_index) noexcept
std::string const & style () const
std::string keyName () const
std::string keyValue () const
std::string valueType () const
std::string const & interpolation () const
nf_Buffer< double > const & values () const
nf_Buffer< double > const & data () const
void toXMLList (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
Public Member Functions inherited from GIDI::Axis
 Axis (HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type=FormType::axis)
 Axis (int a_index, std::string const &a_label, std::string const &a_unit, FormType a_type=FormType::axis)
 Axis (Axis const &a_axis)
virtual ~Axis ()
int index () const
std::string const & unit () const
std::string const & href () 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 GNDS grid node.

Definition at line 825 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Grid() [1/2]

GIDI::Grid::Grid ( 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 Grid.
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 26 of file GIDI_grid.cc.

26 :
27 Axis( a_node, a_setupInfo, FormType::grid ),
28 m_style( a_node.attribute_as_string( GIDI_styleChars ) ),
29 m_keyName( GIDI_indexChars ),
30 m_keyValue( a_node.attribute_as_string( GIDI_indexChars ) ),
31 m_interpolation( a_node.attribute_as_string( GIDI_interpolationChars ) ) {
32
33 if( href( ) == "" ) {
34 HAPI::Node values = a_node.first_child( );
35 if( values.name( ) != std::string( GIDI_valuesChars ) ) throw Exception( "grid's first child not values" );
36
37 m_valueType = values.attribute_as_string( GIDI_valueTypeChars );
38
39 parseValuesOfDoubles( values, a_setupInfo, m_values, a_useSystem_strtod );
40 }
41}
#define GIDI_valuesChars
Definition GIDI.hpp:260
#define GIDI_styleChars
Definition GIDI.hpp:451
#define GIDI_interpolationChars
Definition GIDI.hpp:434
#define GIDI_indexChars
Definition GIDI.hpp:437
#define GIDI_valueTypeChars
Definition GIDI.hpp:431
std::string const & href() const
Definition GIDI.hpp:815
Axis(HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type=FormType::axis)
Definition GIDI_axis.cc:42
nf_Buffer< double > const & values() const
Definition GIDI.hpp:849
void parseValuesOfDoubles(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, nf_Buffer< double > &a_vector)
Definition GIDI_misc.cc:88

Referenced by Grid().

◆ Grid() [2/2]

GIDI::Grid::Grid ( Grid const & a_grid)

Copy constructor for Grid.

Parameters
a_grid[in] The Grid instance to copy.

Definition at line 49 of file GIDI_grid.cc.

49 :
50 Axis( a_grid ),
51 m_style( a_grid.style( ) ),
52 m_keyName( a_grid.keyName( ) ),
53 m_keyValue( a_grid.keyValue( ) ),
54 m_valueType( a_grid.valueType( ) ),
55 m_values( a_grid.values( ) ) {
56
57}

Member Function Documentation

◆ data()

nf_Buffer< double > const & GIDI::Grid::data ( ) const
inline

Returns the value of the m_values member.

Definition at line 850 of file GIDI.hpp.

◆ interpolation()

std::string const & GIDI::Grid::interpolation ( ) const
inline

Definition at line 847 of file GIDI.hpp.

847{ return( m_interpolation ); }

◆ keyName()

std::string GIDI::Grid::keyName ( ) const
inline

Returns the value of the m_keyName member.

Definition at line 843 of file GIDI.hpp.

Referenced by Grid().

◆ keyValue()

std::string GIDI::Grid::keyValue ( ) const
inline

Returns the value of the m_keyValue member.

Definition at line 844 of file GIDI.hpp.

Referenced by Grid().

◆ operator[]()

double & GIDI::Grid::operator[] ( std::size_t a_index)
inlinenoexcept

Returns the value at m_values[a_index].

Definition at line 840 of file GIDI.hpp.

◆ size()

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

Returns the number of values in the m_values member.

Definition at line 839 of file GIDI.hpp.

◆ style()

std::string const & GIDI::Grid::style ( ) const
inline

Returns the value of the m_style member.

Definition at line 842 of file GIDI.hpp.

Referenced by Grid(), and toXMLList().

◆ toXMLList()

void GIDI::Grid::toXMLList ( GUPI::WriteInfo & a_writeInfo,
std::string const & a_indent = "" ) const
virtual

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 GIDI::Axis.

Definition at line 66 of file GIDI_grid.cc.

66 {
67
68 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
69 std::string attributes = a_writeInfo.addAttribute( GIDI_indexChars, intToString( index( ) ) );
70
71 if( href( ) == "" ) {
72 attributes += a_writeInfo.addAttribute( GIDI_labelChars, label( ) );
73 attributes += a_writeInfo.addAttribute( GIDI_unitChars, unit( ) );
74 attributes += a_writeInfo.addAttribute( GIDI_styleChars, style( ) );
75 a_writeInfo.addNodeStarter( a_indent, moniker( ), attributes );
76 doublesToXMLList( a_writeInfo, indent2, m_values.vector(), 0, true, m_valueType );
77 a_writeInfo.addNodeEnder( moniker( ) ); }
78 else {
79 attributes += a_writeInfo.addAttribute( GIDI_hrefChars, href( ) );
80 a_writeInfo.addNodeStarterEnder( a_indent, moniker( ), attributes );
81 }
82}
#define GIDI_hrefChars
Definition GIDI.hpp:440
#define GIDI_unitChars
Definition GIDI.hpp:439
#define GIDI_labelChars
Definition GIDI.hpp:438
std::string const & unit() const
Definition GIDI.hpp:813
int index() const
Definition GIDI.hpp:812
std::string const & label() const
Definition GIDI.hpp:658
std::string const & style() const
Definition GIDI.hpp:842
std::string const & moniker() const
Definition GUPI.hpp:102
void addNodeStarterEnder(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:57
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
void doublesToXMLList(GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, std::vector< double > const &a_values, std::size_t a_start=0, bool a_newLine=true, std::string const &a_valueType="")
Definition GIDI_misc.cc:180
std::string intToString(int a_value)
Definition GIDI_misc.cc:415

◆ values()

nf_Buffer< double > const & GIDI::Grid::values ( ) const
inline

Returns the value of the m_values member.

Definition at line 849 of file GIDI.hpp.

Referenced by Grid(), Grid(), GIDI::Reaction::modifyCrossSection(), and GIDI::ProtareTNSL::TNSL_crossSectionSumCorrection().

◆ valueType()

std::string GIDI::Grid::valueType ( ) const
inline

Returns the value of the m_valueType member.

Definition at line 845 of file GIDI.hpp.

Referenced by Grid().


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