Class OpticalMedium
- Namespace
- VirtualLabAPI.Core.OpticalSystems
- Assembly
- VirtualLabAPI.dll
Base class for every class that represents a modulated or non-modulated refractive index distribution between two surfaces.
[Serializable]
public abstract class OpticalMedium : ManualSerialization, ISerializable, IDeserializationCallback, IEquatable<IObjectBase>, ICloneable, IProvidesPositioningReferences
- Inheritance
-
ObjectBaseSerializableObjectBaseManualSerializationOpticalMedium
- Implements
-
IEquatable<IObjectBase>
- Derived
- Inherited Members
Constructors
OpticalMedium()
Standard constructor
protected OpticalMedium()
Fields
KeyOfMediumCoordinateSystem
Key that is used to identify the medium coordinate system, in order to use it as positioning reference for other IPositionable objects.
public static string KeyOfMediumCoordinateSystem
Field Value
Properties
BaseMaterial
Gets the base material of the medium.
public abstract Material? BaseMaterial { get; set; }
Property Value
CatalogClass
Type of the class of the dedicated catalogs
public Type CatalogClass { get; }
Property Value
Categories
Each string in the list represents one category the catalog belongs to. The format is "subcatalog|subsubcatalog...".
public List<string> Categories { get; set; }
Property Value
CoordinateSystem
Gets and sets the local (with respect to a Boundary Segment) coordinate system of the medium.
public CartesianCoordinateSystem CoordinateSystem { get; set; }
Property Value
DefaultViewRangesWithoutScaling
What view ranges shall be shown in the medium preview by default? Medium scaling is not to be considered in this property!
public abstract Range3D DefaultViewRangesWithoutScaling { get; }
Property Value
- Range3D
DeterminesZExtensionByItself
Gets whether the medium determines its z-extension (in a stack) by itself.
public virtual bool DeterminesZExtensionByItself { get; }
Property Value
HasFixedPeriod
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.
public virtual bool HasFixedPeriod { get; }
Property Value
InsulatedFromEnvironment
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().
public bool InsulatedFromEnvironment { get; set; }
Property Value
IsAlwaysPeriodical
Gets whether the medium is always periodical (true) or whether the user can make the medium periodical (false).
public virtual bool IsAlwaysPeriodical { get; }
Property Value
IsIsotropic
Gets a value indicating whether this medium is isotropic (true) or anisotropic (false).
public virtual bool IsIsotropic { get; }
Property Value
IsPeriodical
Gets and sets whether the medium is periodical.
public virtual bool IsPeriodical { get; set; }
Property Value
LongName
Get a long name for the medium consisting of the medium's name and its base material's name
public virtual string LongName { get; }
Property Value
MediaPeriod
Gets and sets the period of the medium.
public virtual Vector3D MediaPeriod { get; set; }
Property Value
Name
Name of the document. Has to be unique, because it will serve as key in the SortedList.
public string Name { get; set; }
Property Value
NameOfBaseMaterial
Virtual property to get the name of the base material.
public virtual string NameOfBaseMaterial { get; }
Property Value
PresetWavelength
Gets and sets the temporary value for the wavelength used for index calculation.
public virtual double PresetWavelength { get; set; }
Property Value
PressureInPascal
The gas pressure (in Pascal) to use the medium at.
public double PressureInPascal { get; set; }
Property Value
RefractiveIndexModulation
Returns a flag enum indicating of the complex refractive index is modulated in x-, y- or z-direction.
public abstract RefractiveIndexModulation RefractiveIndexModulation { get; }
Property Value
ScalingVector
This property gets the scaling for all three directions as vector.
public Vector3D ScalingVector { get; }
Property Value
ScalingX
Gets and sets the scaling factor for x-direction. It can only be set if the medium can have a modulation in x-direction.
public double ScalingX { get; set; }
Property Value
ScalingY
Gets and sets the scaling factor for y-direction. It can only be set if the medium can have a modulation in y-direction.
public double ScalingY { get; set; }
Property Value
ScalingZ
Gets and sets the scaling factor for z-direction. It can only be set if the medium can have a modulation in z-direction.
public double ScalingZ { get; set; }
Property Value
Smoothness
Get the smoothness property. "Continuous" per default.
public virtual TypeofSmoothness Smoothness { get; }
Property Value
- TypeofSmoothness
TemperatureInDegrees
The temperature (in °C) to use the medium at.
public double TemperatureInDegrees { get; set; }
Property Value
Methods
CalculateDerivative_Numerically(Vector3D, double, out Complex, out Complex, out Complex)
Method to calculate the derivative of the refractive index of the optical medium for x,y,z direction
public void CalculateDerivative_Numerically(Vector3D r, double wavelength, out Complex dx, out Complex dy, out Complex dz)
Parameters
rVector3DThe position where to evaluate the derivative.
wavelengthdoubleThe wavelength to evaluate the derivative for.
dxComplexThe derivative in x-direction.
dyComplexThe derivative in y-direction.
dzComplexThe derivative in z-direction.
Clone()
Creates a new object that is a copy of the current instance.
public override object Clone()
Returns
- object
A new object that is a copy of this instance.
ContainsReferenceCoordinateSystemWithKey(string)
Method that gives a flag, indicating whether or not a coordinate system is contained that can be accessed via a certain key
public bool ContainsReferenceCoordinateSystemWithKey(string key)
Parameters
keystringKey to be checked
Returns
- bool
Flag, indicating whether or not a coordinate system is contained that can be accessed via the given key
Equals(object, EqualityIntent)
Determines whether the specified object is equal to this instance.
public override bool Equals(object obj, EqualityIntent equalityIntent)
Parameters
objobjectequalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns
GetComplexRefractiveIndex(Vector3D, double)
Returns the refractive index on a special point and for a special wavelength. This function takes the periodization and the scaling into account.
public Complex GetComplexRefractiveIndex(Vector3D position, double wavelength)
Parameters
positionVector3Dthe 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.
wavelengthdoubleThe wavelength for that the refractive index is returned.
Returns
- Complex
The complex refractive index at the given position.
GetComplexRefractiveIndexWithoutScalingAndPeriodization(Vector3D)
Returns the refractive index on a special point and for a special wavelength. This function does not take the periodization and the scaling into account.
protected abstract Complex GetComplexRefractiveIndexWithoutScalingAndPeriodization(Vector3D position)
Parameters
positionVector3Dthe 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.
Returns
- Complex
The complex refractive index.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetImaginaryRefractiveIndex(Vector3D, double)
Gets the imaginary part of the complex refractive index.
public double GetImaginaryRefractiveIndex(Vector3D position, double wavelength)
Parameters
positionVector3DThe position for which the imaginary refractive index is calculated.
wavelengthdoubleThe wavelength needed for calculation.
Returns
- double
The imaginary part of the complex refractive index.
GetMinMaxWavelength(out double, out double)
Base method to determine the valid min/max vacuum wavelength of the medium for the current temperature and pressure.
public virtual void GetMinMaxWavelength(out double minWavelength, out double maxWavelength)
Parameters
GetOverallZExtension()
Gets the overall z-extension of the medium. Only used if DeterminesZExtensionByItself is true.
public virtual double GetOverallZExtension()
Returns
- double
The overall z-extension of the medium.
GetRealRefractiveIndex(Vector3D, double)
Gets the real part of the complex refractive index.
public double GetRealRefractiveIndex(Vector3D position, double wavelength)
Parameters
positionVector3DThe position for which the real refractive index is calculated.
wavelengthdoubleThe wavelength needed for calculation.
Returns
- double
The real part of the complex refractive index.
GetRecommendedSampling(double)
Gets the recommended lateral sampling distance.
public virtual VectorD GetRecommendedSampling(double accuracyFactor)
Parameters
accuracyFactordoubleThe accuracy factor. Larger factor results in smaller sampling distance.
Returns
- VectorD
The recommended sampling distance to resolve the features fairly good. Infinity for unmodulated directions.
GetReferenceCoordinateSystemWithKey(string)
Method that gives the coordinate system the given key is assigned to
public CartesianCoordinateSystem GetReferenceCoordinateSystemWithKey(string key)
Parameters
keystringKey that is assigned to one contained coordinate system
Returns
- CartesianCoordinateSystem
coordinate system the given key is assigned to
GetWavelengthRange()
Gets the valid vacuum wavelength range of the medium for the current temperature and pressure.
public PhysicalValueRange GetWavelengthRange()
Returns
- PhysicalValueRange
The valid wavelength range of the medium.
IntegrateComplexRefractiveIndex(Vector3D, Vector3D, double)
Calculates the integral of the complex refractive index. Takes twice as long as the calculation of real or imaginary part.
public virtual Complex IntegrateComplexRefractiveIndex(Vector3D startPosition, Vector3D endPosition, double wavelength)
Parameters
startPositionVector3Dlower border of integration interval
endPositionVector3Dupper border of integration interval
wavelengthdoubleThe wavelength needed for calculation.
Returns
- Complex
The integral of the complex refractive index between the two positions.
IntegrateImaginaryRefractiveIndex(Vector3D, Vector3D, double)
Calculates the integral of the imaginary part of the refractive index. Can be overridden in derived classes.
public virtual double IntegrateImaginaryRefractiveIndex(Vector3D startPosition, Vector3D endPosition, double wavelength)
Parameters
startPositionVector3Dlower border of integration interval
endPositionVector3Dupper border of integration interval
wavelengthdoubleThe wavelength needed for calculation.
Returns
- double
The integral of the imaginary part of the refractive index between the two positions.
IntegrateRealRefractiveIndex(Vector3D, Vector3D, double)
Calculates the integral of the real part of the refractive index. Can be overridden in derived classes.
public virtual double IntegrateRealRefractiveIndex(Vector3D startPosition, Vector3D endPosition, double wavelength)
Parameters
startPositionVector3Dlower border of integration interval
endPositionVector3Dupper border of integration interval
wavelengthdoubleThe wavelength needed for calculation.
Returns
- double
The integral of the real part of the refractive index between the two positions.
IsConsistent(out List<ConsistenyErrorOrWarning>)
Method to check whether the medium is defined consistently.
public virtual bool IsConsistent(out List<ConsistenyErrorOrWarning> messageList)
Parameters
messageListList<ConsistenyErrorOrWarning>Out parameter to return the list of errors or warnings. Can be an empty list.
Returns
- bool
true, if the medium is consistent, otherwisefalse.
ToString()
Returns a string that represents this instance.
public override string ToString()