Gyoto
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
Gyoto::Spectrum::Generic Class Reference

Spectrum emitted by an Astrobj. More...

#include <GyotoSpectrum.h>

Inheritance diagram for Gyoto::Spectrum::Generic:
Gyoto::SmartPointee Gyoto::Spectrum::BlackBody Gyoto::Spectrum::PowerLaw

List of all members.

Public Member Functions

 Generic (const std::string kind)
 Set kind in constructor.
virtual Genericclone () const
 Cloner.
const std::string getKind () const
 Get spectrum kind.
virtual double operator() (double nu) const =0
 I_nu = mySpectrum(nu), nu in Hz. Assumes optically thick regime.
virtual double operator() (double nu, double opacity, double ds) const
 I_nu in optically thin regime.
virtual double integrate (double nu1, double nu2)
virtual double integrate (double nu1, double nu2, const Spectrum::Generic *opacity, double ds)
virtual void fillElement (FactoryMessenger *fmp) const
 called from Factory
virtual void setParameter (std::string name, std::string content)
 To be called by fillElement()

Protected Types

typedef Gyoto::SmartPointer
< Gyoto::SmartPointee
Subcontractor_t (Gyoto::FactoryMessenger *)
 A subcontractor builds an object upon order from the Factory.

Protected Member Functions

void incRefCount ()
 Increment the reference counter. Warning: Don't mess with the counter.
int decRefCount ()
 Decrement the reference counter and return current value. Warning: Don't mess with the counter.
int getRefCount ()
 Get the current number of references.

Protected Attributes

std::string kind_
 e.g. constants, blackbody...

Friends

class Gyoto::SmartPointer< Gyoto::Spectrum::Generic >

Detailed Description

Spectrum emitted by an Astrobj.

Light emitted by e.g. a Star


Member Typedef Documentation

typedef Gyoto::SmartPointer<Gyoto::SmartPointee> Gyoto::SmartPointee::Subcontractor_t(Gyoto::FactoryMessenger *)
inherited

A subcontractor builds an object upon order from the Factory.

Various classes need to provide a subcontractor to be able to instanciate themselves upon order from the Factory. A subcontractor is a function (often a static member function) which accepts a pointer to a FactoryMessenger as unique parameter, communicates with the Factory using this messenger to read an XML description of the object to build, and returns this objet. SmartPointee::Subcontractor_t* is just generic enough a typedef to cast to and from other subcontractor types: Astrobj::Subcontractor_t, Metric::Subcontractor_t, Spectrum::Subcontractor_t. A subcontractor needs to be registered using the relevant Register() function: Astrobj::Register(), Metric::Register(), Spectrum::Register().


Member Function Documentation

virtual void Gyoto::Spectrum::Generic::fillElement ( FactoryMessenger fmp) const
virtual

called from Factory

Spectrum implementations should impement fillElement to save their parameters to XML and call the generic implementation to save generic parts.

Reimplemented in Gyoto::Spectrum::BlackBody, and Gyoto::Spectrum::PowerLaw.

virtual double Gyoto::Spectrum::Generic::operator() ( double  nu,
double  opacity,
double  ds 
) const
virtual

I_nu in optically thin regime.

Generic implementation assumes emissivity = opacity.

Parameters:
nufrequency in Hz
opacity,suchthat opacity*ds=optical thickness.
ds,ingeometrical units

The documentation for this class was generated from the following file: