[Trilinos-Users] A question about ParamerList names and the XML name attribute

Lori Pritchett-Sheats lpritch at lanl.gov
Thu Apr 7 09:48:44 MDT 2011


I've been playing around with sample code based on the cxx_main.cpp 
program in the ParameterList test directory and I noticed that I can not 
set an XML  name attribute for a ParameterList object but I can set an 
XML name attribute for a sublist of a ParameterList object. Why?

Here's my code snippet based on cxx_main.cpp

    ParameterList Sample("Sample Parameter List");
  
    Sample.set("Parameter 1",1);
    Sample.set("Parameter 2", "some kind of string");
    Sample.set("Parameter 3", 1.23456789E-10);
    ParameterList& SB_1 = Sample.sublist("Sublist 1");

    SB_1.set("Num of iterations", 100);
    SB_1.set("Tolerance", 1.000E-6);
    writeParameterListToXmlFile(Sample,"Sample.xml");

and this is what I see in the XML file Sample.xml

<ParameterList>
  <Parameter name="Parameter 1" type="int" value="1"/>
  <Parameter name="Parameter 2" type="string" value="some kind of string"/>
  <Parameter name="Parameter 3" type="double" value="1.23457e-10"/>
  <ParameterList name="Sublist 1">
    <Parameter name="Num of iterations" type="int" value="100"/>
    <Parameter name="Tolerance" type="double" value="1e-06"/>
  </ParameterList>
</ParameterList>

I expected to see '<ParameterList name="Sample Parameter List">' in the 
first tag. 

Is there a way to do that?


-- 
Lori A. Pritchett-Sheats, PhD.
CCS-2, Computational Physics and Methods
Office: 505-665-6675
Fax: 505-665-4972

Los Alamos National Laboratory
P.O. Box 1663
MS D413
Los Alamos, NM 87544




More information about the Trilinos-Users mailing list