packages/Matprop/xs/XS_Builder.cc
//---------------------------------------------------------------------------//
// PUBLIC FUNCTIONS
//---------------------------------------------------------------------------//
/*!
 * \brief Open an xml file of cross sections and broadcast the data.
 */
PUBLIC FUNCTIONS
\brief Open an xml file of cross sections and broadcast the data.
PUBLIC FUNCTIONS \ brief Open an xml file of cross sections and broadcast the data .
void XS_Builder::open_and_broadcast(const std_string &xml_file)
{
    d_plxs = Teuchos::rcp(new ParameterList("cross sections"));
    Teuchos::updateParametersFromXmlFileAndBroadcast(
        xml_file.c_str(), d_plxs.ptr(), *d_comm);
    CHECK(!d_plxs.is_null());
    CHECK(d_plxs->isParameter("num groups"));
    CHECK(d_plxs->isParameter("pn order"));
    d_pn_order   = d_plxs->get<int>("pn order");
    d_num_groups = d_plxs->get<int>("num groups");
    if (d_plxs->isParameter("group v"))
    {
        d_velocity = d_plxs->get<OneDArray>("group v");
        CHECK(d_velocity.size() == d_num_groups);
    }
    if (d_plxs->isParameter("bounds"))
    {
        d_bounds = d_plxs->get<OneDArray>("bounds");
        CHECK(d_bounds.size() == d_num_groups + 1);
    }
    d_matids.clear();
    for (ParameterList::ConstIterator itr = d_plxs->begin();
         itr != d_plxs->end(); ++itr)
    {
        if (d_plxs->isSublist(itr->first))
        {
            d_matids.push_back(itr->first);
        }
    }
    ENSURE(d_matids.size() > 0);
}
void XS_Builder :: open_and_broadcast ( const std_string & xml_file ) { d_plxs = Teuchos :: rcp ( new ParameterList ( " " ) ) ; Teuchos :: updateParametersFromXmlFileAndBroadcast ( xml_file . c_str ( ) , d_plxs . ptr ( ) , * d_comm ) ; CHECK ( ! d_plxs . is_null ( ) ) ; CHECK ( d_plxs -> isParameter ( " " ) ) ; CHECK ( d_plxs -> isParameter ( " " ) ) ; d_pn_order = d_plxs -> get < int > ( " " ) ; d_num_groups = d_plxs -> get < int > ( " " ) ; if ( d_plxs -> isParameter ( " " ) ) { d_velocity = d_plxs -> get < OneDArray > ( " " ) ; CHECK ( d_velocity . size ( ) == d_num_groups ) ; } if ( d_plxs -> isParameter ( " " ) ) { d_bounds = d_plxs -> get < OneDArray > ( " " ) ; CHECK ( d_bounds . size ( ) == d_num_groups + 1 ) ; } d_matids . clear ( ) ; for ( ParameterList :: ConstIterator itr = d_plxs -> begin ( ) ; itr != d_plxs -> end ( ) ; ++ itr ) { if ( d_plxs -> isSublist ( itr -> first ) ) { d_matids . push_back ( itr -> first ) ; } } ENSURE ( d_matids . size ( ) > 0 ) ; }
PUBLIC FUNCTIONS
 \brief Open an xml file of cross sections and broadcast the data.
PUBLIC FUNCTIONS \ brief Open an xml file of cross sections and broadcast the data .
// make the new parameterlist // read the data on every domain // assign number of groups and pn order // get the group velocities if they are on the file // get the group bounds if they are on the file // get the materials in the file