Input Output And Templating

for exciting helium


Purpose:You will learn how to edit XML with an XML editor, use templates in order to transform xml data into visualizations. In addition, you will use XSLT for setting up numerical experiments.

Use eclipse to edit the input.xml

Exercise 1: Eclipse

Open eclipse, create a new project with the name exercises. Then create a new folder, and add a new file to that directory named input.xml. Copy the following content into that:

<?xml version="1.0" encoding="UTF-8"?>
 <input 
xsi:noNamespaceSchemaLocation="http://xml.exciting-code.org/helium/excitinginput.xsd" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > 
 
</input>

You will find an error indication on the side of the editor window. Hovering over the red error indicator on the side will show a fly out panel with an explanation of the error. Then start with typing

<

inside the input element and wait for the suggestions. Add elements until the errors are gone. See the input reference for hints if the errors are confusing.
Then add a species element to the structure element and an atom element to the species element. Then open the properties view from the window menue. This view will show the available attributes of the element the curser is on.

Visualize XML files with templates

exciting writes output data to XML files. These files can be transformed to various visualization formats using templating tools. Descriptions of the templates can be found in the template market. The templates are in the exciting/xml/ directory of the exciting distribution. There are 3 different kinds separated in these directories:

  • exciting/xml/visualizationtemplates/
  • exciting/xml/inputfileconverter/
  • exciting/xml/inputtemplates/

Exercise 2: Bandstructure

Plot a band-structure in xmgrace by transforming the XML data in bandstructure.xml using the template xmlband2agr-xsl. Instructions on how to use the template can be found here (right click - save link as …) .

  1. Use the data file Ag_bandstructure.xml to create an xmgrace file.
  2. Create character band structures by using the Ag_bandstructure_character.xml file. (right click - save link as …) This themplate does not give output to the sdtout but rather creates a couple of plot files in the working directory.

Exercise 3: DOS

Plot a DOS diagram in xmgrace.

  1. Plot the total DOS using the data for Fe4C contained in the file Fe4C1_dos.xml (right click - save link as …) .
  2. Look at some partial DOS plots.

Use the xmldos2grace-xsl template (instructions on how to use the template can be found here).

Excercise 4: 3d Plot

exciting writes 3d grid data for 3d plots in xml.

  1. Visualize the charge density of diamond (part of the exciting examples distributed with the code) by transforming the file RHO3d.xml into a xcf using plot3d2xsf.xsl. Use xcrysden for the visualization.
  2. Combine the output of xmlinput2xsf.xsl on input.xml with plot3d2xsf.xsl on RHO3d.xml and visualize both the density and the structure using xcrysden or vesta. Combine the results by concatenating the two outputs (cat file1 file2 >result).
  3. Visualize the same file with OpenDX by using plot3d2opendxscalar.xsl

How to use templates to set up numerical experiments

Exercise 5: Convergence Test

Generate the input files for a simple convergence test according to simple inputxml template, starting from the diamond example in the examples directory. After running them, collect the data and plot them.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License