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 liblvls 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 1: Read a level data ascii file and output to liblvls xml file.

liblvls routines demonstrated in example1.c are:

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


./example1 ../../data_pub/levels.txt ex1_output.xml

The result is ex1_output.xml

-top-

Example 2: Print out level data for species included in an XML file.

liblvls routines demonstrated in example2.c are:

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


./example2 ../../data_pub/spcoll.xml > ex2_output.txt

The result is ex2_output.txt

It is also possible to retrieve the XML level data from a remote host over the web. For example, to retrieve the level data from the webnucleo server, type:


./example2 http://www.webnucleo.org/home/modules/liblvls/0.1/data_pub/spcoll.xml > ex2_output_web.txt

The result is ex2_output_web.txt

-top-

Example 3: Read in level data from an XML file, create a Liblvls structure, and print out data for the levels for a given species in the selected units.

liblvls routines demonstrated in example3.c are:

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


./example3 ../../data_pub/spcoll.xml al26 keV > ex3_output.txt

The result is ex3_output.txt

It is possible to use liblvls for atomic or molecular level data as well as nuclear. For example, to view data for neutral helium (He I), type:


./example3 ../../data_pub/he_i.xml "He I" eV > ex3_output_atomic.txt

The result is ex3_output_atomic.txt

-top-

Example 4: Read in level data from an XML file, create a Liblvls structure, and compute the partition function for each species at the input temperature.

liblvls routines demonstrated in example4.c are:

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


./example4 ../../data_pub/spcoll.xml 5.e8 > ex4_output.txt

The result is ex4_output.txt

-top-

Example 5: Read in level data from an XML file, create a Liblvls structure, and compute the partition function for the input species at a variety of temperatures.

liblvls routines demonstrated in example5.c are:

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


./example5 ../../data_pub/spcoll.xml al26 > ex5_output.txt

The result is ex5_output.txt

-top-

Example 6: Read in level data from an XML file, create a Liblvls structure, and compute the equilibrium probabilities for the input species at the input temperature.

liblvls routines demonstrated in example6.c are:

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


./example6 ../../data_pub/spcoll.xml al26 1.5e9 > ex6_output.txt

The result is ex6_output.txt

-top-

Example 7: Read in level data from an XML file, create a Liblvls structure, and compute the Einstein coefficients between two levels for the given species.

liblvls routines demonstrated in example7.c are:

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


./example7 ../../data_pub/spcoll.xml al26 7 2 > ex7_output.txt

The result is ex7_output.txt

-top-

Example 8: Read in level data from an XML file, create a Liblvls structure, and compute the transition rates between two levels for the given species at the given temperature.

liblvls routines demonstrated in example8.c are:

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


./example8 ../../data_pub/spcoll.xml al26 2.e9 7 2 > ex8_output.txt

The result is ex8_output.txt

-top-

Example 9: Read in level data from an XML file, create a Liblvls structure, and compute the rate matrix for the given species at the given temperature.

liblvls routines demonstrated in example9.c are:

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


./example9 ../../data_pub/spcoll.xml al26 1.e9 ex9_output.txt

The result is ex9_output.txt

-top-

Example 10: Read in level data from XML file(s), create a Liblvls structure, and print the input probabilities for a given species for a given zone.

liblvls routines demonstrated in example10.c are:

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


./example10 ../../data_pub/spcoll.xml ../../data_pub/zone_data.xml al26 1 0 0 > ex10_output.txt

The result is ex10_output.txt

The species collection and zone data XML files may be combined into a single liblvls input file. Use xsltproc (which you should have installed as described in the compile tutorial):


xsltproc --stringparam zone_doc ../data_pub/zone_data.xml ../../xsl_pub/merge.xsl ../../data_pub/spcoll.xml > ../../data_pub/levels.xml

The new liblvls XML input file may be used in place of the species collection and zone data files:


./example10 ../../data_pub/levels.xml al26 1 0 0 > ex10_output_combined.txt

The result is ex10_output_combined.txt

-top-

Example 11: Read in level data from an XML file, create a Liblvls structure, and evolve the level probabilities in the input zone for the input time, using the temperature given in the optional properties for the zone.

liblvls routines demonstrated in example11.c are:

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


./example11 ../../data_pub/levels.xml al26 1. 2 0 0 > ex11_output.txt

The result is ex11_output.txt

-top-

Example 12: Run a multi-zone level probability evolution calculation for for the input species for the given duration and mixing time between zones, using the temperatures given in the optional properties for the zones.

liblvls routines demonstrated in example12.c are:

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


./example12 ../../data_pub/levels.xml al26 1. 0.1 > ex12_output.txt

The result is ex12_output.txt

-top-

Example 13: Read in a liblvls input file and calculate transition rates for any down-transitions that do not exist in the file, then write this new data to an xml file.

liblvls routines demonstrated in example13.c are:

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


./example13 ../../data_pub/levels.xml ex13_output.xml

The result is ex13_output.xml

-top-

Example 14: Read in a liblvls input file and calculate the rates of photonic and collisional excitation between two provided levels using a temperature and hydrogen number density provided as optional zone properties.

liblvls routines demonstrated in example14.c are:

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


./example14 ../../data_pub/CO_data.xml 11 0 3 0 0 > ex14_output.txt

The result is ex14_output.txt

-top-



Valid XHTML 1.1        Copyright © 2001-2012, Clemson University. All rights reserved.        Valid CSS!
Page last modified on 2008/10/01 11:15