15int Composition::next_id_ = 1;
19 throw ValueError(
"invalid nuclide in CompMap");
22 throw ValueError(
"negative quantity in CompMap");
31 throw ValueError(
"invalid nuclide in CompMap");
34 throw ValueError(
"negative quantity in CompMap");
46 if (atom_.size() == 0) {
48 for (
it = mass_.begin();
it != mass_.end(); ++
it) {
57 if (mass_.size() == 0) {
59 for (
it = atom_.begin();
it != atom_.end(); ++
it) {
93 CompMap::const_iterator
it;
99 ->AddVal(
"NucId",
it->first)
128 if (atom_.size() == 0)
133 CompMap::const_iterator
it;
135 for (
it = atom_.begin();
it != atom_.end(); ++
it) {
static Ptr CreateFromMass(CompMap v)
Creates a new composition from v with its components having appropriate mass-based ratios.
const CompMap & mass()
Returns the unnormalized mass composition.
const CompMap & atom()
Returns the unnormalized atom composition.
boost::shared_ptr< Composition > Ptr
static Ptr CreateFromAtom(CompMap v)
Creates a new composition from v with its components having appropriate atom-based ratios.
void Record(Context *ctx)
Records the composition in output database Compositions table (if not done previously).
std::map< int, Composition::Ptr > Chain
a chain containing compositions that are a result of decay from a common ancestor composition.
Ptr Decay(int delta)
Returns a decayed version of this composition (decayed delta timesteps) assuming a time step is 1/12 ...
boost::shared_ptr< Chain > ChainPtr
int id()
Returns a unique id associated with this composition.
A simulation context provides access to necessary simulation-global functions and state.
Datum * NewDatum(std::string title)
See Recorder::NewDatum documentation.
Datum * AddVal(const char *field, boost::spirit::hold_any val, std::vector< int > *shape=NULL)
Add an arbitrary field-value pair to the datum.
void Record()
Record this datum to its Recorder.
For values that are too big, too small, etc.
const uint64_t kDefaultTimeStepDur
int pyne_cram_transmute_nucid_to_i(int nucid)
pyne_cram_transmute_info_t pyne_cram_transmute_info
void pyne_cram_expm_multiply14(double *A, double *b, double *x)
bool ValidNucs(const CompMap &v)
Returns true if all nuclide keys in v are valid.
bool AllPositive(const CompMap &v)
Returns true if all nuclides in v have quantities greater than or equal to zero.
void Normalize(CompMap *v, double val)
The sum of quantities of all nuclides of v is normalized to val.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
std::map< Nuc, double > CompMap
a raw definition of nuclides and corresponding (dimensionless quantities).
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
double atomic_mass(int nuc)
Returns the atomic mass of a nuclide nuc.