Open PaperOpt
SurfaceTopography Class Reference

#include <SurfaceTopography.h>

Inheritance diagram for SurfaceTopography:
Collaboration diagram for SurfaceTopography:

List of all members.

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

Detailed Description

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.

See also:
Surface SurfaceTopo

Constructor & Destructor Documentation

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

Parameters:
_zoffsetPosition of the mean height of the surface (<= 0 in mum)
zSurface height matrix relative to its mean
sizeXSize of the surface in x-direction (mum)
sizeYSize of the surface in y-direction (mum)
vRoughness matrix (min and max in mum)
_elPointer 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

Parameters:
_zoffsetPosition of the mean height of the surface (<= 0 in mum)
_rms_loMinimum surface microroughness
_rms_hiMaximum surface microroughness
zSurface height matrix relative to its mean
sizeXSize of the surface in x-direction (mum)
sizeYSize of the surface in y-direction (mum)
_elPointer to the previous StructureObject in the structure
SurfaceTopography::~SurfaceTopography ( ) [virtual]

Empty destructor. Surfaces are constant through the simulation.


Member Function Documentation

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.

Parameters:
wpThe normal will be stored in wave packet surface normal.
x1Lower grid point of the cell
y1Lower grid point of the cell.
tAllowed propagating distance until surface hit
t_c1Parametric distance to the cell borders
t_c2Parametric distance to the cell borders
Returns:
TRUE if interception, FALSE otherwise

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).

Here is the call graph for this function:

Here is the caller graph for this function:

V2< float > SurfaceTopography::GetRoughness ( WavePacket wp) const [protected]

Returns the roughness interval with respect to the lateral position of wp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
wpWave Packet
t1Minimum allowed wp travel to surface interception
t2Maximum allowed wp travel to surface interception
ud1 if wp going up, -1 if wp going up
tReturn the actual wp travel distance to the surface
Returns:
0 if no interception found, 1 otherwise

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
wpWave Packet
Returns:
the z-coordinate (absolute) of wp's projection onto the surface.

Extract cell indices.

Check on the boundary and fix numerical problems

Lower left triangle?

Upper right triangle

Reimplemented from Surface.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
wpWave Packet
up_down1 if wp going up, -1 if wp going up
internal1 if internal, i.e. wp already hit the surface in e.g. StructureObject::PropInLayer. 0 if wp has to move to surface first.
Returns:
0 if error or no surface hit n if the wp is going n layers up, and -n if the wp is going n layers down because if intermediate layers have 0 thickness the wp will go to the first non infinitesimal thickness layer at the surface intersection.

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.

Here is the call graph for this function:

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)

Parameters:
tAllowed propagating distance until surface hit
t1Parametric distance to the cell borders
t2Parametric distance to the cell borders
See also:
mCellIntercept

Extract cell indices.

Check on the boundary.

Lower left triangle

Upper right triangle

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

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

Number of gridpoints of the surface height matrix

The offset of the planes defined by the triangles with respect to the normals.

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

Surface matrix height map

Largest height value of each cell

Smallest height value of each cell


The documentation for this class was generated from the following files: