fourdst::libcomposition v1.5.2
Robust atomic species information library
Loading...
Searching...
No Matches
fourdst::atomic::Species Struct Reference

Represents an atomic species (isotope) with its fundamental physical properties. More...

#include <atomicSpecies.h>

Public Member Functions

 Species (const std::string_view name, const std::string_view el, const int nz, const int n, const int z, const int a, const double bindingEnergy, const std::string_view betaCode, const double betaDecayEnergy, const double halfLife_s, const std::string_view spinParity, const std::string_view decayModes, const double atomicMass, const double atomicMassUnc)
 Constructs a Species object with detailed properties.
 
 Species (const Species &species)
 Copy constructor for Species.
 
double mass () const
 Gets the atomic mass of the species.
 
double massUnc () const
 Gets the uncertainty in the atomic mass.
 
double halfLife () const
 Gets the half-life of the species.
 
std::string_view spinParity () const
 Gets the spin and parity as a string.
 
std::string_view decayModes () const
 Gets the decay modes as a string.
 
double bindingEnergy () const
 Gets the binding energy of the species.
 
double betaDecayEnergy () const
 Gets the beta decay energy of the species.
 
std::string_view betaCode () const
 Gets the beta decay code.
 
std::string_view name () const
 Gets the name of the species.
 
std::string_view el () const
 Gets the element symbol of the species.
 
int nz () const
 Gets the NZ identifier of the species.
 
int n () const
 Gets the number of neutrons.
 
int z () const
 Gets the atomic number (number of protons).
 
int a () const
 Gets the mass number.
 
double spin () const
 Gets the nuclear spin as a numeric value.
 

Public Attributes

std::string m_name
 Name of the species (e.g., "Fe56").
 
std::string m_el
 Element symbol (e.g., "Fe").
 
int m_nz
 NZ identifier, typically 1000*Z + A.
 
int m_n
 Number of neutrons.
 
int m_z
 Atomic number (number of protons).
 
int m_a
 Mass number (N + Z).
 
double m_bindingEnergy
 Binding energy in keV.
 
std::string m_betaCode
 Beta decay code.
 
double m_betaDecayEnergy
 Beta decay energy in keV.
 
double m_halfLife_s
 Half-life in seconds. A value of -1.0 typically indicates stability.
 
std::string m_spinParity
 Spin and parity as a string (e.g., "1/2-").
 
std::string m_decayModes
 Decay modes as a string.
 
double m_atomicMass
 Atomic mass in atomic mass units (u).
 
double m_atomicMassUnc
 Uncertainty in the atomic mass.
 
double m_spin = 0.0
 Nuclear spin as a double, derived from m_spinParity.
 

Friends

std::ostream & operator<< (std::ostream &os, const Species &species)
 Overloads the stream insertion operator for easy printing of a Species object.
 
bool operator== (const Species &lhs, const Species &rhs)
 Equality operator for Species. Compares based on name.
 
bool operator!= (const Species &lhs, const Species &rhs)
 Inequality operator for Species. Compares based on name.
 
bool operator< (const Species &lhs, const Species &rhs)
 Less-than operator for Species. Compares based on atomic mass.
 
bool operator> (const Species &lhs, const Species &rhs)
 Greater-than operator for Species. Compares based on atomic mass.
 

Detailed Description

Represents an atomic species (isotope) with its fundamental physical properties.

This struct holds data parsed from nuclear data libraries, such as atomic mass, half-life, and spin. It is a fundamental data structure for representing the components of a material composition.

Note
This struct is designed to be lightweight and is primarily a data container.
Usage Example
#include <iostream>
int main() {
// Create a species for Deuterium (H-2)
"H2", "H", 1002, 1, 1, 2, 2224.52, "", 0.0, -1.0, "1+", "", 2.0141017781, 4.0e-11
);
std::cout << "Species: " << deuterium.name() << std::endl;
std::cout << "Atomic Mass: " << deuterium.mass() << " u" << std::endl;
std::cout << "Spin: " << deuterium.spin() << std::endl;
return 0;
}
Represents an atomic species (isotope) with its fundamental physical properties.

Definition at line 48 of file atomicSpecies.h.

Constructor & Destructor Documentation

◆ Species() [1/2]

fourdst::atomic::Species::Species ( const std::string_view name,
const std::string_view el,
const int nz,
const int n,
const int z,
const int a,
const double bindingEnergy,
const std::string_view betaCode,
const double betaDecayEnergy,
const double halfLife_s,
const std::string_view spinParity,
const std::string_view decayModes,
const double atomicMass,
const double atomicMassUnc )
inline

Constructs a Species object with detailed properties.

Parameters
nameName of the species.
elElement symbol.
nzNZ identifier.
nNumber of neutrons.
zAtomic number.
aMass number.
bindingEnergyBinding energy.
betaCodeBeta decay code.
betaDecayEnergyBeta decay energy.
halfLife_sHalf-life in seconds.
spinParitySpin and parity string.
decayModesDecay modes string.
atomicMassAtomic mass.
atomicMassUncAtomic mass uncertainty.
Postcondition
The m_spin member is initialized by parsing m_spinParity using convert_jpi_to_double.

Definition at line 85 of file atomicSpecies.h.

◆ Species() [2/2]

fourdst::atomic::Species::Species ( const Species & species)
inline

Copy constructor for Species.

Parameters
speciesThe Species object to copy.
Postcondition
A new Species object is created as a deep copy of species. The m_spin member is re-calculated.

Definition at line 123 of file atomicSpecies.h.

Member Function Documentation

◆ a()

int fourdst::atomic::Species::a ( ) const
inlinenodiscard

Gets the mass number.

Returns
The mass number (A = N + Z).

Definition at line 250 of file atomicSpecies.h.

◆ betaCode()

std::string_view fourdst::atomic::Species::betaCode ( ) const
inlinenodiscard

Gets the beta decay code.

Returns
A string_view of the beta decay code.

Definition at line 202 of file atomicSpecies.h.

◆ betaDecayEnergy()

double fourdst::atomic::Species::betaDecayEnergy ( ) const
inlinenodiscard

Gets the beta decay energy of the species.

Returns
The beta decay energy in keV.

Definition at line 194 of file atomicSpecies.h.

◆ bindingEnergy()

double fourdst::atomic::Species::bindingEnergy ( ) const
inlinenodiscard

Gets the binding energy of the species.

Returns
The binding energy in keV.

Definition at line 186 of file atomicSpecies.h.

◆ decayModes()

std::string_view fourdst::atomic::Species::decayModes ( ) const
inlinenodiscard

Gets the decay modes as a string.

Returns
A string_view of the decay modes.

Definition at line 178 of file atomicSpecies.h.

◆ el()

std::string_view fourdst::atomic::Species::el ( ) const
inlinenodiscard

Gets the element symbol of the species.

Returns
A string_view of the element symbol (e.g., "Fe").

Definition at line 218 of file atomicSpecies.h.

◆ halfLife()

double fourdst::atomic::Species::halfLife ( ) const
inlinenodiscard

Gets the half-life of the species.

Returns
The half-life in seconds.

Definition at line 162 of file atomicSpecies.h.

◆ mass()

double fourdst::atomic::Species::mass ( ) const
inlinenodiscard

Gets the atomic mass of the species.

Returns
The atomic mass in atomic mass units (u).

Definition at line 146 of file atomicSpecies.h.

◆ massUnc()

double fourdst::atomic::Species::massUnc ( ) const
inlinenodiscard

Gets the uncertainty in the atomic mass.

Returns
The atomic mass uncertainty.

Definition at line 154 of file atomicSpecies.h.

◆ n()

int fourdst::atomic::Species::n ( ) const
inlinenodiscard

Gets the number of neutrons.

Returns
The number of neutrons (N).

Definition at line 234 of file atomicSpecies.h.

◆ name()

std::string_view fourdst::atomic::Species::name ( ) const
inlinenodiscard

Gets the name of the species.

Returns
A string_view of the species name (e.g., "Fe56").

Definition at line 210 of file atomicSpecies.h.

◆ nz()

int fourdst::atomic::Species::nz ( ) const
inlinenodiscard

Gets the NZ identifier of the species.

Returns
The NZ identifier (1000*Z + A).

Definition at line 226 of file atomicSpecies.h.

◆ spin()

double fourdst::atomic::Species::spin ( ) const
inlinenodiscard

Gets the nuclear spin as a numeric value.

Returns
The spin as a double.

Definition at line 258 of file atomicSpecies.h.

◆ spinParity()

std::string_view fourdst::atomic::Species::spinParity ( ) const
inlinenodiscard

Gets the spin and parity as a string.

Returns
A string_view of the spin and parity (e.g., "1/2+").

Definition at line 170 of file atomicSpecies.h.

◆ z()

int fourdst::atomic::Species::z ( ) const
inlinenodiscard

Gets the atomic number (number of protons).

Returns
The atomic number (Z).

Definition at line 242 of file atomicSpecies.h.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const Species & lhs,
const Species & rhs )
friend

Inequality operator for Species. Compares based on name.

Parameters
lhsThe left-hand side Species.
rhsThe right-hand side Species.
Returns
true if the names are different, false otherwise.

Definition at line 293 of file atomicSpecies.h.

◆ operator<

bool operator< ( const Species & lhs,
const Species & rhs )
friend

Less-than operator for Species. Compares based on atomic mass.

Parameters
lhsThe left-hand side Species.
rhsThe right-hand side Species.
Returns
true if lhs atomic mass is less than rhs atomic mass, false otherwise.

Definition at line 302 of file atomicSpecies.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Species & species )
friend

Overloads the stream insertion operator for easy printing of a Species object.

Parameters
osThe output stream.
speciesThe Species object to print.
Returns
The output stream with the species name.

Definition at line 268 of file atomicSpecies.h.

◆ operator==

bool operator== ( const Species & lhs,
const Species & rhs )
friend

Equality operator for Species. Compares based on name.

Parameters
lhsThe left-hand side Species.
rhsThe right-hand side Species.
Returns
true if the names are identical, false otherwise.

Definition at line 284 of file atomicSpecies.h.

◆ operator>

bool operator> ( const Species & lhs,
const Species & rhs )
friend

Greater-than operator for Species. Compares based on atomic mass.

Parameters
lhsThe left-hand side Species.
rhsThe right-hand side Species.
Returns
true if lhs atomic mass is greater than rhs atomic mass, false otherwise.

Definition at line 311 of file atomicSpecies.h.

Member Data Documentation

◆ m_a

int fourdst::atomic::Species::m_a

Mass number (N + Z).

Definition at line 54 of file atomicSpecies.h.

◆ m_atomicMass

double fourdst::atomic::Species::m_atomicMass

Atomic mass in atomic mass units (u).

Definition at line 61 of file atomicSpecies.h.

◆ m_atomicMassUnc

double fourdst::atomic::Species::m_atomicMassUnc

Uncertainty in the atomic mass.

Definition at line 62 of file atomicSpecies.h.

◆ m_betaCode

std::string fourdst::atomic::Species::m_betaCode

Beta decay code.

Definition at line 56 of file atomicSpecies.h.

◆ m_betaDecayEnergy

double fourdst::atomic::Species::m_betaDecayEnergy

Beta decay energy in keV.

Definition at line 57 of file atomicSpecies.h.

◆ m_bindingEnergy

double fourdst::atomic::Species::m_bindingEnergy

Binding energy in keV.

Definition at line 55 of file atomicSpecies.h.

◆ m_decayModes

std::string fourdst::atomic::Species::m_decayModes

Decay modes as a string.

Definition at line 60 of file atomicSpecies.h.

◆ m_el

std::string fourdst::atomic::Species::m_el

Element symbol (e.g., "Fe").

Definition at line 50 of file atomicSpecies.h.

◆ m_halfLife_s

double fourdst::atomic::Species::m_halfLife_s

Half-life in seconds. A value of -1.0 typically indicates stability.

Definition at line 58 of file atomicSpecies.h.

◆ m_n

int fourdst::atomic::Species::m_n

Number of neutrons.

Definition at line 52 of file atomicSpecies.h.

◆ m_name

std::string fourdst::atomic::Species::m_name

Name of the species (e.g., "Fe56").

Definition at line 49 of file atomicSpecies.h.

◆ m_nz

int fourdst::atomic::Species::m_nz

NZ identifier, typically 1000*Z + A.

Definition at line 51 of file atomicSpecies.h.

◆ m_spin

double fourdst::atomic::Species::m_spin = 0.0

Nuclear spin as a double, derived from m_spinParity.

Definition at line 63 of file atomicSpecies.h.

◆ m_spinParity

std::string fourdst::atomic::Species::m_spinParity

Spin and parity as a string (e.g., "1/2-").

Definition at line 59 of file atomicSpecies.h.

◆ m_z

int fourdst::atomic::Species::m_z

Atomic number (number of protons).

Definition at line 53 of file atomicSpecies.h.


The documentation for this struct was generated from the following file: