packages/Matprop/xs/XS.cc
//---------------------------------------------------------------------------//
/*!
 * \brief Add 1-D cross sections to the database.
 */
\brief Add 1-D cross sections to the database.
\ brief Add 1 - D cross sections to the database .
void XS::add(int              matid,
             int              type,
             const OneDArray &data)
{
    REQUIRE(data.size() == d_Ng);
    REQUIRE(type < END_XS_TYPES);
    REQUIRE(d_totals.size() == END_XS_TYPES);
    REQUIRE(d_inst_totals.size() == END_XS_TYPES);
    REQUIRE(!d_inst_totals[type].count(matid));
    RCP_Vector v = Teuchos::rcp(
        new Vector(Teuchos::Copy, const_cast<double*>(data.getRawPtr()),
                   data.size()));
    d_totals[type].insert(Hash_Vector::value_type(matid, v));
    d_inst_totals[type].insert(matid);
    ENSURE(d_inst_totals[type].count(matid));
}
void XS :: add ( int matid , int type , const OneDArray & data ) { REQUIRE ( data . size ( ) == d_Ng ) ; REQUIRE ( type < END_XS_TYPES ) ; REQUIRE ( d_totals . size ( ) == END_XS_TYPES ) ; REQUIRE ( d_inst_totals . size ( ) == END_XS_TYPES ) ; REQUIRE ( ! d_inst_totals [ type ] . count ( matid ) ) ; RCP_Vector v = Teuchos :: rcp ( new Vector ( Teuchos :: Copy , const_cast < double * > ( data . getRawPtr ( ) ) , data . size ( ) ) ) ; d_totals [ type ] . insert ( Hash_Vector :: value_type ( matid , v ) ) ; d_inst_totals [ type ] . insert ( matid ) ; ENSURE ( d_inst_totals [ type ] . count ( matid ) ) ; }
\brief Add 1-D cross sections to the database.
\ brief Add 1 - D cross sections to the database .
// make a new denseVector to hold the data // insert into hash table based on type // indicate that this data has been inserted