GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
GOAT::raytracing::LightSrcGauss Class Reference

This class describes a focused gaussian beam. More...

#include <lightsrc.h>

Inheritance diagram for GOAT::raytracing::LightSrcGauss:
GOAT::raytracing::LightSrc GOAT::raytracing::LightSrcGauss_mc

Public Member Functions

double area ()
 area A of the light source \( A=d^2\)
void binReadItem (std::ifstream &is)
 reads content of LightSrc from a binary file, represented by os (has to be specified by the derived classes)
void binWriteItem (std::ofstream &os)
 writes content of LightSrc in a binary file, represented by is (has to be specified by the derived classes)focuspos
void calcNormfak ()
std::complex< double > calcStartPhase (maths::Vector< double > P)
double calcw (double z)
double calcz0 ()
 recalculates Rayleigh-length z0
maths::Vector< double > getFocuspos ()
 returns the position of the focus
double getNA ()
 returns numerical aperture
 LightSrcGauss (const LightSrcGauss &)
 LightSrcGauss (maths::Vector< double > Pos, int N, double wvl, double w0, maths::Vector< double > focuspos, double D=1.0, maths::Vector< std::complex< double > > Pol=maths::Vector< std::complex< double > >(0.0, 1.0, 0.0), int raytype=LIGHTSRC_RAYTYPE_IRAY, double r0=1.0)
 Main constructor for gaussian beam light source The direction of the beam is given by the starting point and the focus position.
 LightSrcGauss (void)
int next (GOAT::raytracing::RayBase *ray)
int next (IRay &S)
int next (Ray_pow &S)
int next (tubedRay &S)
void reset ()
void setFocuspos (maths::Vector< double > fp)
 sets the focus position to fp
void setk (maths::Vector< double > k)
 sets the main direction of light source
void setNA (double na)
 sets the numerical aperture NA and recalculates the width D, the focal beam waist w0 and the Rayleigh-length z0
void setPos (maths::Vector< double > pos)
 sets the position of the light source to pos
void setW0 (double w0)
 sets the beam's waist
void setWvl (double wvl)
 sets the vacuum wavelength
Public Member Functions inherited from GOAT::raytracing::LightSrc
void addObject (ObjectShape *obj)
 add single object to the object list
void adjustDirection ()
void binRead (std::ifstream &is)
 writes content of LightSrc in a binary file, represented by is
void binWrite (std::ofstream &os)
 reads content of LightSrc from a binary file, represented by os
void clearObjects ()
 clear object list
double getDensity ()
 returns the ray density, i.e. the number of rays per unit length (=D/N)
maths::Vector< std::complex< double > > getInitPol ()
double getIsum1 ()
double getIsum2 ()
maths::Vector< double > getk ()
 returns the main direction of the light source
int getNumObjs ()
 returns the number of Objects (only needed, when used seperately outside scene)
int getNumRays ()
 returns the number of rays (per direction in space)
int getNumRaysRT ()
ObjectShapegetObject (int i)
 returns i-th item in the object list
maths::Vector< double > getPos ()
 returns the position of the light source. This is the center of the square area of the light source
double getWavelength ()
double getWavenumber ()
 LightSrc ()
 LightSrc (const LightSrc &)
 Copy constructor.
void ObjectList (int Anz, std::vector< ObjectShape * > Obj)
int rayType ()
 returns the current ray type
void removeObject (ObjectShape *obj)
 remove object from the object list
void reset ()
 Reset everything (counting starts from the beginning)
void setD (double D)
 sets the width of the light source (this resets also the ray counter)
void setD (double D1, double D2)
void setk (const maths::Vector< double > &k)
 sets the main direction of the light source
void setN0 (std::complex< double > n0)
 sets the complex valued refractive index of the intermediate medium
void setNumRays (int N)
void setNumRaysRT (int numRaysRT)
void setObject (ObjectShape *O, int i=-1)
 exchanges i-th object in the object list
void setPol (maths::Vector< std::complex< double > > pol)
 sets the polarisation
void setPos (maths::Vector< double > P)
 sets the position of the light source. This is the center of the square area of the light source
void setR0 (double r0)
 sets the radius of the calculation sphere
void setWavelength (double wvl)
void setWavenumber (double k0)
 ~LightSrc (void)

Public Attributes

double f
 distance between light source area and the focal point
maths::Vector< double > focuspos
 focal position
double NA
 numerical aperture (normalized by the intermediate refractive index)
std::complex< double > Normfak
double R
 curvature
double w
 radius of the beam (for internal use only)
double w0
 Waist diameter (fictitious !), only used for the correct calculation of the electric field distribution within the starting area.
double z0
 Rayleigh length (for internal use only)
double zeta
 Gouy phase.
Public Attributes inherited from GOAT::raytracing::LightSrc
double D
 width of the square light source area
double D1
double D2
 width in the e1- and the e2-direction (used only for _mc versions of LightSrc)
double density
 ray density, i.e. distance between two neighboring rays
maths::Vector< double > e1
maths::Vector< double > e2
 unit vectors that span the light source area
int i1
 first index of the ray inside the starting area (for internal use, -1 if the calculation has not yet been started)
int i2
 second index of the ray inside the starting area (for internal use, -1 if the calculation has not yet been started)
maths::Vector< std::complex< double > > initPol
 Polarisation, if the k-Vector points in z-direction.
maths::Vector< double > k
 main direction of the light source
int N =10000
 number of rays (per direction)
std::complex< double > n0
 refractive index of the intermediate medium
int numObjs
 number of objects
std::vector< ObjectShape * > Obj
 list of all objects
double P0 =1.0
 power
double Pall
 overall Power
maths::Vector< std::complex< double > > Pol
 polarisation (default: (0.0, 1.0, 0.0)
maths::Vector< std::complex< double > > Pol2
 second polarisation (used by IRay)
int polType
 Polarisationsrichtung (s.o.)
maths::Vector< double > Pos
 position of the light source (center of the square area of the light source)
double r0 =1.0
 radius of the calculation sphere
int rayCounter =0
int raytype
 Strahltyp : ray oder ISTRAHL (=RAY oder IRAY)
bool suppress_phase_progress = false
 if set true, the phase won't be changed when calling a next method (needed for USP-calculations)
int type
 type of the light source

Additional Inherited Members

Protected Attributes inherited from GOAT::raytracing::LightSrc
double Isum1
double Isum2
double k0
 wavenumber (i.e. \( \frac{2\pi}{\lambda}\)
int numRaysRT =20
 used in GOATvis to determine number of rays for ray representation
maths::Vector< double > rotVec =maths::Vector<double>(1,0,0)
 Vector which holds the spherical coordinates \(r\), \(\vartheta\) and \(\varphi\) of the direction vector k.
double wvl =1
 wavelength

Detailed Description

This class describes a focused gaussian beam.

Class which describes a focused gaussian light source. The main direction is given by the source position and the focal position. The electric field is calculated by \(\vec{E}(ar,z)=\vec{E}_0\frac{w_0}{w(z)}\cdot e^{\frac{r^2}{w^2(z)}}\cdot e^{-ik\frac{r^2}{2R(z)}}\cdot e^{i(\zeta(z)-kz)}\) The waist of the beam is only used for the correct electric field distribution within the starting area. Since we are working with geometrical optics the rays follow straight lines inside the medium.

Definition at line 282 of file lightsrc.h.

Constructor & Destructor Documentation

◆ LightSrcGauss() [1/3]

GOAT::raytracing::LightSrcGauss::LightSrcGauss ( void )

◆ LightSrcGauss() [2/3]

GOAT::raytracing::LightSrcGauss::LightSrcGauss ( const LightSrcGauss & )

◆ LightSrcGauss() [3/3]

GOAT::raytracing::LightSrcGauss::LightSrcGauss ( maths::Vector< double > Pos,
int N,
double wvl,
double w0,
maths::Vector< double > focuspos,
double D = 1.0,
maths::Vector< std::complex< double > > Pol = maths::Vector< std::complex< double > >(0.0, 1.0, 0.0),
int raytype = LIGHTSRC_RAYTYPE_IRAY,
double r0 = 1.0 )

Main constructor for gaussian beam light source The direction of the beam is given by the starting point and the focus position.

Parameters
PosStarting position of the beam (center)
Nnumber of rays (per direction)
wvlwavelength
w0waist radius (virtual, only needed to calculate the electric field distribution correctly)
focusposPosition of the focus
DSize of starting area (side length)
PolPolarisation (on the starting area, at the axis of the beam)
raytype(type of ray used for the calculation)
r0Radius of the calculation sphere

Member Function Documentation

◆ area()

double GOAT::raytracing::LightSrcGauss::area ( )
inlinevirtual

area A of the light source \( A=d^2\)

Reimplemented from GOAT::raytracing::LightSrc.

Definition at line 308 of file lightsrc.h.

◆ binReadItem()

void GOAT::raytracing::LightSrcGauss::binReadItem ( std::ifstream & os)
virtual

reads content of LightSrc from a binary file, represented by os (has to be specified by the derived classes)

Implements GOAT::raytracing::LightSrc.

◆ binWriteItem()

void GOAT::raytracing::LightSrcGauss::binWriteItem ( std::ofstream & os)
virtual

writes content of LightSrc in a binary file, represented by is (has to be specified by the derived classes)focuspos

Implements GOAT::raytracing::LightSrc.

◆ calcNormfak()

void GOAT::raytracing::LightSrcGauss::calcNormfak ( )
inline

Definition at line 356 of file lightsrc.h.

◆ calcStartPhase()

std::complex< double > GOAT::raytracing::LightSrcGauss::calcStartPhase ( maths::Vector< double > P)

◆ calcw()

double GOAT::raytracing::LightSrcGauss::calcw ( double z)
inline
Parameters
zcalculates the beam waist of the light beam at the distance z from the focal point, returns the value and sets the corrsponding local variable w (needed for next(), only for internal use)

Definition at line 348 of file lightsrc.h.

◆ calcz0()

double GOAT::raytracing::LightSrcGauss::calcz0 ( )
inline

recalculates Rayleigh-length z0

Definition at line 317 of file lightsrc.h.

◆ getFocuspos()

maths::Vector< double > GOAT::raytracing::LightSrcGauss::getFocuspos ( )
inline

returns the position of the focus

Definition at line 310 of file lightsrc.h.

◆ getNA()

double GOAT::raytracing::LightSrcGauss::getNA ( )
inline

returns numerical aperture

Definition at line 367 of file lightsrc.h.

◆ next() [1/4]

int GOAT::raytracing::LightSrcGauss::next ( GOAT::raytracing::RayBase * ray)
virtual

These functions return the next ray of the light source for further calculations

Parameters
raynext ray
Return values
LIGHTSRC_NOT_LAST_RAY,ifray is not the last ray, LIGHTSRC_IS_LAST_RAY, if the ray is the last ray or LIGHTSRC_ERROR if an error occured

Implements GOAT::raytracing::LightSrc.

◆ next() [2/4]

int GOAT::raytracing::LightSrcGauss::next ( IRay & S)
virtual

◆ next() [3/4]

int GOAT::raytracing::LightSrcGauss::next ( Ray_pow & S)
virtual

◆ next() [4/4]

int GOAT::raytracing::LightSrcGauss::next ( tubedRay & S)
virtual

◆ reset()

void GOAT::raytracing::LightSrcGauss::reset ( )
inline

Definition at line 319 of file lightsrc.h.

◆ setFocuspos()

void GOAT::raytracing::LightSrcGauss::setFocuspos ( maths::Vector< double > fp)
inline

sets the focus position to fp

Definition at line 311 of file lightsrc.h.

◆ setk()

void GOAT::raytracing::LightSrcGauss::setk ( maths::Vector< double > k)

sets the main direction of light source

◆ setNA()

void GOAT::raytracing::LightSrcGauss::setNA ( double na)

sets the numerical aperture NA and recalculates the width D, the focal beam waist w0 and the Rayleigh-length z0

◆ setPos()

void GOAT::raytracing::LightSrcGauss::setPos ( maths::Vector< double > pos)
inline

sets the position of the light source to pos

Definition at line 312 of file lightsrc.h.

◆ setW0()

void GOAT::raytracing::LightSrcGauss::setW0 ( double w0)
inline

sets the beam's waist

Definition at line 309 of file lightsrc.h.

◆ setWvl()

void GOAT::raytracing::LightSrcGauss::setWvl ( double wvl)

sets the vacuum wavelength

Member Data Documentation

◆ f

double GOAT::raytracing::LightSrcGauss::f

distance between light source area and the focal point

Definition at line 366 of file lightsrc.h.

◆ focuspos

maths::Vector<double> GOAT::raytracing::LightSrcGauss::focuspos

focal position

Definition at line 370 of file lightsrc.h.

◆ NA

double GOAT::raytracing::LightSrcGauss::NA

numerical aperture (normalized by the intermediate refractive index)

Definition at line 374 of file lightsrc.h.

◆ Normfak

std::complex<double> GOAT::raytracing::LightSrcGauss::Normfak

Definition at line 369 of file lightsrc.h.

◆ R

double GOAT::raytracing::LightSrcGauss::R

curvature

Definition at line 376 of file lightsrc.h.

◆ w

double GOAT::raytracing::LightSrcGauss::w

radius of the beam (for internal use only)

Definition at line 373 of file lightsrc.h.

◆ w0

double GOAT::raytracing::LightSrcGauss::w0

Waist diameter (fictitious !), only used for the correct calculation of the electric field distribution within the starting area.

Definition at line 365 of file lightsrc.h.

◆ z0

double GOAT::raytracing::LightSrcGauss::z0

Rayleigh length (for internal use only)

Definition at line 371 of file lightsrc.h.

◆ zeta

double GOAT::raytracing::LightSrcGauss::zeta

Gouy phase.

Definition at line 375 of file lightsrc.h.


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