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

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class representing a homogeneous medium. More...

Inheritance diagram for HomogeneousMedium:
OpticalMedium IProvidesPositioningReferences

Public Member Functions

override DataArray1D GetRefractiveIndexTransitions (Vector3D startPoint, Vector3D endPoint, double lineStartOffset, double referenceLength, double wavelength, double accuracy)
 Overridden function to get the refractive index transitions on a line segment. Works correct only if the medium was initialized via InitializeIndexCalculationForPresetWavelength(double wavelength) before!!! Used with 2-D FMM.
 
 HomogeneousMedium ()
 Standard constructor, which takes air as material.
 
 HomogeneousMedium (HomogeneousMedium medium)
 Copy constructor.
 
 HomogeneousMedium (Material material, double temperatureInDegrees=20, double pressureInPascal=Globals.PascalsPerAtm, bool clone=true)
 Constructor that sets a constant material.
 
override double IntegrateImaginaryRefractiveIndex (Vector3D startPosition, Vector3D endPosition, double wavelength)
 Calculates the integral of the imaginary part of the refractive index. For homogeneous media it is just refractive index times path length.
 
override double IntegrateRealRefractiveIndex (Vector3D startPosition, Vector3D endPosition, double wavelength)
 Calculates the integral of the real part of the refractive index. For homogeneous media it is just refractive index times path length.
 
override string SuggestName ()
 
- Public Member Functions inherited from OpticalMedium
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 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

override Material BaseMaterial [get, set]
 The underlying material.
 
override bool HasFixedPeriod [get]
 Gets whether the medium is always periodical (TRUE) or whether the user can make the medium periodical (FALSE).
 
Material Material [get, set]
 Obsolete property. Use BaseMaterial instead.
 
- Properties inherited from OpticalMedium
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.
 

Additional Inherited Members

- Events inherited from OpticalMedium
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.
Class representing a homogeneous medium.

Constructor & Destructor Documentation

◆ HomogeneousMedium() [1/2]

HomogeneousMedium ( Material  material,
double  temperatureInDegrees = 20,
double  pressureInPascal = Globals::PascalsPerAtm,
bool  clone = true 
)

Constructor that sets a constant material.

Parameters
materialThe material to provide the refractive index.
temperatureInDegreesThe temperature of the medium in degrees centigrade.
pressureInPascalThe pressure of the medium in pascal.
cloneOptional parameter defining whether the material passed as parameter should be cloned. In principal, cloning should always be done externally if required.

◆ HomogeneousMedium() [2/2]

Copy constructor.

Parameters
mediumHomogeneous medium to be copied.

Member Function Documentation

◆ GetRefractiveIndexTransitions()

override DataArray1D GetRefractiveIndexTransitions ( Vector3D  startPoint,
Vector3D  endPoint,
double  lineStartOffset,
double  referenceLength,
double  wavelength,
double  accuracy 
)

Overridden function to get the refractive index transitions on a line segment. Works correct only if the medium was initialized via InitializeIndexCalculationForPresetWavelength(double wavelength) before!!! Used with 2-D FMM.

Parameters
startPointStartpoint of line segment.
endPointEndpoint of line segment.
lineStartOffsetOffset of start point on the line in global coordinates.
referenceLengthNot used in this overwriting.
wavelengthThe wavelength - needed for calculation of refractive indices.
accuracyAccuracy factor (which is ignored in this implementation).
Returns
Data Array of index transitions.

◆ IntegrateImaginaryRefractiveIndex()

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

Calculates the integral of the imaginary part of the refractive index. For homogeneous media it is just refractive index times path length.

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 from OpticalMedium.

◆ IntegrateRealRefractiveIndex()

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

Calculates the integral of the real part of the refractive index. For homogeneous media it is just refractive index times path length.

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 from OpticalMedium.