Class RigorousSimulationResultBase
- Namespace
- VirtualLabAPI.Core.FieldRepresentations
- Assembly
- VirtualLabAPI.dll
Base class for storing the results of rigorous calculations, i. e. efficiencies and Rayleigh coefficients per order.
public abstract class RigorousSimulationResultBase : FieldRepresentationObject, ISerializable, IDeserializationCallback, IDocument, IEquatable<IObjectBase>, ICloneable, IDisposable, IProvidesPositioningReferences
- Inheritance
-
ObjectBaseSerializableObjectBaseManualSerializationRigorousSimulationResultBase
- Implements
-
IEquatable<IObjectBase>
- Derived
- Inherited Members
- Extension Methods
Constructors
RigorousSimulationResultBase()
Empty constructor to allow some special constructors in the derived classes.
protected RigorousSimulationResultBase()
RigorousSimulationResultBase(List<OrderInfoIncomplete>, double, Vector3D, VectorD, HomogeneousMedium, HomogeneousMedium, bool)
Initializes a new instance of the RigorousSimulationResultBase class.
public RigorousSimulationResultBase(List<OrderInfoIncomplete> orderInfo, double wavelength, Vector3D waveVectorIncidentWave, VectorD periods, HomogeneousMedium mediumBefore, HomogeneousMedium mediumAfter, bool useForTransmission)
Parameters
orderInfoList<OrderInfoIncomplete>The order information.
wavelengthdoubleThe wavelength.
waveVectorIncidentWaveVector3DThe wave vector of the incident wave.
periodsVectorDThe periods of the grating structure for which results were obtained (in x- and y-direction).
mediumBeforeHomogeneousMediumThe medium before the grating structure for which results were obtained. This is the medium from which the incident wave comes.
mediumAfterHomogeneousMediumThe medium after the grating structure for which results were obtained.
useForTransmissionboolif set to
truethe created rigorous simulation results stores transmission results.
RigorousSimulationResultBase(RigorousSimulationResultBase)
Copy Constructor.
public RigorousSimulationResultBase(RigorousSimulationResultBase objectToCopy)
Parameters
objectToCopyRigorousSimulationResultBaseThe object to copy.
Properties
FieldRepresentation
Gets the type of the field representation.
public override FieldRepresentation FieldRepresentation { get; }
Property Value
- FieldRepresentation
FileExtension
Gets the file extension.
public override string FileExtension { get; }
Property Value
KSpaceSampling
Gets and sets the sampling in the k-space. Usually derived from the period of the analyzed structure.
public virtual VectorD KSpaceSampling { get; set; }
Property Value
LFO_CoordinateSystem
public method to set and get the coordinate system of the RigorousSimulationResult
public CartesianCoordinateSystem LFO_CoordinateSystem { get; set; }
Property Value
MaximumOrderNumber
Gets the maximum absolute value of all order numbers.
protected Vector MaximumOrderNumber { get; }
Property Value
Orders
Gets and sets the actual results (Rayleigh coefficients and efficiencies per diffraction order).
public OrderInfoWithDirection[] Orders { get; set; }
Property Value
TypeOfDocument
Gets an enum entry specifying the type of the document.
public override DocumentType TypeOfDocument { get; }
Property Value
- DocumentType
WaveVectorZerothOrder
Gets and sets the wave vector of the zeroth order.
public WaveVector WaveVectorZerothOrder { get; set; }
Property Value
- WaveVector
Wavelength
Gets and sets vacuum wavelength for which the results were obtained.
public double Wavelength { get; set; }
Property Value
Methods
CalculateEfficiencies(VectorC, Vector3D)
Calculates the efficiencies of all orders (anew).
public void CalculateEfficiencies(VectorC electricalFieldExEy, Vector3D directionOfIncidentPlaneWave)
Parameters
electricalFieldExEyVectorCtransverse E-field components i.e. (Ex, Ey) of the incident plane wave.
directionOfIncidentPlaneWaveVector3DThe direction of the incident plane wave.
Clone()
Create deep copy of field representation. \static{}
public override object Clone()
Returns
- object
The cloned object.
ConvertComplexAmplitudeToRigorousSimulationResult(ComplexAmplitude, HomogeneousMedium, HomogeneousMedium, VectorC, Vector3D, bool)
Converts a ComplexAmplitude into a RigorousSimulationResultBase, assuming that the ComplexAmplitude represents the transmitted field.
public static RigorousSimulationResultBase ConvertComplexAmplitudeToRigorousSimulationResult(ComplexAmplitude ca, HomogeneousMedium superstrate, HomogeneousMedium substrate, VectorC electricalFieldExEy, Vector3D directionOfIncidentPlaneWave, bool useForTransmission)
Parameters
caComplexAmplitudeThe complex amplitude to be casted.
superstrateHomogeneousMediumThe medium of the incident and the reflected field.
substrateHomogeneousMediumThe medium of the transmitted field. This should be identical to the Embedding Medium of the given complex amplitude.
electricalFieldExEyVectorCtransverse E-field components i.e. (Ex, Ey) of the incident plane wave.
directionOfIncidentPlaneWaveVector3DThe direction of the incident plane wave.
useForTransmissionboolIf set to
truethe created rigorous simulation results stores transmission results.
Returns
- RigorousSimulationResultBase
A RigorousSimulationResultBase object.
ConvertRigorousSimulationResultToNearField(RigorousSimulationResultBase, double, int, bool, bool, bool, double)
Propagate function for the near field operator for FMM. For details see the internal technical note about the Grating Toolbox and eqs. (2.102) ff. in "Microphotonics" by J. Turunen (lecture notes).
public static ComplexAmplitude ConvertRigorousSimulationResultToNearField(RigorousSimulationResultBase rigorousSimulationResults, double oversamplingFactor, int numberOfPeriods, bool returnOnedimensionalField, bool sampleLinearPhase, bool applyEvanescentFieldFilter = false, double distance = 0)
Parameters
rigorousSimulationResultsRigorousSimulationResultBaseThe rigorous simulation results.
oversamplingFactordoubleOversampling Factor for finer sampling.
numberOfPeriodsintHow many periods shall be visible?
returnOnedimensionalFieldboolShall a one-dimensional or a two-dimensional field be returned?
sampleLinearPhaseboolShall the linear phase resulting from the principal direction be visible in the output field?
applyEvanescentFieldFilterboolIf this optional parameter is set to
trueevanescent orders are filtered out.distancedoubleIf this parameter is specified, an additional propagation of the near field by the specified distance is done.
Returns
- ComplexAmplitude
A ComplexAmplitude object storing the near field.
Exceptions
- ArgumentException
A near field cannot be calculated if the zeroth order is evanescent.
Equals(object, EqualityIntent)
Determines whether the specified object is equal to this instance.
public override bool Equals(object otherObject, EqualityIntent equalityIntent)
Parameters
otherObjectobjectThe object to compare with this instance.
equalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or just physical equality.
Returns
GetDirectionOfOrder(int, int)
Gets the direction of a certain order. We are in the field's coorinate system, i.e. the sign of the real part of the z-component of the resulting wave number vector is greater than or equal to zero for transmitted light (zero indicates evanescent waves).
public WaveVector GetDirectionOfOrder(int orderNumberX, int orderNumberY = 0)
Parameters
orderNumberXintThe number of the order in x-direction.
orderNumberYintThe number of the order in y-direction. Can be omitted if the results have been calculated for a system having no modulation in y-direction.
Returns
- WaveVector
The direction of the specified order.
GetDirectionOfOrder(Vector)
Gets the direction of a certain order. We are in the field's CS, i.e. the sign of the real part of the z-component of the resulting wave number vector is greater than or equal to zero for transmitted light (zero indicates evanescent waves).
public WaveVector GetDirectionOfOrder(Vector orderNumber)
Parameters
orderNumberVectorThe order numbers for x- and y-direction for which the direction shall be calculated.
Returns
- WaveVector
The direction of the specified order.
GetOrder(int, int)
Gets the order with specified order number(s).
public OrderInfoWithDirection GetOrder(int orderNumberX, int orderNumberY = 0)
Parameters
orderNumberXintThe number of the order in x-direction.
orderNumberYintThe number of the order in y-direction. Can be omitted if the results have been calculated for a system having no modulation in y-direction.
Returns
- OrderInfoWithDirection
The order with specified order number(s). Null if no orders are present or if no matching order could be found.
GetSummedEfficiencies()
Gets the sum of the efficiencies of all orders.
public double GetSummedEfficiencies()
Returns
- double
The sum of the efficiencies.
OrderInfoFromComplexFields(ComplexField[], ComplexField, Vector?)
Creates a list of OrderInfo objects from the given Rayleigh coefficients and efficiencies. It is assumed that all ComplexField objects passed as parameter have the same (odd) number of sampling points and that the values of the zeroth order are in the center of the field, respectively.
public static List<OrderInfoIncomplete> OrderInfoFromComplexFields(ComplexField[] rayleighCoefficients, ComplexField efficiencies, Vector? startOrder = null)
Parameters
rayleighCoefficientsComplexField[]Three ComplexField objects storing the Rayleigh coefficients for Ex, Ey, and Ez.
efficienciesComplexFieldA ComplexField storing the diffraction efficiencies of the orders.
startOrderVector?The order number of the first order (with index (0; 0)) in the complex fields. If this optional parameter is not specified or if it is
nullit is assumed that the zeroth order is in the center of the fields.
Returns
- List<OrderInfoIncomplete>
A list of OrderInfo objects.
Save(string)
Implementation of the IDocument Save function.
public override void Save(string filename)
Parameters
filenamestringPath and file name.
ShiftByHalfAPeriod()
Shifts the Rayleigh coefficients by half a period. This can be necessary as the Fourier Modal Method perform its calculations for transition points shifted by half a period. Thus the linear phase functions generated out of the Rayleigh coefficients bear that shift. To correct this we have to multiply a phase factor so that afterwards the phase at the position (0m; 0m) is equal to the original phase at the location (period.X / 2; period.Y /2).
public void ShiftByHalfAPeriod()