Table of Contents

Class MaterialAbsorptionBase

Namespace
VirtualLabAPI.Core.Materials
Assembly
VirtualLabAPI.dll

In practice usually only one absorption formula is used which is based on stored transmission for different Wavelength but different refractive index dispersion formulas are used. Therefore this abstract base class defines the absorption behavior of classes and should be used of all material classes that implement different refractive index formulas.

This class can also assume a constant absorption for every Wavelength. In case of discrete absorption data points for different Wavelengths a linear interpolation is performed to interpolate the absorption between two stored sampling points.

[Serializable]
public abstract class MaterialAbsorptionBase : Material, IDeserializationCallback, IEquatable<IObjectBase>, ICloneable, ISerializable
Inheritance
ObjectBase
SerializableObjectBase
ManualSerialization
MaterialAbsorptionBase
Implements
IEquatable<IObjectBase>
Derived
Inherited Members

Constructors

MaterialAbsorptionBase()

Standard constructor

public MaterialAbsorptionBase()

Fields

_sampledAbsorptionCoeff

DataArray1D containing the absorption per meter for different Wavelengths.

protected DataArray1D? _sampledAbsorptionCoeff

Field Value

DataArray1D

_snippetParameterValuesChangedAbsorption

Indicates that values of either the Standard or the Global Parameters have changed. If the number of the Global Parameters changed, _vlSnippet must be set to null.

[NonSerialized]
protected bool _snippetParameterValuesChangedAbsorption

Field Value

bool

_snippetParameterValuesChangedRealPart

Indicates that values of either the Standard or the Global Parameters have changed. If the number of the Global Parameters changed, _vlSnippet must be set to null.

[NonSerialized]
protected bool _snippetParameterValuesChangedRealPart

Field Value

bool

Properties

AbsorptionCoeffSamplingIsEquidistant

In case of an sampled absorption coefficient this property gets whether the sampling is equidistant.

public bool AbsorptionCoeffSamplingIsEquidistant { get; }

Property Value

bool

AbsorptionFormula

Gand sets the enum entry that define in which way the absorption within the MaterialAbsorptionBase class is specified (constant, sampled or programmable)

public AbsorptionFormula AbsorptionFormula { get; set; }

Property Value

AbsorptionFormula

AdditionalUsings

public property to get and set the additional usings.

public string[] AdditionalUsings { get; set; }

Property Value

string[]

ConstantAbsorption

Gets the constant absorption. Whether it is a coefficient or index or internal transmittance is determined by OriginalAbsorptionType. The set branch is supposed to be used by parameter variations only. Please use the method SetConstantAbsorption for setting the value only.

public double ConstantAbsorption { get; protected set; }

Property Value

double

ExternalReferenceDLLs

public property to set and get the referenced external DLLs.

public string[] ExternalReferenceDLLs { get; set; }

Property Value

string[]

GeneralParametersForParameterRun

Gets and sets the help object with which General Parameters of the snippet (doubles, integers and so on) can be used in a Parameter Run.

public GeneralParametersForParameterRunProvider GeneralParametersForParameterRun { get; set; }

Property Value

GeneralParametersForParameterRunProvider

GlobalParameters

public property to get and set List of all available global parameters.

public List<GlobalParameterInternal> GlobalParameters { get; set; }

Property Value

List<GlobalParameterInternal>

MaxWavelengthAbsorption

protected property to set and get the maximum wavelength for absorption

protected double MaxWavelengthAbsorption { get; set; }

Property Value

double

MinWavelengthAbsorption

protected property to set and get the minimum wavelength for absorption

protected double MinWavelengthAbsorption { get; set; }

Property Value

double

ParameterRunParameters

Gets the parameters available for Parameter Extraction.

public override List<Parameter> ParameterRunParameters { get; }

Property Value

List<Parameter>

SampledAbsorptionCoeff

Gets the DataArray1D containing the absorption coefficient, depending from wavelength. Setting has to be done via method SetSampledAbsorptionCoeff().

public DataArray1D? SampledAbsorptionCoeff { get; }

Property Value

DataArray1D

SnippetHelp

Gets and sets for the snippet for the programmable absorption the help including name, author, version, ….

public SnippetHelpInformation SnippetHelp { get; set; }

Property Value

SnippetHelpInformation

SourceCodeOfSnippetBody

Gets and sets the source code that should be used for the snippet body

public string SourceCodeOfSnippetBody { get; set; }

Property Value

string

SourceCodeSegmentAbsorptionCoefficient

Gets and sets the string that represent the internal code segment to execute with the set up material (in case of programmable dispersion formula).

public string SourceCodeSegmentAbsorptionCoefficient { get; set; }

Property Value

string

StandardGlobalParameters

Gets the global parameters which are available by default for a programmable material.

public StandardGlobalParameterListInternal StandardGlobalParameters { get; }

Property Value

StandardGlobalParameterListInternal

ThicknessOfOriginalInternalTransmittances

In case the absorption is defined via internal transmittance values, this property gets and sets the used thickness.

public double ThicknessOfOriginalInternalTransmittances { get; set; }

Property Value

double

Methods

Clone()

Create deep copy of object

public override object Clone()

Returns

object

The cloned object.

Equals(object, EqualityIntent)

compares two objects

public override bool Equals(object obj, EqualityIntent equalityIntent)

Parameters

obj object

material to compare with.

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 they are equal.

GetAbsorptionCoeff(double)

Returns the absorption for the specified wavelength. If no absorption for this wavelength defined an ArgumentException is thrown. The function performs a linear interpolation between the stored absorption values to get the absorption value for the specified wavelength.

public override double GetAbsorptionCoeff(double wavelength)

Parameters

wavelength double

wavelength for that the absorption should be returned.

Returns

double

Absorption coefficient for this wavelength.

GetAbsorptionMinMaxWavelength(out double, out double)

Returns minimum and maximum Wavelength for that a absorption is available.

public override void GetAbsorptionMinMaxWavelength(out double minWavelength, out double maxWavelength)

Parameters

minWavelength double

Minimum Wavelength.

maxWavelength double

Maximum Wavelength.

GetAbsorptionWavelengthRange()

Gets the allowed wavelength range for the absorption coefficient.

public PhysicalValueRange GetAbsorptionWavelengthRange()

Returns

PhysicalValueRange

The wavelength range for the absorption coefficient.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

IsConsistent(out ArrayList)

Check consistency of material

public override bool IsConsistent(out ArrayList messageList)

Parameters

messageList ArrayList

Array of ConsistenyErrorOrWarning objects

Returns

bool

True if there is no error

SetAbsorptionMinMaxWavelength(double, double)

Sets the minimum and maximum Wavelength where the absorption values are valid.

public void SetAbsorptionMinMaxWavelength(double minWavelength, double maxWavelength)

Parameters

minWavelength double

Minimum Wavelength.

maxWavelength double

Maximum Wavelength

SetConstantAbsorption(double, AbsorptionType, double?)

Method for specifying a constant absorption.

public void SetConstantAbsorption(double absorptionValue, AbsorptionType type, double? thicknessInCaseOfInternalTransmittance = null)

Parameters

absorptionValue double

The constant absorption value (coefficient, index, or internal transmittance) to be set.

type AbsorptionType

The type of absorption given.

thicknessInCaseOfInternalTransmittance double?

In case of internal transmittance, a thickness has to be given.

Exceptions

ArgumentNullException

Thrown if no thickness is given for an internal transmittance.

SetSampledAbsorptionCoeff(DataArray1D?, AbsorptionType, double)

Set the sampled absorption coefficient (and only coefficient - no index and no transmittance!).

public void SetSampledAbsorptionCoeff(DataArray1D? sampledAbsorptionCoefficient, AbsorptionType originalAbsorptionType, double thicknessOfOriginalInternalTransmittances = NaN)

Parameters

sampledAbsorptionCoefficient DataArray1D

Sampled absorption coefficient to set. Important: only coefficient - no absorption index and no internal transmittance! The original absorption type and thickness are used for correct interpolation within GetAbsorptionCoeff only!

originalAbsorptionType AbsorptionType

Were the original data given as absorption indices or internal transmittance or as absorption coefficients? To be used for correct interpolation within GetAbsorptionCoeff only! The parameter sampledAbsorptionCoefficient has to contain absorption coefficients in any case!

thicknessOfOriginalInternalTransmittances double

Thickness to use for internal transmittance, if needed. To be used for correct interpolation within GetAbsorptionCoeff only! The parameter sampledAbsorptionCoefficient has to contain absorption coefficients in any case!

Exceptions

ArgumentException