Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
OpticalMedium Class Referenceabstract

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Base class for every class that represents a modulated or non-modulated refractive index distribution between two surfaces. More...

Inheritance diagram for OpticalMedium:
IProvidesPositioningReferences HomogeneousMedium

Public Member Functions

void CalculateDerivative_Numerically (Vector3D r, double wavelength, out Complex dx, out Complex dy, out Complex dz)
 public support method to calculate the derivative of the refractive index of the optical medium for x,y,z direction
 
bool Edit ()
 Enables the user to edit internal parameters of the spread sheet object by bringing up a modal dialog.
 
Complex GetComplexRefractiveIndex (Vector3D position, double wavelength)
 Returns the refractive index on a special point and for a special wavelength. This function takes the periodization and the scaling into account.
 
double GetImaginaryRefractiveIndex (Vector3D position, double wavelength)
 Gets the imaginary part of the complex refractive index.
 
virtual void GetMinMaxWavelength (out double minWavelength, out double maxWavelength)
 Base method to determine the valid min/max vacuum wavelength of the medium for the current temperature and pressure.
 
virtual double GetOverallZExtension ()
 Gets the overall z-extension of the medium. Only used if DeterminesZExtensionByItself is true.
 
double GetRealRefractiveIndex (Vector3D position, double wavelength)
 Gets the real part of the complex refractive index.
 
PhysicalValueRange GetWavelengthRange ()
 Gets the valid vacuum wavelength range of the medium for the current temperature and pressure.
 
virtual Complex IntegrateComplexRefractiveIndex (Vector3D startPosition, Vector3D endPosition, double wavelength)
 Calculates the integral of the complex refractive index. Takes twice as long as the calculation of real or imaginary part.
 
virtual double IntegrateImaginaryRefractiveIndex (Vector3D startPosition, Vector3D endPosition, double wavelength)
 Calculates the integral of the imaginary part of the refractive index. Can be overridden in derived classes.
 
virtual double IntegrateRealRefractiveIndex (Vector3D startPosition, Vector3D endPosition, double wavelength)
 Calculates the integral of the real part of the refractive index. Can be overridden in derived classes.
 
virtual bool IsConsistent (out List< ConsistenyErrorOrWarning > messageList)
 Method to check whether the medium is defined consistently.
 
 OpticalMedium (OpticalMedium medium)
 Copy constructor.
 
ComplexField RefractiveIndexDistributionInPlane (AxisDirection viewDirection, double viewPosition, double wavelength, SamplingParameters planeSampling, CancellationToken cancellationToken)
 Calculates the refractive index distribution in one plane with the given sampling.
 
- Public Member Functions inherited from IProvidesPositioningReferences
bool ContainsReferenceCoordinateSystemWithKey (string key)
 Method that gives a flag, indicating whether or not a coordinate system is contained that can be accessed via a certain key.
 
CartesianCoordinateSystem GetReferenceCoordinateSystemWithKey (string key)
 Method that gives the coordinate system the given key is assigned to.
 

Properties

Material BaseMaterial [get, set]
 Get the base material of the medium.
 
virtual bool BaseMaterialIsEditable [get]
 Virtual property to get whether the base material can be edited directly (true), or only indirectly by changing a "sub-medium" inside this medium (false). In the first case the base material control of FormOpticalMediumBase is shown (for which NameOfBaseMaterial is used).
 
Type CatalogClass [get]
 Type of the class of the dedicated catalogs.
 
List< string > Categories [get, set]
 Each string in the list represents one category the catalog belongs to. The format is "subcatalog|subsubcatalog...".
 
CartesianCoordinateSystem CoordinateSystem [get, set]
 Get, set the local (with respect to a BS) coordinate system of the medium.
 
Range3D DefaultViewRangesWithoutScaling [get]
 What view ranges shall be shown in the medium preview by default? Medium scaling is not to be considered in this property!
 
virtual bool DeterminesZExtensionByItself [get]
 Gets whether the medium determines its z-extension (in a stack) by itself.
 
EditedInType EditedWithin [get, set]
 Gets and sets how to show the edit dialog of the interface. Must be set prior to calling the edit dialog.
 
virtual bool HasFixedPeriod [get]
 Gets whether the medium has a fixed period determined from the specific medium parameters. For example the period of a Volume Grating Medium is determined from the interference pattern of the superposing plane waves.
 
bool InsulatedFromEnvironment [get, set]
 Flag which can prevent (if its value is true) that the temperature and pressure for this medium are set by the recursive algorithm which is called by the method SetEnvironmentParametersToMediaRecursive().
 
virtual bool IsAlwaysPeriodical [get]
 Gets whether the medium is always periodical (true) or whether the user can make the medium periodical (false).
 
virtual bool IsEditable [get]
 Determines whether the spread sheet object is editable, i.e. whether the Edit() function was overridden.
 
virtual bool IsIsotropic [get]
 Gets a value indicating whether this medium is isotropic (true) or anisotropic (false).
 
bool IsPeriodical [get, set]
 Gets and sets whether the medium is periodical.
 
virtual string LongName [get]
 Get a long name for the medium consisting of the medium's name and its base material's name.
 
virtual RefractiveIndexModulation MaximumPossibleRefractiveIndexModulation [get]
 For some media the RefractiveIndexModulation depends on the current configuration. So this property gets the maximum possible modulation to be able to switch off GUI controls which never have an effect (e.g. z-scaling in case of a medium which can never be modulated in z-direction).
 
virtual Vector3D MediaPeriod [get, set]
 Get and set the period of the medium.
 
string Name [get, set]
 Name of the document. Has to be unique, because it will serve as key in the SortedList.
 
virtual string NameOfBaseMaterial [get]
 Virtual property to get the name of the base material.
 
virtual ControlOpticalMediumBase NewEditControl [get]
 public property to get a new instance of the control which shall be used for editing
 
virtual List< Parameter > ParameterRunParameters [get]
 virtual properties which can be used to get the list of parameters available in parameter run
 
double PressureInPascal [get, set]
 The gas pressure (in Pascal) to use the medium at.
 
RefractiveIndexModulation RefractiveIndexModulation [get]
 Returns a flag enum indicating of the complex refractive index is modulated in x-, y- or z-direction.
 
Vector3D ScalingVector [get]
 This property gets the scaling for all three directions as vector.
 
double ScalingX [get, set]
 Gets and sets the scaling factor for x-direction. It can only be set if the medium can have a modulation in x-direction.
 
double ScalingY [get, set]
 Gets and sets the scaling factor for y-direction. It can only be set if the medium can have a modulation in y-direction.
 
double ScalingZ [get, set]
 Gets and sets the scaling factor for z-direction. It can only be set if the medium can have a modulation in z-direction.
 
virtual TypeofSmoothness Smoothness [get]
 Get the smoothness property. "Continuous" per default.
 
string SubTypeDescription [get]
 Get description of subtype of spread sheet object.
 
double TemperatureInDegrees [get, set]
 The temperature (in °C) to use the medium at.
 
bool UseDuringPropagation [get, set]
 Always true for optical media, as they are always used for propagation.
 

Events

EventHandler ZExtensionMayHaveChanged
 Event that is thrown if some parameters are changed which influence the z-extension of the interface. Is only thrown if DeterminesZExtensionByItself is true.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Base class for every class that represents a modulated or non-modulated refractive index distribution between two surfaces.

Constructor & Destructor Documentation

◆ OpticalMedium()

Copy constructor.

Parameters
mediumMedium to be copied.

Member Function Documentation

◆ CalculateDerivative_Numerically()

void CalculateDerivative_Numerically ( Vector3D  r,
double  wavelength,
out Complex  dx,
out Complex  dy,
out Complex  dz 
)

public support method to calculate the derivative of the refractive index of the optical medium for x,y,z direction

Parameters
rthe position where to evaluate the derivative
wavelengththe wavelength to evaluate the derivative
dxthe derivative in x direction
dythe derivative in y direction
dzthe derivative in z direction

◆ Edit()

bool Edit ( )

Enables the user to edit internal parameters of the spread sheet object by bringing up a modal dialog.

Returns
True when the edit dialog was finished with OK.

◆ GetComplexRefractiveIndex()

Complex GetComplexRefractiveIndex ( Vector3D  position,
double  wavelength 
)

Returns the refractive index on a special point and for a special wavelength. This function takes the periodization and the scaling into account.

Parameters
positionthe position to return the refractive index on. The z-value of the position has to be relative to the start interface on the left side (lower z-position). So the z-position starts always with zero.
wavelengthThe wavelength for that the refractive index is returned.
Returns
The complex refractive index at the given position.

◆ GetImaginaryRefractiveIndex()

double GetImaginaryRefractiveIndex ( Vector3D  position,
double  wavelength 
)

Gets the imaginary part of the complex refractive index.

Parameters
positionThe position for which the imaginary refractive index is calculated.
wavelengthThe wavelength needed for calculation.
Returns
The imaginary part of the complex refractive index.

◆ GetMinMaxWavelength()

virtual void GetMinMaxWavelength ( out double  minWavelength,
out double  maxWavelength 
)
virtual

Base method to determine the valid min/max vacuum wavelength of the medium for the current temperature and pressure.

Parameters
minWavelengthThe minimum wavelength
maxWavelengthThe maximum wavelength

◆ GetOverallZExtension()

virtual double GetOverallZExtension ( )
virtual

Gets the overall z-extension of the medium. Only used if DeterminesZExtensionByItself is true.

Returns
The overall z-extension of the medium.

◆ GetRealRefractiveIndex()

double GetRealRefractiveIndex ( Vector3D  position,
double  wavelength 
)

Gets the real part of the complex refractive index.

Parameters
positionThe position for which the real refractive index is calculated.
wavelengthThe wavelength needed for calculation.
Returns
The real part of the complex refractive index.

◆ GetWavelengthRange()

PhysicalValueRange GetWavelengthRange ( )

Gets the valid vacuum wavelength range of the medium for the current temperature and pressure.

Returns
The valid wavelength range of the medium.

◆ IntegrateComplexRefractiveIndex()

virtual Complex IntegrateComplexRefractiveIndex ( Vector3D  startPosition,
Vector3D  endPosition,
double  wavelength 
)
virtual

Calculates the integral of the complex refractive index. Takes twice as long as the calculation of real or imaginary part.

Parameters
startPositionlower border of integration interval
endPositionupper border of integration interval
wavelengthThe wavelength needed for calculation.
Returns
The integral of the complex refractive index between the two positions.

◆ IntegrateImaginaryRefractiveIndex()

virtual double IntegrateImaginaryRefractiveIndex ( Vector3D  startPosition,
Vector3D  endPosition,
double  wavelength 
)
virtual

Calculates the integral of the imaginary part of the refractive index. Can be overridden in derived classes.

Parameters
startPositionlower border of integration interval
endPositionupper border of integration interval
wavelengthThe wavelength needed for calculation.
Returns
The integral of the imaginary part of the refractive index between the two positions.

Reimplemented in HomogeneousMedium.

◆ IntegrateRealRefractiveIndex()

virtual double IntegrateRealRefractiveIndex ( Vector3D  startPosition,
Vector3D  endPosition,
double  wavelength 
)
virtual

Calculates the integral of the real part of the refractive index. Can be overridden in derived classes.

Parameters
startPositionlower border of integration interval
endPositionupper border of integration interval
wavelengthThe wavelength needed for calculation.
Returns
The integral of the real part of the refractive index between the two positions.

Reimplemented in HomogeneousMedium.

◆ IsConsistent()

virtual bool IsConsistent ( out List< ConsistenyErrorOrWarning >  messageList)
virtual

Method to check whether the medium is defined consistently.

Parameters
messageListOut parameter to return the list of errors or warnings. Can be an empty list.
Returns
true, if the medium is consistent, otherwise false.

◆ RefractiveIndexDistributionInPlane()

ComplexField RefractiveIndexDistributionInPlane ( AxisDirection  viewDirection,
double  viewPosition,
double  wavelength,
SamplingParameters  planeSampling,
CancellationToken  cancellationToken 
)

Calculates the refractive index distribution in one plane with the given sampling.

Parameters
viewDirectionThe direction from which you look onto the material. Direction.Z means a X-Y-plane.
viewPositionThe view position. Must be positive for Direction.Z.
wavelengthThe wavelength for which the refractive indices are calculated.
planeSamplingThe sampling for the x- and y-axis of the resulting ComplexField.
cancellationTokenToken for cooperative task cancellation.
Returns
A complex field. The real part contains the refractive indices and the imaginary part the absorption. For a Z-X and Z-Y plane, z is drawn along the "normal" x-axis. If wavelength is out of range, null is returned.

Property Documentation

◆ EditedWithin

EditedInType EditedWithin
getset

Gets and sets how to show the edit dialog of the interface. Must be set prior to calling the edit dialog.


◆ HasFixedPeriod

virtual bool HasFixedPeriod
get

Gets whether the medium has a fixed period determined from the specific medium parameters. For example the period of a Volume Grating Medium is determined from the interference pattern of the superposing plane waves.


◆ IsAlwaysPeriodical

virtual bool IsAlwaysPeriodical
get

Gets whether the medium is always periodical (true) or whether the user can make the medium periodical (false).


◆ IsPeriodical

bool IsPeriodical
getset

Gets and sets whether the medium is periodical.


◆ ScalingX

double ScalingX
getset

Gets and sets the scaling factor for x-direction. It can only be set if the medium can have a modulation in x-direction.


◆ ScalingY

double ScalingY
getset

Gets and sets the scaling factor for y-direction. It can only be set if the medium can have a modulation in y-direction.


◆ ScalingZ

double ScalingZ
getset

Gets and sets the scaling factor for z-direction. It can only be set if the medium can have a modulation in z-direction.


◆ SubTypeDescription

string SubTypeDescription
getabstract

Get description of subtype of spread sheet object.

Returns