src/cdi_analytic/Analytic_Gray_Opacity.cc
Analytic_Gray_Opacity::sf_double Analytic_Gray_Opacity::getOpacity(double temperature,
                                                                   const sf_double &density) const {
  Require(temperature >= 0.0);

  // define the return opacity field (same size as density field)
  sf_double opacity(density.size(), 0.0);

  // define an opacity iterator
  auto sig = opacity.begin();

  // loop through densities and solve for opacity
  for (auto rho = density.begin(); rho != density.end(); rho++, sig++) {
    Check(*rho >= 0.0);

    // define opacity
    *sig = analytic_model->calculate_opacity(temperature, *rho);

    Check(*sig >= 0.0);
  }

  return opacity;
}
//------------------------------------------------------------------------------------------------//
/*!
 * \brief Return a field of opacities given a field of densities and a scalar
 * temperature.
 *
 * Given a field of densities and a scalar temperature, return an opacity
 * field for the reaction type specified by the constructor.  The analytic
 * opacity model is specified in the constructor
 * (Analytic_Gray_Opacity()).  The returned opacity field has the same number
 * of elements as the density field.
 *
 * The field type for densities is an std::vector.
 *
 * \param temperature material temperature in keV
 * \param density std::vector of material densities in g/cc
 * \return std::vector of opacities (coefficients) in cm^2/g
 */
\brief Return a field of opacities given a field of densities and a scalar
temperature.

Given a field of densities and a scalar temperature, return an opacity
field for the reaction type specified by the constructor.  The analytic
opacity model is specified in the constructor
(Analytic_Gray_Opacity()).  The returned opacity field has the same number
of elements as the density field.

The field type for densities is an std::vector.

\param temperature material temperature in keV
\param density std::vector of material densities in g/cc
\return std::vector of opacities (coefficients) in cm^2/g
\ brief Return a field of opacities given a field of densities and a scalar temperature . Given a field of densities and a scalar temperature return an opacity field for the reaction type specified by the constructor . The analytic opacity model is specified in the constructor ( Analytic_Gray_Opacity () ) . The returned opacity field has the same number of elements as the density field . The field type for densities is an std :: vector . \ param temperature material temperature in keV \ param density std :: vector of material densities in g / cc \ return std :: vector of opacities ( coefficients ) in cm^2 / g
Analytic_Gray_Opacity::sf_double Analytic_Gray_Opacity::getOpacity(double temperature,
                                                                   const sf_double &density) const {
  Require(temperature >= 0.0);
  sf_double opacity(density.size(), 0.0);
  auto sig = opacity.begin();
  for (auto rho = density.begin(); rho != density.end(); rho++, sig++) {
    Check(*rho >= 0.0);
    *sig = analytic_model->calculate_opacity(temperature, *rho);
    Check(*sig >= 0.0);
  }
  return opacity;
}
Analytic_Gray_Opacity :: sf_double Analytic_Gray_Opacity :: getOpacity ( double temperature , const sf_double & density ) const { Require ( temperature >= 0.0 ) ; sf_double opacity ( density . size ( ) , 0.0 ) ; auto sig = opacity . begin ( ) ; for ( auto rho = density . begin ( ) ; rho != density . end ( ) ; rho ++ , sig ++ ) { Check ( * rho >= 0.0 ) ; * sig = analytic_model -> calculate_opacity ( temperature , * rho ) ; Check ( * sig >= 0.0 ) ; } return opacity ; }
\brief Return a field of opacities given a field of densities and a scalar
 temperature.
\ brief Return a field of opacities given a field of densities and a scalar temperature .
// define the return opacity field (same size as density field) // define an opacity iterator // loop through densities and solve for opacity // define opacity