src/compton_interface/CSK_Interface.cc
CSK_Interface::CSK_Interface(const std::string &filehandle, const std::vector<double> &grp_bds,
                             const std::string &opac_type, const std::string &wt_func,
                             const bool induced, const bool det_bal, const size_t nxi) {

  // Check input validity
  Require(std::ifstream(filehandle).good());
  Require(grp_bds.size() > 0);

  if (rtt_c4::node() == 0) {
    std::cout << "*********************************************************\n"
              << "WARNING! Building a multigroup library from scratch might\n"
              << " take a LOOOOOOONG time! (Don't say I didn't warn you.)  \n"
              << "*********************************************************\n"
              << std::endl;
  }

  // do quick sanity check
  if (det_bal) {
    // if we're enforcing detailed balance, we need induced and wt_func to be set to
    // <0,"wien">||<1,"planck">; these are the only valid cases
    Insist(((!induced && wt_func == std::string("wien")) ||
            (induced && wt_func == std::string("planck"))),
           "CSK_Interface error: Detailed balance enforcement (det_bal = 1) \n"
           "only valid for induced=0 w/wien -OR- induced=1 w/planck!");
  }

  // make a group_data struct to pass to the lib builder:
  multigroup::Group_data grp_data = {multigroup::Library_type::EXISTING,
                                     multigroup::string_to_opac_type(opac_type),
                                     multigroup::string_to_wt_func(wt_func),
                                     induced,
                                     det_bal,
                                     filehandle,
                                     nxi,
                                     grp_bds};

  // Construct a multigroup library builder:
  multigroup_lib_builder MG_builder(grp_data, rtt_c4::node());

  // build the library:
  MG_builder.build_library();

  // initialize the electron temperature interpolator with the mg compton data
  ei = std::make_unique<etemp_interp>(MG_builder.package_data());

  // Make sure the SP exists...
  Ensure(ei);
}
//------------------------------------------------------------------------------------------------//
/*!
 * \brief Constructor for an existing pointwise file and a multigroup structure.
 *
 * In the .hh file, we default the number of angular evals (n_xi) to zero This causes the CSK
 * routines to use the full angular fidelity of the library if no n_xi argument is passed
 *
 * This calls CSK_generator methods to read the pointwise library and construct a multigroup
 * CSK_Interface data object, a smart pointer to which is then passed to (and held by) the
 * CSK_generator etemp_interp class.
 *
 * \param[in] filehandle The name of the pointwise lib to build MG data from
 * \param[in] grp_bds    A vector containing the multigroup bounds (in keV)
 * \param[in] opac_type The type of opacity to build. Valid options for CSK v0.3 are "jayenne" (for
 *                       IMC-style opacities) or "capsaicin" (for Sn-style opacities). Any other
 *                       string will cause CSK to throw an exception
 * \param[in] wt_func The frequency weighting function used to numerically integrate the
 *                       opacities. Valid options for CSK v0.2 are "flat", "wien" or "planck." Any
 *                       other string will cause CSK to throw an exception.
 * \param[in] induced    Bool to toggle consideration of induced effects off/on
 * \param[in] det_bal    Bool to toggle detailed balance enforcement off/on
 * \param[in] nxi        The number of angular points/Legendre moments desired
 */
\brief Constructor for an existing pointwise file and a multigroup structure.
In the .hh file, we default the number of angular evals (n_xi) to zero This causes the CSK
routines to use the full angular fidelity of the library if no n_xi argument is passed

This calls CSK_generator methods to read the pointwise library and construct a multigroup
CSK_Interface data object, a smart pointer to which is then passed to (and held by) the
CSK_generator etemp_interp class.

\param[in] filehandle The name of the pointwise lib to build MG data from
\param[in] grp_bds    A vector containing the multigroup bounds (in keV)
\param[in] opac_type The type of opacity to build. Valid options for CSK v0.3 are "jayenne" (for
IMC-style opacities) or "capsaicin" (for Sn-style opacities). Any other
string will cause CSK to throw an exception
\param[in] wt_func The frequency weighting function used to numerically integrate the
opacities.
\ brief Constructor for an existing pointwise file and a multigroup structure . In the . hh file we default the number of angular evals ( n_xi ) to zero This causes the CSK routines to use the full angular fidelity of the library if no n_xi argument is passed This calls CSK_generator methods to read the pointwise library and construct a multigroup CSK_Interface data object a smart pointer to which is then passed to ( and held by ) the CSK_generator etemp_interp class . \ param [ in ] filehandle The name of the pointwise lib to build MG data from \ param [ in ] grp_bds A vector containing the multigroup bounds ( in keV ) \ param [ in ] opac_type The type of opacity to build . Valid options for CSK v0 . 3 are " jayenne " ( for IMC - style opacities ) or " capsaicin " ( for Sn - style opacities ) . Any other string will cause CSK to throw an exception \ param [ in ] wt_func The frequency weighting function used to numerically integrate the opacities .
CSK_Interface::CSK_Interface(const std::string &filehandle, const std::vector<double> &grp_bds,
                             const std::string &opac_type, const std::string &wt_func,
                             const bool induced, const bool det_bal, const size_t nxi) {
  Require(std::ifstream(filehandle).good());
  Require(grp_bds.size() > 0);
  if (rtt_c4::node() == 0) {
    std::cout << "*********************************************************\n"
              << "WARNING! Building a multigroup library from scratch might\n"
              << " take a LOOOOOOONG time! (Don't say I didn't warn you.)  \n"
              << "*********************************************************\n"
              << std::endl;
  }
  if (det_bal) {
    Insist(((!induced && wt_func == std::string("wien")) ||
            (induced && wt_func == std::string("planck"))),
           "CSK_Interface error: Detailed balance enforcement (det_bal = 1) \n"
           "only valid for induced=0 w/wien -OR- induced=1 w/planck!");
  }
  multigroup::Group_data grp_data = {multigroup::Library_type::EXISTING,
                                     multigroup::string_to_opac_type(opac_type),
                                     multigroup::string_to_wt_func(wt_func),
                                     induced,
                                     det_bal,
                                     filehandle,
                                     nxi,
                                     grp_bds};
  multigroup_lib_builder MG_builder(grp_data, rtt_c4::node());
  MG_builder.build_library();
  ei = std::make_unique<etemp_interp>(MG_builder.package_data());
  Ensure(ei);
}
CSK_Interface :: CSK_Interface ( const std :: string & filehandle , const std :: vector < double > & grp_bds , const std :: string & opac_type , const std :: string & wt_func , const bool induced , const bool det_bal , const size_t nxi ) { Require ( std :: ifstream ( filehandle ) . good ( ) ) ; Require ( grp_bds . size ( ) > 0 ) ; if ( rtt_c4 :: node ( ) == 0 ) { std :: cout << " \n " << " \n " << " \n " << " \n " << std :: endl ; } if ( det_bal ) { Insist ( ( ( ! induced && wt_func == std :: string ( " " ) ) || ( induced && wt_func == std :: string ( " " ) ) ) , " \n " " " ) ; } multigroup :: Group_data grp_data = { multigroup :: Library_type :: EXISTING , multigroup :: string_to_opac_type ( opac_type ) , multigroup :: string_to_wt_func ( wt_func ) , induced , det_bal , filehandle , nxi , grp_bds } ; multigroup_lib_builder MG_builder ( grp_data , rtt_c4 :: node ( ) ) ; MG_builder . build_library ( ) ; ei = std :: make_unique < etemp_interp > ( MG_builder . package_data ( ) ) ; Ensure ( ei ) ; }
\brief Constructor for an existing pointwise file and a multigroup structure.
\ brief Constructor for an existing pointwise file and a multigroup structure .
// Check input validity // do quick sanity check // if we're enforcing detailed balance, we need induced and wt_func to be set to // <0,"wien">||<1,"planck">; these are the only valid cases // make a group_data struct to pass to the lib builder: // Construct a multigroup library builder: // build the library: // initialize the electron temperature interpolator with the mg compton data // Make sure the SP exists...