Table of Contents

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
ObjectBase
SerializableObjectBase
ManualSerialization
OpticalMedium
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

string

Properties

BaseMaterial

Gets the base material of the medium.

public abstract Material? BaseMaterial { get; set; }

Property Value

Material

CatalogClass

Type of the class of the dedicated catalogs

public Type CatalogClass { get; }

Property Value

Type

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

List<string>

CoordinateSystem

Gets and sets the local (with respect to a Boundary Segment) coordinate system of the medium.

public CartesianCoordinateSystem CoordinateSystem { get; set; }

Property Value

CartesianCoordinateSystem

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

bool

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

bool

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

bool

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

bool

IsIsotropic

Gets a value indicating whether this medium is isotropic (true) or anisotropic (false).

public virtual bool IsIsotropic { get; }

Property Value

bool

IsPeriodical

Gets and sets whether the medium is periodical.

public virtual bool IsPeriodical { get; set; }

Property Value

bool

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

string

MediaPeriod

Gets and sets the period of the medium.

public virtual Vector3D MediaPeriod { get; set; }

Property Value

Vector3D

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

string

NameOfBaseMaterial

Virtual property to get the name of the base material.

public virtual string NameOfBaseMaterial { get; }

Property Value

string

PresetWavelength

Gets and sets the temporary value for the wavelength used for index calculation.

public virtual double PresetWavelength { get; set; }

Property Value

double

PressureInPascal

The gas pressure (in Pascal) to use the medium at.

public double PressureInPascal { get; set; }

Property Value

double

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

RefractiveIndexModulation

ScalingVector

This property gets the scaling for all three directions as vector.

public Vector3D ScalingVector { get; }

Property Value

Vector3D

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

double

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

double

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

double

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

double

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

r Vector3D

The position where to evaluate the derivative.

wavelength double

The wavelength to evaluate the derivative for.

dx Complex

The derivative in x-direction.

dy Complex

The derivative in y-direction.

dz Complex

The 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

key string

Key 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

obj object
equalityIntent EqualityIntent

Defines what kind of equality you want to check when comparing two objects, for example all values or physical equality.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

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

position Vector3D

the 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.

wavelength double

The 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

position Vector3D

the 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

position Vector3D

The position for which the imaginary refractive index is calculated.

wavelength double

The 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

minWavelength double

The minimum wavelength

maxWavelength double

The maximum wavelength

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

position Vector3D

The position for which the real refractive index is calculated.

wavelength double

The 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

accuracyFactor double

The 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

key string

Key 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

startPosition Vector3D

lower border of integration interval

endPosition Vector3D

upper border of integration interval

wavelength double

The 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

startPosition Vector3D

lower border of integration interval

endPosition Vector3D

upper border of integration interval

wavelength double

The 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

startPosition Vector3D

lower border of integration interval

endPosition Vector3D

upper border of integration interval

wavelength double

The 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

messageList List<ConsistenyErrorOrWarning>

Out parameter to return the list of errors or warnings. Can be an empty list.

Returns

bool

true, if the medium is consistent, otherwise false.

ToString()

Returns a string that represents this instance.

public override string ToString()

Returns

string

A string that represents this instance.