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

#include <GIDI.hpp>

Inheritance diagram for GIDI::Axes:

Public Member Functions

 Axes ()
 Axes (HAPI::Node const &a_node, SetupInfo &a_setupInfo, int a_useSystem_strtod)
 Axes (Axes const &a_axes)
 ~Axes ()
Axesoperator= (Axes const &a_rhs)
std::size_t size () const
Axis const * operator[] (std::size_t a_index) const
std::size_t dimension () const
void append (Axis *a_axis)
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

Static Public Member Functions

static Axes makeAxes (std::vector< std::pair< std::string, std::string > > const &a_labelsAndUnits)
Static Public Member Functions inherited from GUPI::Ancestry
static std::string buildXLinkItemKey (std::string const &a_name, std::string const &a_key)

Detailed Description

Represents a GNDS axes node. An axes is a list of Axis and/or Grid nodes. An axes contains a list of N independent axis and/or grid nodes, and a dependent axis node. The dimension of an axes is the number of independent nodes.

Definition at line 860 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Axes() [1/3]

GIDI::Axes::Axes ( )

Definition at line 23 of file GIDI_axes.cc.

23 :
25
27}
#define GIDI_axesChars
Definition GIDI.hpp:382
Form(FormType a_type)
Definition GIDI_form.cc:25
void setMoniker(std::string const &a_moniker)
Definition GUPI.hpp:103

Referenced by Axes(), makeAxes(), and operator=().

◆ Axes() [2/3]

GIDI::Axes::Axes ( 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 Axes.
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 36 of file GIDI_axes.cc.

36 :
37 Form( a_node, a_setupInfo, FormType::axes ) {
38
39 for( HAPI::Node child = a_node.first_child( ); !child.empty( ); child.to_next_sibling( ) ) {
40 std::string name( child.name( ) );
41
42 if( name == GIDI_axisChars ) {
43 m_axes.push_back( new Axis( child, a_setupInfo ) ); }
44 else if( name == GIDI_gridChars ) {
45 m_axes.push_back( new Grid( child, a_setupInfo, a_useSystem_strtod ) ); }
46 else {
47 throw Exception( "unknown axes sub-element" );
48 }
49 }
50}
#define GIDI_gridChars
Definition GIDI.hpp:384
#define GIDI_axisChars
Definition GIDI.hpp:383
const char * name(G4int ptype)

◆ Axes() [3/3]

GIDI::Axes::Axes ( Axes const & a_axes)

Copy constructor for the Axes class.

Parameters
a_axes[in] The Axes instance to copy.

Definition at line 58 of file GIDI_axes.cc.

58 :
59 Form( a_axes ) {
60
61 for( std::size_t i1 = 0; i1 < a_axes.size( ); ++i1 ) {
62 Axis const *axis = a_axes[i1];
63
64 if( axis->type( ) == FormType::axis ) {
65 m_axes.push_back( new Axis( *axis ) ); }
66 else {
67 m_axes.push_back( new Grid( static_cast<Grid const &>( *axis ) ) );
68 }
69 }
70}
const axis_t axis_to_type< N >::axis
Definition pugixml.cc:9668

◆ ~Axes()

GIDI::Axes::~Axes ( )

Definition at line 75 of file GIDI_axes.cc.

75 {
76
77 for( std::size_t i1 = 0; i1 < m_axes.size( ); ++i1 ) delete m_axes[i1];
78}

Member Function Documentation

◆ append()

void GIDI::Axes::append ( Axis * a_axis)
inline

Appends a_axis to the* list of Axis nodes.

Definition at line 876 of file GIDI.hpp.

Referenced by GIDI::Transporting::Fluxes_from_bdfls::get3dViaFID().

◆ dimension()

std::size_t GIDI::Axes::dimension ( ) const
inline

Returns the dimension of the instance.

Definition at line 874 of file GIDI.hpp.

◆ makeAxes()

Axes GIDI::Axes::makeAxes ( std::vector< std::pair< std::string, std::string > > const & a_labelsAndUnits)
static

This is a factory function for the Axes class that creates an Axes instance whose axis data are taken from the a_labelsAndUnits argument. The number of Axis instances created is the size() of a_labelsAndUnits. Each item of a_labelsAndUnits specifies the label and unit for an Axis instance.

Parameters
a_labelsAndUnits[in] The list of labels and units for each axis.

Definition at line 132 of file GIDI_axes.cc.

132 {
133
134 int index = 0;
135 Axes axes = Axes( );
136
137 for( auto labelAndUnit = a_labelsAndUnits.begin( ); labelAndUnit != a_labelsAndUnits.end( ); ++labelAndUnit, ++index ) {
138 axes.append( new Axis( index, labelAndUnit->first, labelAndUnit->second ) );
139 }
140
141 return( axes );
142}

◆ operator=()

Axes & GIDI::Axes::operator= ( Axes const & a_rhs)

The assignment operator. This method sets the members of this to those of a_rhs except for those not set by base classes.

Parameters
a_rhs[in] Instance whose member are used to set the members of this.

Definition at line 87 of file GIDI_axes.cc.

87 {
88
89 if( this != &a_rhs ) {
90 Form::operator=( a_rhs );
91
92 for( std::size_t index = 0; index < a_rhs.size( ); ++index ) {
93 auto axis = a_rhs[index];
94 if( axis->type( ) == FormType::axis ) {
95 m_axes.push_back( new Axis( *axis ) ); }
96 else {
97 Grid const *grid = static_cast<Grid const *>( axis );
98 m_axes.push_back( new Grid( *grid ) );
99 }
100 }
101 }
102
103 return( *this );
104}
Form & operator=(Form const &a_rhs)
Definition GIDI_form.cc:93

◆ operator[]()

Axis const * GIDI::Axes::operator[] ( std::size_t a_index) const
inline

Returns m_axes[a_index].

Definition at line 873 of file GIDI.hpp.

◆ size()

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

Returns the number of Axis instances in this.

Definition at line 872 of file GIDI.hpp.

Referenced by Axes(), and operator=().

◆ toXMLList()

void GIDI::Axes::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 GUPI::Ancestry.

Definition at line 113 of file GIDI_axes.cc.

113 {
114
115 if( m_axes.size( ) == 0 ) return;
116
117 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
118
119 a_writeInfo.addNodeStarter( a_indent, moniker( ), "" );
120 for( std::vector<Axis *>::const_iterator iter = m_axes.begin( ); iter != m_axes.end( ); ++iter ) (*iter)->toXMLList( a_writeInfo, indent2 );
121 a_writeInfo.addNodeEnder( moniker( ) );
122}
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

Referenced by GIDI::Functions::Gridded2d::toXMLList(), GIDI::Functions::Gridded3d::toXMLList(), GIDI::Functions::Constant1d::toXMLList_func(), GIDI::Functions::DiscreteGamma2d::toXMLList_func(), GIDI::Functions::Gridded1d::toXMLList_func(), GIDI::Functions::Legendre1d::toXMLList_func(), GIDI::Functions::Polynomial1d::toXMLList_func(), GIDI::Functions::PrimaryGamma2d::toXMLList_func(), GIDI::Functions::Regions1d::toXMLList_func(), GIDI::Functions::Regions2d::toXMLList_func(), GIDI::Functions::Unspecified1d::toXMLList_func(), GIDI::Functions::XYs1d::toXMLList_func(), GIDI::Functions::XYs3d::toXMLList_func(), and GIDI::Functions::Ys1d::toXMLList_func().


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