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
-
ObjectBaseSerializableObjectBaseManualSerializationMaterialAbsorptionBase
- 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
_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
_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
Properties
AbsorptionCoeffSamplingIsEquidistant
In case of an sampled absorption coefficient this property gets whether the sampling is equidistant.
public bool AbsorptionCoeffSamplingIsEquidistant { get; }
Property Value
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
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
MinWavelengthAbsorption
protected property to set and get the minimum wavelength for absorption
protected double MinWavelengthAbsorption { get; set; }
Property Value
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
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
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
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
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
objobjectmaterial to compare with.
equalityIntentEqualityIntentDefines 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
wavelengthdoublewavelength 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
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
messageListArrayListArray 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
SetConstantAbsorption(double, AbsorptionType, double?)
Method for specifying a constant absorption.
public void SetConstantAbsorption(double absorptionValue, AbsorptionType type, double? thicknessInCaseOfInternalTransmittance = null)
Parameters
absorptionValuedoubleThe constant absorption value (coefficient, index, or internal transmittance) to be set.
typeAbsorptionTypeThe type of absorption given.
thicknessInCaseOfInternalTransmittancedouble?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
sampledAbsorptionCoefficientDataArray1DSampled 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!
originalAbsorptionTypeAbsorptionTypeWere 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!
thicknessOfOriginalInternalTransmittancesdoubleThickness 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!