Webnucleo.org

Mail Lists | Developers
small logo


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:

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

-top-

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:

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

-top-

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:

To print out the forward and reverse rates at t9 = 1, type:


./example26 ../../data_pub/example_net.xml 1. > ex26_output.txt

The result is ex26_output.txt

-top-

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:

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

-top-

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:

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

-top-

Example 29: Create a nuclear reaction network from an input xml file and check that the forward and reverse rates lie within lower and upper bounds for a given temperature range.

libnucnet routines demonstrated in example29.c are:

To find the forward and reverse rates (for the network in the input file) that are less than 0 or greater than 1.e14 in the temperature range 1.e-3 to 10 billion Kelvins, type:


./example29 ../../data_pub/example_net.xml 1.e-3 10. 0. 1.e14 > ex29_output.txt

The result is ex29_output.txt

-top-

Example 30: 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 example30.c are:

To print and double the forward and reverse rates at t9 = 3, type:


./example30 ../../data_pub/example_net.xml 3. > ex30_output.txt

The result is ex30_output.txt

You can also select out certain reactions with an xpath expression. For example, try:


./example30 ../../data_pub/example_net.xml 3. "[product = 'mg25']" > ex30_xpath_output.txt

The result is ex30_xpath_output.txt

-top-

Example 31: 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 example31.c are:

To print the correction factor and screened rates for reactions involving n15 as a reactant at t9 = 3, a mass density of 1.e8 g/cc, an electron-to-baryon ratio of 0.5, and a second moment of the abundances with respect to atomic number of 0.15, type:


./example31 ../../data_pub/example_net.xml 3. 1.e8 0.5 0.15 "[reactant = 'n15']" > ex31_output.txt

The result is ex31_output.txt

-top-

Example 32: 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 example32.c are:

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 example32, type the following on the command line:


./example32 ../../data_pub/example_3d.xml > ex32_output.txt

The result is ex32_output.txt

-top-

Example 33: Create a full libnucnet structure (network plus zones) and print out data about the zones.

libnucnet routines demonstrated in example33.c are:

To run example33, type the following on the command line:


./example33 ../../data_pub/example_3d.xml > ex33_output.txt

The result is ex33_output.txt

-top-

Example 34: Create a full libnucnet structure (network plus zones) and print out mass fractions for a zone chosen by its labels.

libnucnet routines demonstrated in example34.c are:

To run example34, type the following on the command line:


./example34 ../../data_pub/example_net.xml ../../data_pub/initial_mass_fractions_3d.xml x1 y1 z1 > ex34_output.txt

The result is ex34_output.txt

-top-

Example 35: Create a full libnucnet structure (network plus zones) and print out mass fractions for a given species in all zones.

libnucnet routines demonstrated in example35.c are:

To run example35, type the following on the command line:


./example35 ../../data_pub/example_nuc.xml ../../data_pub/initial_mass_fractions_stooges.xml he4 > ex35_output.txt

The result is ex35_output.txt

-top-

Example 36: Create a zone mass fractions file from a Rauscher et al. (2002) stellar model data file.

libnucnet routines demonstrated in example36.c are:

To run example36, type the following on the command line:


./example36 ../../data_pub/star_read_nuc.xml ../../data_pub/star_data.txt ex36_output.xml

The result is ex36_output.xml

-top-

Example 37: 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 example37.c are:

To run example37, type the following on the command line:


./example37 ../../data_pub/star_read_nuc.xml ../../data_pub/s25a28d_expl.xml "[(@label1 >= '214' and @label1 <= '216') or @label1 = 'wind']" "[ z <= 30 ]" ex37_output.xml

The result is ex37_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:


./example37 ../../data_pub/star_read_nuc.xml ../../data_pub/s25a28d_expl.xml "[mass_fractions/nuclide[@name='fe60' and x > 1.e-10]]" "[ z <= 30 ]" ex37_output_xpath2.xml

The result is ex37_output_xpath2.xml

-top-

Example 38: Average the abundances in the zones.

libnucnet routines demonstrated in example38.c are:

To run example38, type the following on the command line:


./example38 ../../data_pub/star_read_nuc.xml ../../data_pub/s25a28d_expl.xml ../../data_pub/average.txt ex38_output.xml

The result is ex38_output.xml

-top-

Example 39: 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 example39.c are:

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 print out the screening and reverse ratio correction factors for the zone with labels 0, 0, 0 at t9 = 1 and mass density = 1.e8 g/cc, type:


./example39 ../../data_pub/example_single_zone.xml 1. 1.e8 0 0 0 > ex39_output.txt

The result is ex39_output.txt

-top-

Example 40: Create a full libnucnet structure (network plus zones) and generate the Jacobian matrix.

libnucnet routines demonstrated in example40.c are:

To print out the Jacobian matrix for the abundances in the zone with labels 0, 0, 0 at t9 = 1 and mass density = 1000 g/cc, type:


./example40 ../../data_pub/example_single_zone.xml 0 0 0 1. 1.e3 ex40_output.txt

The result is ex40_output.txt

-top-

Example 41: 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 example41.c are:

Use a network of nuclei with Z <= 10 to 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:


./example41 ../../data_pub/example_single_zone.xml 0 0 0 10. 1.e8 0.1 10. 20 "[z <= 10]" > ex41_output.txt

The result is ex41_output.txt

-top-

Example 42: 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 example42.c are:

Use a network of nuclei with Z <= 10 to 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:


./example42 ../../data_pub/example_single_zone.xml 10. 1.e8 0.1 10. 20 "he4 + he4 + he4 -> c12 + gamma" 10 "[z <= 10]" > ex42_output.txt

The result is ex42_output.txt

-top-

Example 43: Create a full libnucnet structure (network plus zones) and run a single-zone network calculation for the input temperature, density, and initial mass fractions from text files.

libnucnet routines demonstrated in example43.c are:

Use a network of nuclei with Z <= 10 to compute the evolution of the abundances of species with initial abundances in an input file text file using a thermodynamics trajectory from an input text file evolving for 30 seconds and printing out the abundances every 20 time steps:


./example43 ../../data_pub/example_net.xml ../../data_pub/zone_ascii.txt ../../data_pub/mass_fractions.txt 30. 20 "[z <= 10]" > ex43_output.txt

The result is ex43_output.txt

-top-

Example 44: Create a full libnucnet structure (network plus zones) and run a multi-zone network calculation for the input conditions.

libnucnet routines demonstrated in example44.c are:

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:


./example44 ../../data_pub/example_1d.xml 0.01 100. 1 "[z <= 10]" > ex44_output.txt

The result is ex44_output.txt

To run without mixing, use a mixing timescale of zero:


./example44 ../../data_pub/example_1d.xml 0. 100. 1 "[z <= 10]" > ex44_no_mixing_output.txt

The result is ex44_no_mixing_output.txt

To run with only mixing, use the mix_flag to set all zone temperatures to zero:


./example44 ../../data_pub/example_1d.xml 0.1 100. 0 "[z <= 10]" > ex44_mixing_only_output.txt

The result is ex44_mixing_only_output.txt

-top-



Valid XHTML 1.1        Copyright © 2001-2012, Clemson University. All rights reserved.        Valid CSS!
Page last modified on 2009/05/18 11:28