|
Open PaperOpt
|
#include <SurfaceTopography.h>


Public Member Functions | |
| SurfaceTopography () | |
| SurfaceTopography (float _zoffset, Array2D< float > &z, float sizeX, float sizeY, Array2D< V2< float > > &v, StructureObject *_el) | |
| SurfaceTopography (float _zoffset, float _rms_lo, float _rms_hi, Array2D< float > &z, float sizeX, float sizeY, StructureObject *_el) | |
| virtual | ~SurfaceTopography () |
| int | mIntercept (WavePacket &wp, double t1, double t2, int updown, double &t) const |
| int | Process (WavePacket &wp, int up_down, int internal) const |
| double | mZposition (WavePacket &wp) const |
Protected Member Functions | |
| bool | CellIntercept (WavePacket &wp, int x1, int y1, double &t, double t_c1, double t_c2) const |
| bool | UnicellIntercept (WavePacket &wp, double &t, double t1, double t2) const |
| V2< float > | GetRoughness (WavePacket &wp) const |
Protected Attributes | |
| vector< float > | mXvector |
| vector< float > | mYvector |
| Array2D< float > * | mZmatrixHeight |
| Array2D< V2< float > > * | mRoughnessMap |
| Array2D< float > * | mZminCellMatrix |
| Array2D< float > * | mZmaxCellMatrix |
| Array2D< V3< double > > * | mNormalsLl |
| Array2D< V3< double > > * | mNormalsUr |
| Array2D< float > * | mPlaneOffsetLl |
| Array2D< float > * | mPlaneOffsetUr |
| float | mDx |
| float | mDy |
| int | mNumberGridPointsX |
| int | mNumberGridPointsY |
| double | mDxRough |
| double | mDyRough |
| bool | mDetailedRoughness |
Surface object defined from heigth matrix with triangular interpolation between gridpoints. Two constructors are available. One uses constant V2 rouhghness values on the whole surface. One uses a roughness map that can be defined at another resolution than the matrix height. Upon surface scattering, the microrooughness is homogeneously distributed between min and max roughness value.
| SurfaceTopography::SurfaceTopography | ( | ) | [inline] |
| SurfaceTopography::SurfaceTopography | ( | float | _zoffset, |
| Array2D< float > & | z, | ||
| float | sizeX, | ||
| float | sizeY, | ||
| Array2D< V2< float > > & | v, | ||
| StructureObject * | _el | ||
| ) |
Constructor that allows setting a roughness map where the microroughness of the surface is varying depending on the x-y position
| _zoffset | Position of the mean height of the surface (<= 0 in mum) |
| z | Surface height matrix relative to its mean |
| sizeX | Size of the surface in x-direction (mum) |
| sizeY | Size of the surface in y-direction (mum) |
| v | Roughness matrix (min and max in mum) |
| _el | Pointer to the previous StructureObject in the structure |
| SurfaceTopography::SurfaceTopography | ( | float | _zoffset, |
| float | _rms_lo, | ||
| float | _rms_hi, | ||
| Array2D< float > & | z, | ||
| float | sizeX, | ||
| float | sizeY, | ||
| StructureObject * | _el | ||
| ) |
Constructor with constant microroughness on the whole surface
| _zoffset | Position of the mean height of the surface (<= 0 in mum) |
| _rms_lo | Minimum surface microroughness |
| _rms_hi | Maximum surface microroughness |
| z | Surface height matrix relative to its mean |
| sizeX | Size of the surface in x-direction (mum) |
| sizeY | Size of the surface in y-direction (mum) |
| _el | Pointer to the previous StructureObject in the structure |
| SurfaceTopography::~SurfaceTopography | ( | ) | [virtual] |
Empty destructor. Surfaces are constant through the simulation.
| bool SurfaceTopography::CellIntercept | ( | WavePacket & | wp, |
| int | x1, | ||
| int | y1, | ||
| double & | t, | ||
| double | t_c1, | ||
| double | t_c2 | ||
| ) | const [protected] |
A function used by mIntercept. Returns true if the wp will intercept the surface of the cell betweeen two of the surface grid points.Returns true if the wp will intercept the surface of the cell. x1 and y1 should refer to the lower left grid point of the cell. t_c1 and t_c2 (where t_c1<=t_c2) should be the the parametric distance to the cell borders (or to points within the cell). The distance to the surface will be stored in t. The surface point will be stored in wp.mSposition, and the normal (always with positive z-comp.) will be stored in wp.mSnormal.
| wp | The normal will be stored in wave packet surface normal. |
| x1 | Lower grid point of the cell |
| y1 | Lower grid point of the cell. |
| t | Allowed propagating distance until surface hit |
| t_c1 | Parametric distance to the cell borders |
| t_c2 | Parametric distance to the cell borders |
Parametric distance to the surface defined by the lower left triangle
Parametric distance to the surface defined by the upper right triangle
Choose the closest hit triangle (if any).


| V2< float > SurfaceTopography::GetRoughness | ( | WavePacket & | wp | ) | const [protected] |
Returns the roughness interval with respect to the lateral position of wp.


| int SurfaceTopography::mIntercept | ( | WavePacket & | wp, |
| double | t1, | ||
| double | t2, | ||
| int | updown, | ||
| double & | t | ||
| ) | const [virtual] |
Find intercept between the wave packet and the surface The intersection position and surface normal are stored in wp's members wp.mSposition and wp.mSnormal. 0<=t1<=t2 are the allowed travel distances until intercept. A surface hit before t1 or after t2 will not be detected.
| wp | Wave Packet |
| t1 | Minimum allowed wp travel to surface interception |
| t2 | Maximum allowed wp travel to surface interception |
| ud | 1 if wp going up, -1 if wp going up |
| t | Return the actual wp travel distance to the surface |
Direction components that are zero are potentially dangerous in many places. Therefor we set them to a small value and ignore the effect of a normalization. Cases where the mZ-component are 1 are handled separately.
If possible, narrow down t1 and t2 to the intersection distances with the bounding volume. If the wp is to miss the box, we want to abort (return 0).
Find the first hit cell (and a few security checks).
Determine initial values to be used in the algorithm below.
Calculate t_v and t_h.
Examine cells in the order of the travelling direction. Reject cells early on if the wp won't pass toPass.
Reimplemented from Surface.


| double SurfaceTopography::mZposition | ( | WavePacket & | wp | ) | const [virtual] |
Calculates the z-coordinate of wp's projection onto the surface. Requires that wp is within the x- and y-boundaries.
| wp | Wave Packet |
Extract cell indices.
Check on the boundary and fix numerical problems
Lower left triangle?
Upper right triangle
Reimplemented from Surface.


| int SurfaceTopography::Process | ( | WavePacket & | wp, |
| int | up_down, | ||
| int | internal | ||
| ) | const [virtual] |
Process the wp onto the surface. Change wp's state depending on reflection or refraction. Internal means that wp is already at surface position, surface normal and position are set in wp.mSposition and wp.mSnormal. mInrecrept is called it wp had to travel to surface.
| wp | Wave Packet |
| up_down | 1 if wp going up, -1 if wp going up |
| internal | 1 if internal, i.e. wp already hit the surface in e.g. StructureObject::PropInLayer. 0 if wp has to move to surface first. |
If not internal, compute the surface interception point, if any.
Move the wp to the surface and pick up the computed surface normal stored in Snormal
Find the refractive indices of the surrounding layers. Discard layers that are too thin.
Calculate the local coordinate system direction cosines for mXvector and mYvector. The local coordinate system is defined so that the wave packet lies in the local xz-plane (BSDF standard notation).
Transform the wave packets to the local coordinate system.
Rotate the polarization vector and select only the local s- and p- polarizations.
Determine the choice of reflection / transmission, etc.
Rotate the trajectory cosines for scattered wave packet.
Rotate the polarization to the global coordinate system.
If reflected, we want to stay in the same layer
Return the number of Homogeneous Layers to pass if going up, or minus the number of Homogeneous Layers to pass if going down.
Reimplemented from Surface.

| bool SurfaceTopography::UnicellIntercept | ( | WavePacket & | wp, |
| double & | t, | ||
| double | t1, | ||
| double | t2 | ||
| ) | const [protected] |
Works like mCellIntercept, but requires that wp.mDir=(0,0,+-1). Exists only because there might be cases where wp.mDir=(0,0,+-1) is preferrable to wp.mDir=(+-eps,+-eps,+-1)
| t | Allowed propagating distance until surface hit |
| t1 | Parametric distance to the cell borders |
| t2 | Parametric distance to the cell borders |
Extract cell indices.
Check on the boundary.
Lower left triangle
Upper right triangle


bool SurfaceTopography::mDetailedRoughness [protected] |
Tell if the surface roughnes is defined with an roughness array or with a constant
float SurfaceTopography::mDx [protected] |
Resolution of the surface height matrix
double SurfaceTopography::mDxRough [protected] |
Resolution of the roughness map
float SurfaceTopography::mDy [protected] |
double SurfaceTopography::mDyRough [protected] |
Array2D< V3<double> >* SurfaceTopography::mNormalsLl [protected] |
Normals of the lower left triangle of the cells
Array2D< V3<double> >* SurfaceTopography::mNormalsUr [protected] |
Normals of the upper right triangle of the cells
int SurfaceTopography::mNumberGridPointsX [protected] |
Number of gridpoints of the surface height matrix
int SurfaceTopography::mNumberGridPointsY [protected] |
Array2D<float>* SurfaceTopography::mPlaneOffsetLl [protected] |
The offset of the planes defined by the triangles with respect to the normals.
Array2D<float>* SurfaceTopography::mPlaneOffsetUr [protected] |
Array2D< V2<float> >* SurfaceTopography::mRoughnessMap [protected] |
Surface matrix roughness map (min and max roughness values defined at each point
vector<float> SurfaceTopography::mXvector [protected] |
x-values on the matrix height of the surface
vector<float> SurfaceTopography::mYvector [protected] |
y-values on the matrix height of the surface
Array2D<float>* SurfaceTopography::mZmatrixHeight [protected] |
Surface matrix height map
Array2D<float>* SurfaceTopography::mZmaxCellMatrix [protected] |
Largest height value of each cell
Array2D<float>* SurfaceTopography::mZminCellMatrix [protected] |
Smallest height value of each cell