5int main(
int argv,
char* argc[]) {
6 std::string pathToConfigFile;
8 pathToConfigFile = argc[1];
10 pathToConfigFile =
"config.json";
12 serif::config::Config::getInstance().loadConfig(pathToConfigFile);
14 std::vector<std::string> symbols = {
"H-1",
"He-4"};
15 comp.registerSymbol(symbols);
16 comp.setMassFraction(
"H-1", 0.7);
17 comp.setMassFraction(
"He-4", 0.3);
19 std::cout <<
"=== Mass Fraction Mode ===" << std::endl;
20 std::cout <<
"\tH-1 Mass Frac: " << comp.getMassFraction(
"H-1") << std::endl;
21 std::cout <<
"\tH-1 Number Frac: " << comp.getNumberFraction(
"H-1") << std::endl;
22 std::cout <<
"\tHe-4 Mass Frac: " << comp.getMassFraction(
"He-4") << std::endl;
23 std::cout <<
"\tHe-4 Number Frac: " << comp.getNumberFraction(
"He-4") << std::endl;
25 std::cout <<
"\tMass Frac Sum: " << comp.getMassFraction(
"H-1") + comp.getMassFraction(
"He-4") << std::endl;
26 std::cout <<
"\tNumber Frac Sum: " << comp.getNumberFraction(
"H-1") + comp.getNumberFraction(
"He-4") << std::endl;
34 std::cout <<
"=== Number Fraction Mode ===" << std::endl;
35 std::cout <<
"\tH-1 Mass Frac: " << comp2.
getMassFraction(
"H-1") << std::endl;
36 std::cout <<
"\tH-1 Number Frac: " << comp2.
getNumberFraction(
"H-1") << std::endl;
37 std::cout <<
"\tHe-4 Mass Frac: " << comp2.
getMassFraction(
"He-4") << std::endl;
38 std::cout <<
"\tHe-4 Number Frac: " << comp2.
getNumberFraction(
"He-4") << std::endl;
44 std::vector<std::string> symbols3 = {
60 std::vector<double> mass_fractions = {
77 std::cout <<
"=== Mass Fraction Mode ===" << std::endl;
78 double massFracSum = 0.0;
79 double numberFracSum = 0.0;
80 for (
const auto& symbol : symbols3) {
81 std::cout <<
"\t" << symbol <<
" Mass Frac: " << comp3.
getMassFraction(symbol) << std::endl;
82 std::cout <<
"\t" << symbol <<
" Number Frac: " << comp3.
getNumberFraction(symbol) << std::endl;
86 std::cout <<
"\tMass Frac Sum: " << massFracSum << std::endl;
87 std::cout <<
"\tNumber Frac Sum: " << numberFracSum << std::endl;