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

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

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

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

    // define opacity
    *sig = analytic_model->calculate_opacity(*T, density);

    Check(*sig >= 0.0);
  }

  return opacity;
}
//------------------------------------------------------------------------------------------------//
/*!
 * \brief Return a field of opacities given a field of temperatures and a
 * scalar density.
 *
 * Given a field of temperatures and a scalar density, 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 temperature field.
 *
 * The field type for temperatures is an std::vector.
 *
 * \param temperature std::vector of material temperatures in keV
 * \param density material density in g/cm^3
 * \return std::vector of opacities (coefficients) in cm^2/g
 */
\brief Return a field of opacities given a field of temperatures and a
scalar density.

Given a field of temperatures and a scalar density, 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 temperature field.

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

\param temperature std::vector of material temperatures in keV
\param density material density in g/cm^3
\return std::vector of opacities (coefficients) in cm^2/g
\ brief Return a field of opacities given a field of temperatures and a scalar density . Given a field of temperatures and a scalar density 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 temperature field . The field type for temperatures is an std :: vector . \ param temperature std :: vector of material temperatures in keV \ param density material density in g / cm^3 \ return std :: vector of opacities ( coefficients ) in cm^2 / g
Analytic_Gray_Opacity::sf_double Analytic_Gray_Opacity::getOpacity(const sf_double &temperature,
                                                                   double density) const {
  Require(density >= 0.0);
  sf_double opacity(temperature.size(), 0.0);
  auto sig = opacity.begin();
  for (auto T = temperature.begin(); T != temperature.end(); T++, sig++) {
    Check(*T >= 0.0);
    *sig = analytic_model->calculate_opacity(*T, density);
    Check(*sig >= 0.0);
  }
  return opacity;
}
Analytic_Gray_Opacity :: sf_double Analytic_Gray_Opacity :: getOpacity ( const sf_double & temperature , double density ) const { Require ( density >= 0.0 ) ; sf_double opacity ( temperature . size ( ) , 0.0 ) ; auto sig = opacity . begin ( ) ; for ( auto T = temperature . begin ( ) ; T != temperature . end ( ) ; T ++ , sig ++ ) { Check ( * T >= 0.0 ) ; * sig = analytic_model -> calculate_opacity ( * T , density ) ; Check ( * sig >= 0.0 ) ; } return opacity ; }
\brief Return a field of opacities given a field of temperatures and a
 scalar density.
\ brief Return a field of opacities given a field of temperatures and a scalar density .
// define the return opacity field (same size as temperature field) // define an opacity iterator // loop through temperatures and solve for opacity // define opacity