Table of Contents

Class HomogeneousMedium

Namespace
VirtualLabAPI.Core.OpticalSystems
Assembly
VirtualLabAPI.dll

Class representing a homogeneous medium.

[Serializable]
public class HomogeneousMedium : OpticalMedium, ISerializable, IDeserializationCallback, IEquatable<IObjectBase>, ICloneable, IProvidesPositioningReferences
Inheritance
ObjectBase
SerializableObjectBase
ManualSerialization
HomogeneousMedium
Implements
IEquatable<IObjectBase>
Inherited Members

Constructors

HomogeneousMedium(Material, double, double, bool)

Constructor that sets a constant material.

public HomogeneousMedium(Material material, double temperatureInDegrees = 20, double pressureInPascal = 101325, bool clone = true)

Parameters

material Material

The material to provide the refractive index.

temperatureInDegrees double

The temperature of the medium in degrees centigrade.

pressureInPascal double

The pressure of the medium in pascal.

clone bool

Optional parameter defining whether the material passed as parameter should be cloned. In principal, cloning should always be done externally if required.

HomogeneousMedium(HomogeneousMedium)

Copy constructor.

public HomogeneousMedium(HomogeneousMedium medium)

Parameters

medium HomogeneousMedium

Homogeneous medium to be copied.

Properties

BaseMaterial

The underlying material.

public override Material BaseMaterial { get; set; }

Property Value

Material

CoordinateSystem

Property which overrides the Coordinate System property of OpticalMedium so that it is always defined absolutely.

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 override Range3D DefaultViewRangesWithoutScaling { get; }

Property Value

Range3D

HasFixedPeriod

This returns always false because the user can't make the medium periodical.

public override bool HasFixedPeriod { get; }

Property Value

bool

IsPeriodical

A homogeneous medium has no period, thus this property always returns false. The property HasFixedPeriod just returns true in order to avoid the possibility of setting a finite period.

public override bool IsPeriodical { get; set; }

Property Value

bool

LongName

Gets the long name for the medium.

public override string LongName { get; }

Property Value

string

RefractiveIndexModulation

Returns always None since a constant refractive index is not modulated in x-, y-, z-direction.

public override RefractiveIndexModulation RefractiveIndexModulation { get; }

Property Value

RefractiveIndexModulation

Methods

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.

GetComplexRefractiveIndex(double)

Gets the complex refractive index.

public Complex GetComplexRefractiveIndex(double wavelength)

Parameters

wavelength double

The wavelength needed for calculation.

Returns

Complex

The complex refractive index.

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 override 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 of the base material.

GetMinMaxValuesForAutoScale(double)

Gets the minima and maxima of the real valued refractive index and of the absorption index for a given wavelength.

public override (double nMin, double nMax, double aMin, double aMax) GetMinMaxValuesForAutoScale(double wavelength)

Parameters

wavelength double

Returns

(double nMin, double nMax, double aMin, double aMax)

GetRealRefractiveIndex(double)

Gets the real part of the complex refractive index.

public double GetRealRefractiveIndex(double wavelength)

Parameters

wavelength double

The wavelength needed for calculation.

Returns

double

The real part of the complex refractive index.

IntegrateImaginaryRefractiveIndex(Vector3D, Vector3D, double)

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

public override 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. For homogeneous media it is just refractive index times path length.

public override 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.

SuggestName()

Suggests a name for the medium based on its current parameters.

public override string SuggestName()

Returns

string

The suggested name.

ToString()

Returns a string that represents this instance.

public override string ToString()

Returns

string

A string that represents this instance.

Operators

operator ==(HomogeneousMedium, HomogeneousMedium)

Static operator that tells if two media are equal.

public static bool operator ==(HomogeneousMedium m1, HomogeneousMedium m2)

Parameters

m1 HomogeneousMedium

Medium 1

m2 HomogeneousMedium

Medium 2

Returns

bool

true if m1 and m2 are equal.

operator !=(HomogeneousMedium, HomogeneousMedium)

Static operator that tells if two media are unequal.

public static bool operator !=(HomogeneousMedium m1, HomogeneousMedium m2)

Parameters

m1 HomogeneousMedium

Medium 1

m2 HomogeneousMedium

Medium 2

Returns

bool

true if m1 and m2 are not equal.