Warning: This is no longer the latest available version of this module. Please see the releases page for the most recent version. The Webnucleo group strongly recommends the use of the latest version of any of its online modules.
This tutorial demonstrates how to use example codes in the libnucnet distribution src/examples directory. The sample input files used in the tutorial are included in the distribution release and may be located in the data_pub directory.
Example 24: Create a nuclear reaction network from an input xml file and print the valid reactions (those between nuclei in the network) and the invalid reactions (those between nuclei not in the network).
libnucnet routines demonstrated in example24.c are:
- Line 69: Libnucnet__Net__is_valid_input_xml()
- Line 83: Libnucnet__Net__new_from_xml()
- Line 131: Libnucnet__Nuc__getNumberOfSpecies()
- Line 132: Libnucnet__Net__getNuc()
- Line 140: Libnucnet__Net__getReac()
- Line 149: Libnucnet__Net__getNumberOfValidReactions()
- Line 156: Libnucnet__Reac__iterateReactions()
- Line 169: Libnucnet__Reac__getNumberOfReactions()
- Line 185: Libnucnet__Net__free()
- Line 202: Libnucnet__Net__isValidReaction()
- Line 203: Libnucnet__Reaction__getString()
The first thing you need to do is to merge the nuclear data xml file and the reaction data xml file into a single network data xml file. Use xsltproc (which you should have installed as described in the compile tutorial):
xsltproc --stringparam reac_doc ../data_pub/example_reac.xml ../../xsl_pub/merge_net.xsl ../../data_pub/example_nuc.xml > ../../data_pub/example_net.xml
To run example24, type the following on the command line:
./example24 ../../data_pub/example_net.xml > ex24_output.txt
The result is ex24_output.txt
Example 25: Create a nuclear reaction network from input xml files and print the reaction Q values for the valid reactions.
libnucnet routines demonstrated in example25.c are:
- Line 64: Libnucnet__Net__new()
- Line 67: Libnucnet__Nuc__updateFromXml()
- Line 68: Libnucnet__Net__getNuc()
- Line 77: Libnucnet__Reac__updateFromXml()
- Line 78: Libnucnet__Net__getReac()
- Line 90: Libnucnet__Reac__iterateReactions()
- Line 102: Libnucnet__Net__free()
- Line 118: Libnucnet__Net__isValidReaction()
- Line 123: Libnucnet__Reaction__getString()
- Line 129: Libnucnet__Net__computeReactionQValue()
To run example25, type the following on the command line:
./example25 ../../data_pub/example_nuc.xml ../../data_pub/example_reac.xml > ex25_output.txt
The result is ex25_output.txt
Example 26: Create a nuclear reaction network from an input xml file and print the forward and reverse rates for all valid reactions at the input temperature.
libnucnet routines demonstrated in example26.c are:
- Line 75: Libnucnet__Net__new_from_xml()
- Line 131: Libnucnet__Reac__iterateReactions()
- Line 132: Libnucnet__Net__getReac()
- Line 143: Libnucnet__Net__free()
- Line 161: Libnucnet__Net__isValidReaction()
- Line 163: Libnucnet__Net__computeRatesForReaction()
- Line 175: Libnucnet__Reaction__getString()
To run example26, type the following on the command line:
./example26 ../../data_pub/example_net.xml 1. > ex26_output.txt
The result is ex26_output.txt
Example 27: Create a nuclear reaction network from an input xml file and print the forward and reverse rates for a particular reaction (chosen by its string) at a variety of temperatures.
libnucnet routines demonstrated in example27.c are:
- Line 63: Libnucnet__Net__new_from_xml()
- Line 70: Libnucnet__Reac__getReactionByString()
- Line 71: Libnucnet__Net__getReac()
- Line 80: Libnucnet__Net__isValidReaction()
- Line 83: Libnucnet__Reaction__getString()
- Line 91: Libnucnet__Net__computeRatesForReaction()
- Line 112: Libnucnet__Net__free()
Choose a particular reaction with a string. For example, try:
./example27 ../../data_pub/example_net.xml "c12 + he4 -> o16 + gamma" > ex27_output.txt
The result is ex27_output.txt
Example 28: Create a nuclear reaction network from an input xml file and print the forward and reverse rates for a particular reaction or set of reactions (chosen by an xpath expression) at a variety of temperatures.
libnucnet routines demonstrated in example28.c are:
- Line 57: Libnucnet__Net__new_from_xml()
- Line 63: Libnucnet__Reac__iterateReactions()
- Line 64: Libnucnet__Net__getReac()
- Line 73: Libnucnet__Net__free()
- Line 95: Libnucnet__Net__isValidReaction()
- Line 100: Libnucnet__Reaction__getString()
- Line 108: Libnucnet__Net__computeRatesForReaction()
Choose a reaction or set of reactions with an xpath expression. For example, try:
./example28 ../../data_pub/example_net.xml "[reactant = 'ne21']" > ex28_output.txt
The result is ex28_output.txt
Example 29: Create a nuclear reaction network from an input xml file and print the forward and reverse rates at the input temperature and then double the rates and print them out again.
libnucnet routines demonstrated in example29.c are:
- Line 66: Libnucnet__Net__new()
- Line 68: Libnucnet__Nuc__updateFromXml()
- Line 69: Libnucnet__Net__getNuc()
- Line 75: Libnucnet__Reac__updateFromXml()
- Line 76: Libnucnet__Net__getReac()
- Line 92: Libnucnet__Zone__new()
- Line 103: Libnucnet__Zone__computeRates()
- Line 115: Libnucnet__Reac__iterateReactions()
- Line 117: Libnucnet__Zone__getNet()
- Line 161: Libnucnet__Zone__free()
- Line 162: Libnucnet__Net__free()
- Line 181: Libnucnet__Net__isValidReaction()
- Line 187: Libnucnet__Zone__getRatesForReaction()
- Line 192: Libnucnet__Reaction__getString()
- Line 228: Libnucnet__Zone__updateRatesForReaction()
To run example29, type the following on the command line:
./example29 ../../data_pub/example_net.xml 3. > ex29_output.txt
The result is ex29_output.txt
You can also select out certain reactions with an xpath expression. For example, try:
./example29 ../../data_pub/example_net.xml 3. "[product = 'mg25']" > ex29_xpath_output.txt
The result is ex29_xpath_output.txt
Example 30: Create a nuclear reaction network from an input xml file and for rates selected by an XPath expression, print out the forward and reverse rates, the forward screening factor, the reverse ratio correction, and the screened rates.
libnucnet routines demonstrated in example30.c are:
- Line 102: Libnucnet__Net__new_from_xml()
- Line 145: Libnucnet__Reac__iterateReactions()
- Line 146: Libnucnet__Net__getReac()
- Line 155: Libnucnet__Net__free()
- Line 170: Libnucnet__Net__isValidReaction()
- Line 172: Libnucnet__Net__computeRatesForReaction()
- Line 182: Libnucnet__Net__computeScreeningFactorForReaction()
- Line 193: Libnucnet__Net__computeReverseRatioCorrectionFactorForReaction()
- Line 204: Libnucnet__Reaction__getString()
To run example30, type the following on the command line:
./example30 ../../data_pub/example_net.xml 3. 1.e8 0.5 0.15 "[reactant = 'n15']" > ex30_output.txt
The result is ex30_output.txt
Example 31: Create a full libnucnet nuclear reaction network structure (nuclei plus reactions among them) from an input xml file print out data about the input zones, remove the zones, and add a zone.
libnucnet routines demonstrated in example31.c are:
- Line 60: Libnucnet__is_valid_input_xml()
- Line 69: Libnucnet__new_from_xml()
- Line 79: Libnucnet__getNumberOfZones()
- Line 88: Libnucnet__iterateZones()
- Line 100: Libnucnet__freeAllZones()
- Line 114: Libnucnet__Zone__new()
- Line 115: Libnucnet__getNet()
- Line 121: Libnucnet__addZone()
- Line 128: Libnucnet__Nuc__getSpeciesByName()
- Line 129: Libnucnet__Net__getNuc()
- Line 135: Libnucnet__Zone__updateSpeciesAbundance()
- Line 136: Libnucnet__Species__getA()
- Line 170: Libnucnet__relabelZone()
- Line 208: Libnucnet__free()
- Line 231: Libnucnet__Zone__getLabel()
- Line 239: Libnucnet__Nuc__iterateSpecies()
- Line 241: Libnucnet__Zone__getNet()
- Line 250: Libnucnet__Zone__computeAMoment()
- Line 273: Libnucnet__Zone__getSpeciesAbundance()
- Line 279: Libnucnet__Species__getName()
The first thing you need to do is to merge the nuclear network xml file and an input mass fractions data xml file into a single xml file appropriate as a libnucnet input file. Use xsltproc (which you should have installed during the compilation tutorial):
xsltproc --stringparam initial_mass_frac_doc ../data_pub/initial_mass_fractions_3d.xml ../../xsl_pub/merge_full.xsl ../../data_pub/example_net.xml > ../../data_pub/example_3d.xml
To run example31, type the following on the command line:
./example31 ../../data_pub/example_3d.xml > ex31_output.txt
The result is ex31_output.txt
Example 32: Create a full libnucnet structure (network plus zones) and print out data about the zones.
libnucnet routines demonstrated in example32.c are:
- Line 63: Libnucnet__new_from_xml()
- Line 71: Libnucnet__getNumberOfZones()
- Line 78: Libnucnet__iterateZones()
- Line 88: Libnucnet__free()
- Line 104: Libnucnet__Zone__getLabel()
- Line 112: Libnucnet__Nuc__iterateSpecies()
- Line 113: Libnucnet__Net__getNuc()
- Line 114: Libnucnet__Zone__getNet()
- Line 141: Libnucnet__Zone__getSpeciesAbundance()
- Line 146: Libnucnet__Species__getName()
To run example32, type the following on the command line:
./example32 ../../data_pub/example_3d.xml > ex32_output.txt
The result is ex32_output.txt
Example 33: Create a full libnucnet structure (network plus zones) and print out initial mass fractions for a zone chosen by its labels.
libnucnet routines demonstrated in example33.c are:
- Line 62: Libnucnet__new()
- Line 64: Libnucnet__Nuc__updateFromXml()
- Line 65: Libnucnet__Net__getNuc()
- Line 66: Libnucnet__getNet()
- Line 72: Libnucnet__assignZoneDataFromXml()
- Line 80: Libnucnet__getZoneByLabels()
- Line 92: Libnucnet__Zone__getLabel()
- Line 101: Libnucnet__free()
- Line 115: Libnucnet__Nuc__iterateSpecies()
- Line 117: Libnucnet__Zone__getNet()
- Line 125: Libnucnet__Zone__computeAMoment()
- Line 140: Libnucnet__Zone__getSpeciesAbundance()
- Line 145: Libnucnet__Species__getName()
- Line 147: Libnucnet__Species__getA()
To run example33, type the following on the command line:
./example33 ../../data_pub/example_net.xml ../../data_pub/initial_mass_fractions_3d.xml x1 y1 z1 > ex33_output.txt
The result is ex33_output.txt
Example 34: Create a full libnucnet structure (network plus zones) and print out initial mass fractions for a given species in all zones.
libnucnet routines demonstrated in example34.c are:
- Line 59: Libnucnet__new_from_xml()
- Line 64: Libnucnet__new()
- Line 66: Libnucnet__Nuc__updateFromXml()
- Line 67: Libnucnet__Net__getNuc()
- Line 68: Libnucnet__getNet()
- Line 74: Libnucnet__assignZoneDataFromXml()
- Line 81: Libnucnet__Nuc__getSpeciesByName()
- Line 114: Libnucnet__iterateZones()
- Line 124: Libnucnet__free()
- Line 140: Libnucnet__Zone__getSpeciesAbundance()
- Line 145: Libnucnet__Zone__getLabel()
- Line 148: Libnucnet__Species__getA()
To run example34, type the following on the command line:
./example34 ../../data_pub/example_nuc.xml ../../data_pub/initial_mass_fractions_stooges.xml he4 > ex34_output.txt
The result is ex34_output.txt
Example 35: Create a zone mass fractions file from a Rauscher et al. (2002) stellar model data file.
libnucnet routines demonstrated in example35.c are:
- Line 69: Libnucnet__new()
- Line 71: Libnucnet__Nuc__updateFromXml()
- Line 72: Libnucnet__Net__getNuc()
- Line 73: Libnucnet__getNet()
- Line 164: Libnucnet__Zone__new()
- Line 171: Libnucnet__Zone__updateProperty()
- Line 193: Libnucnet__Nuc__getSpeciesByName()
- Line 196: Libnucnet__Zone__updateSpeciesAbundance()
- Line 197: Libnucnet__Species__getA()
- Line 202: Libnucnet__addZone()
- Line 216: Libnucnet__writeZoneDataToXmlFile()
- Line 227: Libnucnet__free()
To run example35, type the following on the command line:
./example35 ../../data_pub/star_read_nuc.xml ../../data_pub/star_data.txt ex35_output.xml
The result is ex35_output.xml
Example 36: Extract a subset of zones containing a subset of nuclei from the original zone xml file and dump to a new xml.
libnucnet routines demonstrated in example36.c are:
- Line 68: Libnucnet__new()
- Line 74: Libnucnet__Nuc__updateFromXml()
- Line 75: Libnucnet__Net__getNuc()
- Line 76: Libnucnet__getNet()
- Line 86: Libnucnet__assignZoneDataFromXml()
- Line 94: Libnucnet__Net__updateFromXml()
- Line 105: Libnucnet__iterateZones()
- Line 115: Libnucnet__writeZoneDataToXmlFile()
- Line 121: Libnucnet__free()
- Line 145: Libnucnet__Zone__getLabel()
- Line 150: Libnucnet__Zone__new()
- Line 166: Libnucnet__Zone__iterateOptionalProperties()
- Line 176: Libnucnet__Nuc__iterateSpecies()
- Line 182: Libnucnet__addZone()
- Line 205: Libnucnet__Nuc__getSpeciesByName()
- Line 207: Libnucnet__Zone__getNet()
- Line 209: Libnucnet__Species__getName()
- Line 212: Libnucnet__Zone__updateSpeciesAbundance()
- Line 215: Libnucnet__Zone__getSpeciesAbundance()
- Line 234: Libnucnet__Zone__updateProperty()
To run example36, type the following on the command line:
./example36 ../../data_pub/star_read_nuc.xml ../../data_pub/s25a28d_expl.xml "[(@label1 >= '214' and @label1 <= '216') or @label1 = 'wind']" "[ z <= 30 ]" ex36_output.xml
The result is ex36_output.xml
More complicated xpath expressions are possible. For example to extract zones for which the the mass fraction of iron-60 is greater than 1.e-10 and include them in a file that includes only species with z < 30, type:
./example36 ../../data_pub/star_read_nuc.xml ../../data_pub/s25a28d_expl.xml "[mass_fractions/nuclide[@name='fe60' and x > 1.e-10]]" "[ z <= 30 ]" ex36_output_xpath2.xml
The result is ex36_output_xpath2.xml
Example 37: Average the abundances in the zones.
libnucnet routines demonstrated in example37.c are:
- Line 59: Libnucnet__new()
- Line 65: Libnucnet__Nuc__updateFromXml()
- Line 66: Libnucnet__Net__getNuc()
- Line 67: Libnucnet__getNet()
- Line 77: Libnucnet__assignZoneDataFromXml()
- Line 85: Libnucnet__Nuc__getNumberOfSpecies()
- Line 116: Libnucnet__getZoneByLabels()
- Line 123: Libnucnet__Zone__getAbundances()
- Line 156: Libnucnet__Zone__new()
- Line 163: Libnucnet__addZone()
- Line 165: Libnucnet__Zone__updateAbundances()
- Line 171: Libnucnet__writeZoneDataToXmlFile()
- Line 179: Libnucnet__free()
To run example37, type the following on the command line:
./example37 ../../data_pub/star_read_nuc.xml ../../data_pub/s25a28d_expl.xml ../../data_pub/average.txt ex37_output.xml
The result is ex37_output.xml
Example 38: Create a full libnucnet structure (network plus zones) and print out the screening and correction factors for the reactions in a zone.
libnucnet routines demonstrated in example38.c are:
- Line 89: Libnucnet__new_from_xml()
- Line 99: Libnucnet__getZoneByLabels()
- Line 115: Libnucnet__Zone__computeZMoment()
- Line 117: Libnucnet__Zone__setScreeningFunction()
- Line 130: Libnucnet__Zone__setNseCorrectionFactorFunction()
- Line 140: Libnucnet__Zone__computeRates()
- Line 147: Libnucnet__Zone__clearScreeningFunction()
- Line 148: Libnucnet__Zone__clearNseCorrectionFactorFunction()
- Line 159: Libnucnet__Reac__iterateReactions()
- Line 160: Libnucnet__Net__getReac()
- Line 161: Libnucnet__Zone__getNet()
- Line 174: Libnucnet__free()
- Line 189: Libnucnet__Net__isValidReaction()
- Line 198: Libnucnet__Reaction__getString()
- Line 199: Libnucnet__Zone__getScreeningFactorForReaction()
- Line 200: Libnucnet__Zone__getReverseRatioCorrectionFactorForReaction()
The first thing you need to do is to merge the nuclear network xml file and an input mass fractions data xml file appropriate for a single zone calculation into a single xml file appropriate as a libnucnet input file. Use xsltproc (which you should have installed during the compilation tutorial):
xsltproc --stringparam initial_mass_frac_doc ../data_pub/initial_mass_fractions_single_zone.xml ../../xsl_pub/merge_full.xsl ../../data_pub/example_net.xml > ../../data_pub/example_single_zone.xml
To run example38, type the following on the command line:
./example38 ../../data_pub/example_single_zone.xml 1. 1.e8 0 0 0 > ex38_output.txt
The result is ex38_output.txt
Example 39: Create a full libnucnet structure (network plus zones) and generate the Jacobian matrix.
libnucnet routines demonstrated in example39.c are:
- Line 99: Libnucnet__new_from_xml()
- Line 106: Libnucnet__getZoneByLabels()
- Line 118: Libnucnet__Reac__getDuplicateReactions()
- Line 119: Libnucnet__Net__getReac()
- Line 120: Libnucnet__Zone__getNet()
- Line 124: Libnucnet__Reac__iterateReactions()
- Line 130: Libnucnet__Reac__free()
- Line 143: Libnucnet__Zone__computeZMoment()
- Line 145: Libnucnet__Zone__setScreeningFunction()
- Line 158: Libnucnet__Zone__setNseCorrectionFactorFunction()
- Line 170: Libnucnet__Zone__computeRates()
- Line 177: Libnucnet__Zone__computeJacobianMatrix()
- Line 194: Libnucnet__free()
To run example39, type the following on the command line:
./example39 ../../data_pub/example_single_zone.xml 0 0 0 1. 1.e3 ex39_output.txt
The result is ex39_output.txt
Example 40: Create a full libnucnet structure (network plus zones) and run a single-zone network calculation for the input temperature, density, and duration.
libnucnet routines demonstrated in example40.c are:
- Line 135: Libnucnet__is_valid_input_xml()
- Line 145: Libnucnet__new_from_xml()
- Line 167: Libnucnet__getZoneByLabels()
- Line 174: Libnucnet__Reac__getDuplicateReactions()
- Line 175: Libnucnet__Net__getReac()
- Line 176: Libnucnet__Zone__getNet()
- Line 180: Libnucnet__Reac__iterateReactions()
- Line 186: Libnucnet__Reac__free()
- Line 199: Libnucnet__Zone__computeZMoment()
- Line 201: Libnucnet__Zone__setScreeningFunction()
- Line 214: Libnucnet__Zone__setNseCorrectionFactorFunction()
- Line 226: Libnucnet__Zone__updateProperty()
- Line 281: Libnucnet__Zone__updateTimeStep()
- Line 297: Libnucnet__free()
- Line 317: Libnucnet__Nuc__getNumberOfSpecies()
- Line 318: Libnucnet__Net__getNuc()
- Line 327: Libnucnet__Zone__getAbundances()
- Line 333: Libnucnet__Zone__computeRates()
- Line 336: Libnucnet__Zone__getProperty()
- Line 353: Libnucnet__Zone__computeFlowVector()
- Line 366: Libnucnet__Zone__computeJacobianMatrix()
- Line 393: Libnucnet__Zone__updateAbundances()
- Line 424: Libnucnet__Zone__updateAbundanceChanges()
- Line 459: Libnucnet__Nuc__iterateSpecies()
- Line 470: Libnucnet__Zone__computeAMoment()
- Line 487: Libnucnet__Zone__getSpeciesAbundance()
- Line 492: Libnucnet__Species__getZ()
- Line 493: Libnucnet__Species__getA()
- Line 495: Libnucnet__Zone__getSpeciesAbundanceChange()
Use a network of nuclei with Z <= 10 and compute the evolution of the abundances of species with initial abundances in the input file at an initial T9 = 10 and density of 1.e8 g/cc expanding with a density e-folding timescale of 0.1 seconds for 10 seconds, printing out the abundances every 20 time steps:
./example40 ../../data_pub/example_single_zone.xml 0 0 0 10. 1.e8 0.1 10. 20 "[z <= 10]" > ex40_output.txt
The result is ex40_output.txt
Example 41: Create a full libnucnet structure (network plus zones) and run a single-zone network calculation but with the forward and reverse rates for a particular reaction at all temperatures multipled by a constant factor.
libnucnet routines demonstrated in example41.c are:
- Line 133: Libnucnet__is_valid_input_xml()
- Line 143: Libnucnet__new_from_xml()
- Line 162: Libnucnet__getZoneByLabels()
- Line 174: Libnucnet__Reac__getDuplicateReactions()
- Line 175: Libnucnet__Net__getReac()
- Line 176: Libnucnet__Zone__getNet()
- Line 180: Libnucnet__Reac__iterateReactions()
- Line 186: Libnucnet__Reac__free()
- Line 199: Libnucnet__Zone__computeZMoment()
- Line 201: Libnucnet__Zone__setScreeningFunction()
- Line 214: Libnucnet__Zone__setNseCorrectionFactorFunction()
- Line 226: Libnucnet__Zone__updateProperty()
- Line 288: Libnucnet__Zone__updateTimeStep()
- Line 304: Libnucnet__free()
- Line 328: Libnucnet__Nuc__getNumberOfSpecies()
- Line 329: Libnucnet__Net__getNuc()
- Line 338: Libnucnet__Zone__getAbundances()
- Line 344: Libnucnet__Zone__computeRates()
- Line 347: Libnucnet__Zone__getProperty()
- Line 360: Libnucnet__Reac__getReactionByString()
- Line 372: Libnucnet__Zone__getRatesForReaction()
- Line 379: Libnucnet__Zone__updateRatesForReaction()
- Line 393: Libnucnet__Zone__computeFlowVector()
- Line 406: Libnucnet__Zone__computeJacobianMatrix()
- Line 433: Libnucnet__Zone__updateAbundances()
- Line 464: Libnucnet__Zone__updateAbundanceChanges()
- Line 499: Libnucnet__Nuc__iterateSpecies()
- Line 510: Libnucnet__Zone__computeAMoment()
- Line 527: Libnucnet__Zone__getSpeciesAbundance()
- Line 532: Libnucnet__Species__getZ()
- Line 533: Libnucnet__Species__getA()
- Line 535: Libnucnet__Zone__getSpeciesAbundanceChange()
Use a network of nuclei with Z <= 10 and compute the evolution of the abundances of species with initial abundances in the input file at an initial T9 = 10 and density of 1.e8 g/cc expanding with a density e-folding timescale of 0.1 seconds for 10 seconds but with the forward and reverse rates for the reaction he4 + he4 + he4 -> c12 + gamma increased by a factor of 10 at all temperatures, printing out the abundances every 20 time steps:
./example41 ../../data_pub/example_single_zone.xml 10. 1.e8 0.1 10. 20 "he4 + he4 + he4 -> c12 + gamma" 10 "[z <= 10]" > ex41_output.txt
The result is ex41_output.txt
Example 42: Create a full libnucnet structure (network plus zones) and run a multi-zone network calculation for the input conditions.
libnucnet routines demonstrated in example42.c are:
- Line 138: Libnucnet__is_valid_input_xml()
- Line 148: Libnucnet__new_from_xml()
- Line 159: Libnucnet__iterateZones()
- Line 275: Libnucnet__free()
- Line 298: Libnucnet__Nuc__getNumberOfSpecies()
- Line 299: Libnucnet__Net__getNuc()
- Line 300: Libnucnet__getNet()
- Line 304: Libnucnet__getNumberOfZones()
- Line 453: Libnucnet__Zone__getLabel()
- Line 471: Libnucnet__Nuc__iterateSpecies()
- Line 473: Libnucnet__Zone__getNet()
- Line 482: Libnucnet__Zone__computeAMoment()
- Line 497: Libnucnet__Zone__getSpeciesAbundance()
- Line 503: Libnucnet__Species__getZ()
- Line 504: Libnucnet__Species__getA()
- Line 506: Libnucnet__Zone__getSpeciesAbundanceChange()
- Line 523: Libnucnet__Zone__updateTimeStep()
- Line 550: Libnucnet__Zone__getAbundances()
- Line 591: Libnucnet__Zone__getProperty()
- Line 599: Libnucnet__Zone__computeRates()
- Line 609: Libnucnet__Zone__computeFlowVector()
- Line 648: Libnucnet__Zone__computeJacobianMatrix()
- Line 711: Libnucnet__getZoneByLabels()
- Line 846: Libnucnet__Zone__updateAbundances()
- Line 891: Libnucnet__Zone__updateAbundanceChanges()
- Line 957: Libnucnet__Zone__updateProperty()
- Line 987: Libnucnet__Reac__getDuplicateReactions()
- Line 988: Libnucnet__Net__getReac()
- Line 993: Libnucnet__Reac__iterateReactions()
- Line 999: Libnucnet__Reac__free()
- Line 1012: Libnucnet__Zone__computeZMoment()
- Line 1014: Libnucnet__Zone__setScreeningFunction()
- Line 1027: Libnucnet__Zone__setNseCorrectionFactorFunction()
The first thing you need to do is to merge the nuclear network xml file and an input mass fractions data xml file appropriate for a 1-D multi-zone calculation into a single xml file appropriate as a libnucnet input file. Use xsltproc (which you should have installed during the compilation tutorial):
xsltproc --stringparam initial_mass_frac_doc ../data_pub/initial_mass_fractions_1d.xml ../../xsl_pub/merge_full.xsl ../../data_pub/example_net.xml > ../../data_pub/example_1d.xml
For a network of nuclei with Z <= 10, compute the evolution of the abundances of species in the three input zones for a duration of 100 seconds with a mixing time between zones of 0.01 seconds:
./example42 ../../data_pub/example_1d.xml 0.01 100. 1 "[z <= 10]" > ex42_output.txt
The result is ex42_output.txt
To run without mixing, use a mixing timescale of zero:
./example42 ../../data_pub/example_1d.xml 0. 100. 1 "[z <= 10]" > ex42_no_mixing_output.txt
The result is ex42_no_mixing_output.txt
To run with only mixing, use the mix_flag to set all zone temperatures to zero:
./example42 ../../data_pub/example_1d.xml 0.1 100. 0 "[z <= 10]" > ex42_mixing_only_output.txt
The result is ex42_mixing_only_output.txt