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

#include <GIDI.hpp>

Inheritance diagram for GIDI::Functions::Legendre1d:

Public Member Functions

 Legendre1d (Axes const &a_axes, int a_index=0, double a_outerDomainValue=0.0)
 Legendre1d (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *a_parent)
 Legendre1d (Legendre1d const &a_Legendre1d)
 ~Legendre1d ()
double domainMin () const
double domainMax () const
std::vector< double > const & coefficients () const
std::vector< double > & coefficients ()
double evaluate (double a_x1) const
XYs1dasXYs1d (bool a_asLinlin, double a_accuray, double a_lowerEps, double a_upperEps) const
void toXMLList_func (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, bool a_embedded, bool a_inRegions) const
Public Member Functions inherited from GIDI::Functions::Function1dForm
 Function1dForm (std::string const &a_moniker, FormType a_type, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
 Function1dForm (std::string const &a_moniker, FormType a_type, Axes const &a_axes, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
 Function1dForm (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, Suite *a_suite=nullptr)
 Function1dForm (Function1dForm const &a_form)
 ~Function1dForm ()
Function1dFormoperator= (Function1dForm const &a_rhs)
virtual void mapToXsAndAdd (std::size_t a_offset, std::vector< double > const &a_Xs, std::vector< double > &a_results, double a_scaleFactor) const
virtual void write (FILE *a_file, std::string const &a_format) const
void print (std::string const &a_format) const
Public Member Functions inherited from GIDI::Functions::FunctionForm
 FunctionForm (std::string const &a_moniker, FormType a_type, int a_dimension, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
 FunctionForm (std::string const &a_moniker, FormType a_type, int a_dimension, Axes const &a_axes, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
 FunctionForm (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, int a_dimension, Suite *a_suite=nullptr)
 FunctionForm (FunctionForm const &a_form)
 ~FunctionForm ()
FunctionFormoperator= (FunctionForm const &a_rhs)
int dimension () const
int index () const
double outerDomainValue () const
void setOuterDomainValue (double a_outerDomainValue)
Axes const & axes () const
Axesaxes ()
ptwXY_interpolation interpolation () const
void setInterpolation (ptwXY_interpolation a_interpolation)
std::string interpolationString () const
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 for the GNDS <Legendre> node.

Definition at line 1211 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Legendre1d() [1/3]

GIDI::Functions::Legendre1d::Legendre1d ( Axes const & a_axes,
int a_index = 0,
double a_outerDomainValue = 0.0 )
Parameters
a_axes[in] The axes to copy for this.
a_index[in] Currently not used.
a_outerDomainValue[in] If embedded in a higher dimensional function, the value of the domain of the next higher dimension.

Definition at line 30 of file GIDI_Legendre1d.cc.

30 :
32
33}
#define GIDI_LegendreChars
Definition GIDI.hpp:291
Function1dForm(std::string const &a_moniker, FormType a_type, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
Definition GIDI_form.cc:348
@ ptwXY_interpolationLinLin
Definition ptwXY.h:37

Referenced by Legendre1d(), Legendre1d(), and Legendre1d().

◆ Legendre1d() [2/3]

GIDI::Functions::Legendre1d::Legendre1d ( Construction::Settings const & a_construction,
HAPI::Node const & a_node,
SetupInfo & a_setupInfo,
Suite * a_parent )
Parameters
a_construction[in] Used to pass user options for parsing.
a_node[in] The HAPI::Node to be parsed and used to construct the XYs2d.
a_setupInfo[in] Information create my the Protare constructor to help in parsing.
a_parent[in] The parent GIDI::Suite.

Definition at line 43 of file GIDI_Legendre1d.cc.

43 :
44 Function1dForm( a_construction, a_node, a_setupInfo, FormType::Legendre1d, a_parent ) {
45
46 nf_Buffer<double> coeff;
47 parseValuesOfDoubles( a_construction, a_node.child( GIDI_valuesChars ), a_setupInfo, coeff );
48 m_coefficients = coeff.vector();
49}
#define GIDI_valuesChars
Definition GIDI.hpp:260
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

◆ Legendre1d() [3/3]

GIDI::Functions::Legendre1d::Legendre1d ( Legendre1d const & a_Legendre1d)

The Legendre1d copy constructor.

Parameters
a_Legendre1d[in] The Legendre1d instance to copy.

Definition at line 57 of file GIDI_Legendre1d.cc.

57 :
59 m_coefficients( a_Legendre1d.coefficients( ) ) {
60
61}

◆ ~Legendre1d()

GIDI::Functions::Legendre1d::~Legendre1d ( )

Definition at line 66 of file GIDI_Legendre1d.cc.

66 {
67
68}

Member Function Documentation

◆ asXYs1d()

XYs1d * GIDI::Functions::Legendre1d::asXYs1d ( bool a_asLinlin,
double a_accuray,
double a_lowerEps,
double a_upperEps ) const
virtual

This methods returns an XYs1d representation of this. The calling function owns the created instance and is responible for freeing it.

Parameters
a_asLinlin[in] This argument is not used but retained to make the methods API at same as other asXYs1d functions.
a_accuracy[in] The accuracy use to convert the data to lin=lin interpolation if needed. This argument is not needed or used for this cl
a_lowerEps[in] This argument is not used but retained to make the methods API at same as other asXYs1d functions.
a_upperEps[in] This argument is not used but retained to make the methods API at same as other asXYs1d functions.
Returns
A pointer to an XYs1d instance that must be freed by the calling function.

Reimplemented from GIDI::Functions::Function1dForm.

Definition at line 95 of file GIDI_Legendre1d.cc.

95 {
96
97 int size1 = static_cast<int>( m_coefficients.size( ) );
98 nf_Legendre *legendre1 = nf_Legendre_new( nullptr, 0, size1 - 1, const_cast<double *>( m_coefficients.data( ) ) );
99 if( legendre1 == nullptr ) return( nullptr );
100
101 ptwXYPoints *xys = nf_Legendre_to_ptwXY( nullptr, legendre1, a_accuracy, 12, 1 );
102 nf_Legendre_free( legendre1 );
103 if( xys == nullptr ) return( nullptr );
104
105 return( new XYs1d( axes( ), xys ) );
106}
Axes const & axes() const
Definition GIDI.hpp:1012
nf_Legendre * nf_Legendre_new(statusMessageReporting *smr, int initialSize, int maxOrder, double *Cls)
Definition nf_Legendre.c:22
nf_Legendre * nf_Legendre_free(nf_Legendre *nfL)
Definition nf_Legendre.c:64
ptwXYPoints * nf_Legendre_to_ptwXY(statusMessageReporting *smr, nf_Legendre *nfL, double accuracy, int biSectionMax, int checkForRoots)
struct nf_Legendre_s nf_Legendre
Definition nf_Legendre.h:24
struct ptwXYPoints_s ptwXYPoints

◆ coefficients() [1/2]

std::vector< double > & GIDI::Functions::Legendre1d::coefficients ( )
inline

Returns the value of the m_coefficients member.

Definition at line 1226 of file GIDI.hpp.

◆ coefficients() [2/2]

std::vector< double > const & GIDI::Functions::Legendre1d::coefficients ( ) const
inline

Returns the value of the m_coefficients member.

Definition at line 1225 of file GIDI.hpp.

Referenced by GIDI::Transporting::Fluxes_from_bdfls::get3dViaFID(), Legendre1d(), and GIDI::settingsFluxesFromFunction3d().

◆ domainMax()

double GIDI::Functions::Legendre1d::domainMax ( ) const
inlinevirtual

Returns the value of the domainMax which is always 1.0.

Implements GIDI::Functions::FunctionForm.

Definition at line 1223 of file GIDI.hpp.

◆ domainMin()

double GIDI::Functions::Legendre1d::domainMin ( ) const
inlinevirtual

Returns the value of the domainMin which is always -1.0.

Implements GIDI::Functions::FunctionForm.

Definition at line 1222 of file GIDI.hpp.

◆ evaluate()

double GIDI::Functions::Legendre1d::evaluate ( double a_x1) const
virtual

Returns the value of the function evaluated at the specified projectile's energy. Currently not implemented.

Parameters
a_x1[in] The projectile's energy.
Returns
The value of the function evaluated at a_x1.

Implements GIDI::Functions::Function1dForm.

Definition at line 78 of file GIDI_Legendre1d.cc.

78 {
79
80 throw Exception( "Legendre1d::evaluate: not implemented." );
81}

◆ toXMLList_func()

void GIDI::Functions::Legendre1d::toXMLList_func ( GUPI::WriteInfo & a_writeInfo,
std::string const & a_indent,
bool a_embedded,
bool a_inRegions ) 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.
a_embedded[in] If true, this function is embedded in a higher dimensional function.
a_inRegions[in] If true, this is in a Regions1d container.

Reimplemented from GIDI::Functions::FunctionForm.

Definition at line 117 of file GIDI_Legendre1d.cc.

117 {
118
119 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
120 std::string attributes;
121
122 if( a_embedded ) {
124 else {
125 if( a_inRegions ) {
126 attributes = a_writeInfo.addAttribute( GIDI_indexChars, intToString( index( ) ) ); }
127 else {
128 if( keyValue( ) != "" ) attributes = a_writeInfo.addAttribute( keyName( ), keyValue( ) );
129 }
130 }
131
132 a_writeInfo.addNodeStarter( a_indent, moniker( ), attributes );
133
134 if( !a_embedded ) axes( ).toXMLList( a_writeInfo, indent2 );
135
136 doublesToXMLList( a_writeInfo, indent2, m_coefficients, 0, true );
137 a_writeInfo.addNodeEnder( moniker( ) );
138}
#define GIDI_outerDomainValueChars
Definition GIDI.hpp:436
#define GIDI_indexChars
Definition GIDI.hpp:437
void toXMLList(GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
Definition GIDI_axes.cc:113
std::string const & keyName() const
Definition GIDI_form.cc:126
std::string const & keyValue() const
Definition GIDI_form.cc:149
double outerDomainValue() const
Definition GIDI.hpp:1010
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
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
std::string doubleToShortestString(double a_value, int a_significantDigits=15, int a_favorEFormBy=0)
Definition LUPI_misc.cc:349

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