#include "structures.h" #include "catima/nucdata.h" namespace catima{ bool operator==(const Projectile &a, const Projectile&b){ if( (a.A==b.A) && (a.Z==b.Z) && (a.Q==b.Q)){ return true; } else return false; } bool operator==(const Material &a, const Material&b){ if(a.molar_mass != b.molar_mass)return false; if(a.density() != b.density())return false; if(a.ncomponents() != b.ncomponents())return false; for(int i=0;i &list){ add_element(list[0],list[1],1.0); } */ Material::Material(std::initializer_list>list,double _density):rho(_density){ std::initializer_list>::iterator it; for ( it=list.begin(); it!=list.end(); ++it){ add_element( (*it)[0],(*it)[1],(*it)[2]); } } Material::Material(double _a, int _z, double _rho, double _th):rho(_rho),th(_th){ add_element(_a,_z,1.0); } void Material::add_element(double _a, int _z, double _stn){ double a = (_a>0)?_a:element_atomic_weight(_z); stn.push_back(_stn); atoms.push_back({a,_z}); molar_mass += _stn*a; } std::pair Material::get_element(int i) const{ return std::pair(atoms[i],stn[i]); } /* void Material::calculate(){ molar_mass = 0; for(int i=0;i