Programming Reference for VirtualLab Fusion  2022.1
Public Member Functions | Properties | List of all members
ProfileHeightInterface Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This is the base class for all optical interfaces which can be described by a profile height function h(x, y). The profile height corresponds to the z-position of the optical interface at a given lateral position. More...

Inheritance diagram for ProfileHeightInterface:
OpticalInterface

Public Member Functions

void CalculateInterfaceDerivativeDXDY (VectorD position, out double mx, out double my, bool calculateFirstDerivative=true, bool useScaling=true)
 Calculates the derivative of the interface in x- and y-direction on the specified position. Both derivatives are set to zero if the interface is quantized, pixelated or if we are outside the inner definition area. Scaling is also considered by this function. More...
 
virtual Vector3D CalculateNormalVector (VectorD position)
 Calculates the normal vector for the given lateral position. The normal vector points always in positive z-direction. To invert the normal vector (so that it shows in negative z-direction) multiply -1. An inversion is necessary to calculate the refraction of rays traveling in negative z-direction. More...
 
void CalculateSecondDerivative (VectorD position, out double secondDerivativeX, out double secondDerivativeY)
 Calculates the second derivative of the interface profile in x- and y-direction on the specified position. Both derivatives are set to zero if the interface is quantized, pixelated or if we are outside the inner definition area. Scaling is also considered by this function. More...
 
double EvaluateHeightOutsideInnerDefinitionArea (bool includeQuantization=true)
 public method to evaluate the height outside the inner definition area More...
 
double EvaluateHeightOutsideOuterDefinitionArea (bool includeQuantization=true)
 public method to evaluate the height outside the outer definition area More...
 
bool GetIntersectionPoint (ref PlaneWaveData ray, ref double zPosition, bool findLeftRightTransition, out Vector3D normalVector)
 This function handles the apertures, periodization and scaling. GetIntersectionPointOfElementaryInterface is called by this function and handles the elementary interface. More...
 
double[] GetIntersectionsWithLine (double zPos, double lineShift, bool searchParallelToXAxis, double minValueOfFreeCoordinate, double maxValueOfFreeCoordinate, double transitionPointAccuracy, out double[] signOfDerivatives)
 Calculate the intersections of the surface with a line parallel to X-axis or to Y-axis with given start and end coordinate. May be overridden in derived interfaces. More...
 
override PointInterfaceRelation GetPointInterfaceRelation (Vector3D position)
 Checks the position of a point relative to the interface. A point can be in the medium on the right side of a interface, in the medium on the left side of the interface or lateral outside of the interface. More...
 
override sealed List< VectorDGetPolygonPoints (double startCoordinate, double endCoordinate, double accuracyFactor=1)
 Gets the polygon points representing this interface including scaling, periodization, consideration of the definition areas, ... More...
 
bool IsAbsorbingAtPosition (VectorD position)
 Returns true if the interface absorbs the light at the position (x,y), otherwise false. More...
 
override bool IsConsistent (ref List< ConsistenyErrorOrWarning > errorList, EditedInType editedFrom=EditedInType.Component)
 Method to check whether the interface is defined consistently. More...
 
VectorD MinimumFeatureSize (double accuracyFactor)
 Gets the minimum feature size of the interface. More...
 
double ProfileHeight (double x, double y)
 Profile height calculation which includes pixelation, quantization and scaling in x-, y- and z- direction. More...
 
double ProfileHeight (VectorD position)
 Profile height calculation which includes pixelation, quantization and scaling in x-, y- and z- direction. More...
 
double ProfileHeight (VectorD position, out bool isAbsorbed)
 Profile height calculation which includes pixelation, quantization and scaling in x-, y- and z- direction. More...
 
double ProfileHeight (VectorD position, out bool isAbsorbed, bool includeQuantization, bool subtractHeightOffset=true, double? nanValue=null)
 profile height calculation which includes pixelation, quantization and scaling in x-, y- and z-direction More...
 
- Public Member Functions inherited from OpticalInterface
double GetZExtension ()
 Gets the overall extension of the interface. More...
 
void GetZExtension (out double negZDir, out double posZDir, bool applyQuantization=true)
 The z-extension of the optical interface. Quantization and pixelation effects are considered. More...
 
void GetZExtensionOnElementaryCell (out double negZCell, out double posCell)
 The z-extension of the optical interface on elementary cell. More...
 
void GetZExtensionOnInnerArea (out double negZArea, out double posArea)
 The z-extension of the optical interface on inner definition area. More...
 
void GetZExtensionOnInnerShape (out double negZDir, out double posZDir, bool includeQuantization)
 The z-extension of the optical interface on shape of inner definition area. More...
 
void GetZExtensionOnOuterShape (out double negZDir, out double posZDir, bool includeQuantization)
 The z-extension of the optical interface on shape of outer definition area. More...
 

Properties

virtual bool ContainsFresnelZones [get, set]
 If true the interpolation and the finding of ray intersection points is optimized for optical interfaces the contains Fresnel zones. That are interfaces that may contain 2Pi, 4Pi, 6Pi, ... jumps. The sampling points represent the height of the interface on a special point and are interpolated using a cubic interpolation. The interpolation maintains the Fresnel zones. If false the interpolation and finding of the ray intersection points is optimized for function that have hight frequency interface profiles but no Fresnel zones. Multiple ray intersections are taken into account. Setting this property to true will set the IsPixelated and IsSmoothInterface properties to false.
 
double FresnelZonesRelativePositionOnZAxis [get, set]
 Gets and sets the relative position on the z-axis for the Fresnel zones. More...
 
bool IsPeriodical [get, set]
 If true the structure is periodical. Otherwise non periodical.
 
virtual bool IsQuantized [get, set]
 If true it indicates that the height profile has discrete height levels. Only pixelated height profiles can be quantized. This means if somebody changes this flag to true the IsPixelated flag will be also set to true.
 
bool IsRotationalSymmetric [get]
 Gets whether the given surface is rotational symmetric. The following conditions must be fulfilled for rational symmetry: More...
 
virtual int NumberOfHeightLevels [get, set]
 Contains the number of height levels of a quantized height profile. If a specific number of height levels is set the IsQuantized flag is switched to true.
 
virtual VectorD Period [get, set]
 The period length in x and y direction of the grating used for 2d and 3d rigorous analysis. If the structure is not periodical the period must be equal to the aperture diameter of the optical interface. The default value of the period is equal to the aperture size so the element is not really periodically.
 
VectorD PixelSize [get, set]
 For pixelated interfaces only. If IsPixelated is false the property may return any value.
 
virtual double TotalProfileHeight [get, set]
 For interfaces with Fresnel zones only. The total height of the profile. This means the height of the 2Pi, 4Pi, ... jumps of the interface. If ContainsFresnelZones is false the property may return any value.
 
- Properties inherited from OpticalInterface
bool Coated [get]
 gets whether the interface is coated
 
CoatingBase Coating [get, set]
 gets and sets the coating if there is one
 
CoatingOrientation CoatingOrientation [get, set]
 Gets and sets the orientation of a coating: Is it on the front side of its surface or on the back side? This has an effect on the order in which the layer sequence will be considered during simulation.
 
DefinitionAreaSettings DefinitionArea [get, set]
 Gets and sets the outer definition area (all periods) of the optical interface. Can be overridden in derived classes. More...
 
DefinitionAreaSettings DefinitionAreaElementaryCell [get, set]
 Gets and sets the inner definition area (elementary cell = one period) of the optical interface. Can be overridden in derived classes. More...
 
double ScalingAlpha [get, set]
 property to set and get scaling factor for scaling in z-direction.
 
double ScalingBeta [get, set]
 property to set and get scaling factor for scaling in x-direction
 
double ScalingGamma [get, set]
 property to set and get scaling factor for scaling in y-direction
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This is the base class for all optical interfaces which can be described by a profile height function h(x, y). The profile height corresponds to the z-position of the optical interface at a given lateral position.

Member Function Documentation

◆ CalculateInterfaceDerivativeDXDY()

void CalculateInterfaceDerivativeDXDY ( VectorD  position,
out double  mx,
out double  my,
bool  calculateFirstDerivative = true,
bool  useScaling = true 
)

Calculates the derivative of the interface in x- and y-direction on the specified position. Both derivatives are set to zero if the interface is quantized, pixelated or if we are outside the inner definition area. Scaling is also considered by this function.

Parameters
positionPosition to calculate the derivative on.
mxThe derivative in x-direction
myThe derivative in y-direction
calculateFirstDerivativeOptional parameter specifying whether to use this function to calculate the first (true= or second (false) derivative of the height profile.
useScalingOptional parameter specifying whether to scale the derivative according to ScalingAlpha. ScalingBeta, and ScalingGamma. Needs only to be false for the numerical calculation of the second derivative to avoid scaling twice.

◆ CalculateNormalVector()

virtual Vector3D CalculateNormalVector ( VectorD  position)
virtual

Calculates the normal vector for the given lateral position. The normal vector points always in positive z-direction. To invert the normal vector (so that it shows in negative z-direction) multiply -1. An inversion is necessary to calculate the refraction of rays traveling in negative z-direction.

Parameters
positionLateral position for the normal vector calculation.
Returns
Normal vector of the interface for the given lateral position.

◆ CalculateSecondDerivative()

void CalculateSecondDerivative ( VectorD  position,
out double  secondDerivativeX,
out double  secondDerivativeY 
)

Calculates the second derivative of the interface profile in x- and y-direction on the specified position. Both derivatives are set to zero if the interface is quantized, pixelated or if we are outside the inner definition area. Scaling is also considered by this function.

Parameters
positionPosition to calculate the derivative on.
secondDerivativeXThe second derivative in x-direction
secondDerivativeYThe second derivative in y-direction

◆ EvaluateHeightOutsideInnerDefinitionArea()

double EvaluateHeightOutsideInnerDefinitionArea ( bool  includeQuantization = true)

public method to evaluate the height outside the inner definition area

Parameters
includeQuantizationOptional parameter to indicate whether the calling function treats the quantization correctly. Needs to be set to false if the z-extension of the unquantized interface is determined to calculate the height levels of the quantized interface.
Returns
the height outside the outer definition area

◆ EvaluateHeightOutsideOuterDefinitionArea()

double EvaluateHeightOutsideOuterDefinitionArea ( bool  includeQuantization = true)

public method to evaluate the height outside the outer definition area

Parameters
includeQuantizationOptional parameter to indicate whether the calling function treats the quantization correctly. Needs to be set to false if the z-extension of the unquantized interface is determined to calculate the height levels of the quantized interface.
Returns
the height outside the outer definition area

◆ GetIntersectionPoint()

bool GetIntersectionPoint ( ref PlaneWaveData  ray,
ref double  zPosition,
bool  findLeftRightTransition,
out Vector3D  normalVector 
)

This function handles the apertures, periodization and scaling. GetIntersectionPointOfElementaryInterface is called by this function and handles the elementary interface.

This function calculates the intersection point between the input ray and the present interface. The search is always done in the propagation direction of the ray. This means is the IsPositiveZ property of the ray is true then the search runs in positive z-direction. If the IsPositiveZ property is false the search runs in negative z-direction. After success it returns the position of the intersection point and the normal vector of the interface.

Parameters
rayIn the beginning of the function this ray is the incident ray. After the success of the function the x,y position of the ray is the x,y position of the intersection point.
zPositionThe z-position of the ray. Since all rays start and end usually in the same plane the z-position is not stored inside the PlaneWaveData structure. So during the tracing of one PlaneWaveData the z-position has to be stored separate.

///

Parameters
findLeftRightTransitionIf true the function tries to find an interface transition between the medium globally on the left side of the interface and the medium globally on the right side of the interface. If false the function tries to find an interface transition between the medium on the right side of the interface and on the medium on the left side of the interface.
normalVectorThe normal vector of the interface on the intersection point. The normal vector points in positive z-direction for rays traveling in positive z-direction and it points in negative z-direction for rays traveling in negative z-direction.
Returns
True if an intersection point was found.

◆ GetIntersectionsWithLine()

double[] GetIntersectionsWithLine ( double  zPos,
double  lineShift,
bool  searchParallelToXAxis,
double  minValueOfFreeCoordinate,
double  maxValueOfFreeCoordinate,
double  transitionPointAccuracy,
out double[]  signOfDerivatives 
)

Calculate the intersections of the surface with a line parallel to X-axis or to Y-axis with given start and end coordinate. May be overridden in derived interfaces.

Parameters
zPosZ-position of the line (2-D FMM) that is searched for media transitions. Must be given in interface cs(!)
lineShiftLine shift (1) on Y-axis iff searchParallelXAxis == true, (2) on X-axis iff searchParallelXAxis == false
searchParallelToXAxisIff true, the search line is parallel to X-axis; iff false, search line is parallel to Y-axis
minValueOfFreeCoordinateStart coordinate on the line. Interface coordinates.
maxValueOfFreeCoordinateEnd coordinate on the line. Interface coordinates.
transitionPointAccuracyAccuracy Factor.
signOfDerivativesOut parameter for sign of derivatives at intersection points.
Returns
Double array with intersection points on that line. Null if no intersections can be found.

◆ GetPointInterfaceRelation()

override PointInterfaceRelation GetPointInterfaceRelation ( Vector3D  position)

Checks the position of a point relative to the interface. A point can be in the medium on the right side of a interface, in the medium on the left side of the interface or lateral outside of the interface.

Parameters
positionThe position to check.
Returns
A PointInterfaceRelation enum indicating the relation of the point to the interface.

◆ GetPolygonPoints()

override sealed List< VectorD > GetPolygonPoints ( double  startCoordinate,
double  endCoordinate,
double  accuracyFactor = 1 
)

Gets the polygon points representing this interface including scaling, periodization, consideration of the definition areas, ...

Parameters
startCoordinateThe x-coordinate of the start point (y = 0).
endCoordinateThe x-coordinate of the end point (y = 0).
accuracyFactorThe accuracy factor. This optional parameter is equal to one by default. 20 × the accuracy polygon points are calculated whereas it is ensured that an odd number of polygon points is returned.
Returns
A list of VectorD objects storing x-position and corresponding height.

◆ IsAbsorbingAtPosition()

bool IsAbsorbingAtPosition ( VectorD  position)

Returns true if the interface absorbs the light at the position (x,y), otherwise false.

Parameters
positionThe lateral position to check.
Returns
True if the interface absorbs the light at the position (x,y), otherwise false.

◆ IsConsistent()

override bool IsConsistent ( ref List< ConsistenyErrorOrWarning >  errorList,
EditedInType  editedFrom = EditedInType.Component 
)

Method to check whether the interface is defined consistently.

Parameters
errorListReference to a list which can already contain some messages. If the interface is inconsistent the error messages are appended to this list. If null, a new list is created.
editedFromSpecifies from where this interface is edited. If this optional parameter is set to EditedInType.Catalog then a SpreadSheetObject having no subsequent medium is allowed even if AllowedSubsequentMedium is true. The reasoning for this optional parameter is that optical interfaces in the catalog do not have a subsequent medium.
Returns
true, if the interface is consistent, otherwise false.

◆ MinimumFeatureSize()

VectorD MinimumFeatureSize ( double  accuracyFactor)

Gets the minimum feature size of the interface.

Parameters
accuracyFactorThe accuracy factor used for the calculation of the minimum feature size.
Returns
The minimum feature size (in meters) for both x- and y-direction.

◆ ProfileHeight() [1/4]

double ProfileHeight ( double  x,
double  y 
)

Profile height calculation which includes pixelation, quantization and scaling in x-, y- and z- direction.

Parameters
xThe lateral x-position.
yThe lateral y-position.
Returns
Returns the profile height depending on the lateral position.

◆ ProfileHeight() [2/4]

double ProfileHeight ( VectorD  position)

Profile height calculation which includes pixelation, quantization and scaling in x-, y- and z- direction.

Parameters
positionPosition on which the height profile shall be calculated.
Returns
Height value on that position.

◆ ProfileHeight() [3/4]

double ProfileHeight ( VectorD  position,
out bool  isAbsorbed 
)

Profile height calculation which includes pixelation, quantization and scaling in x-, y- and z- direction.

Parameters
positionthe position on which the height profile shall be calculated
isAbsorbedOut parameter specifying whether or not light on the given position is absorbed by an aperture.
Returns
The height value on the position.

◆ ProfileHeight() [4/4]

double ProfileHeight ( VectorD  position,
out bool  isAbsorbed,
bool  includeQuantization,
bool  subtractHeightOffset = true,
double?  nanValue = null 
)

profile height calculation which includes pixelation, quantization and scaling in x-, y- and z-direction

Parameters
positionthe position on which the height profile shall be calculated
isAbsorbedOut parameter specifying whether or not light on the given position is absorbed by an aperture.
includeQuantizationTo apply quantization one needs to know the total profile height (without quantization). Thus this parameters allows to switch of the quantization during calculation of that total profile height.
subtractHeightOffsetOptional parameter to avoid recursion - as the offset to be subtracted is the height at the position (0, 0) without the offset subtracted.
nanValueThe value with which NaNs are replaced. If this optional parameter is not specified, the value outside the (inner) definition area is used.
Returns
The height value on the position.

Property Documentation

◆ FresnelZonesRelativePositionOnZAxis

double FresnelZonesRelativePositionOnZAxis
getset

Gets and sets the relative position on the z-axis for the Fresnel zones.


◆ IsRotationalSymmetric

bool IsRotationalSymmetric
get

Gets whether the given surface is rotational symmetric. The following conditions must be fulfilled for rational symmetry:

  • The surface must not be periodical.
  • The definition are must be rotational symmetric.
  • The surface must be either an aspherical, conical interface or unrotated plane interface - or a combined interface containing only such interfaces.
Returns
TRUE if the surface is rotational symmetric, otherwise FALSE.