yanera_profile.h File Reference


Detailed Description

This file has the functions required for calculating the SLD profile, $\rho(z)$.

Definition in file yanera_profile.h.

Go to the source code of this file.

Functions

void yanera_write_profile (yanera_container *yanera)
 Write the SLD profiles to file.
double layerProfileReal (double z, yanera_model *model, yanera_container *yanera)
 Calulates $\rho(z)$ for a slab model.
double componentProfileReal (double z, yanera_model *model, yanera_container *yanera)
 Calulates $\rho(z)$ for a component model.
double functionProfileReal (double z, yanera_model *model, yanera_container *yanera)
 Calulates $\rho(z)$ for a function model.
double layerProfileImag (double z, yanera_model *model, yanera_container *yanera)
 Calulates imaginary component of $\rho(z)$ for a slab model.
double componentProfileImag (double z, yanera_model *model, yanera_container *yanera)
 Calulates imaginary component of $\rho(z)$ for a component model.
double functionProfileImag (double z, yanera_model *model, yanera_container *yanera)
 Calulates imaginary component of $\rho(z)$ for a function model.
void minMaxProfile (double *min, double *max, yanera_model *model, yanera_container *yanera)
 Figures the minimum and maximum $z$.


Function Documentation

void yanera_write_profile ( yanera_container yanera  ) 

Write the SLD profiles, $\rho(z)$, to file. The file names are drawn from the file names of the data files, and the file type suffix ".pro" is appended. If there were no data files, then the file name is "result_xx.pro", where xx is a sequential number based on the number of models.

Definition at line 25 of file yanera_profile.c.

double layerProfileReal ( double  z,
yanera_model model,
yanera_container yanera 
)

Parameters:
z Position $z$ to calculate $\rho(z)$
model The yanera_model to calculate.
yanera The general yanera_container.
Returns:
$\rho(z)$
For a set of $N$ layers, that run from bulk ($i=0$) to substrate ($i=N+1$) (or substrate to bulk), the scattering length density profile can be given as

\begin{eqnarray*} \rho(z) &=& \rho_0 + \sum_{i=1}^{N+1} \frac{(\rho_i-\rho_{i-1})}{2} \left( 1+\mathrm{erf}\left(\frac{z-z_i}{\sqrt{2}\sigma_i}\right) \right) \\ z_i &=& \sum_{j=1}^{i} t_j \end{eqnarray*}

where $t_i$ is the thickness, $\rho_i$ is the real part of the scattering length density, $\sigma_i$ the roughness, each of layer $i$. The location of the error function, $z_i$, is calculated by a running total of the thicknesses. When the roughness is zero, the error function becomes a Heavyside step function.

Definition at line 80 of file yanera_profile.c.

double componentProfileReal ( double  z,
yanera_model model,
yanera_container yanera 
)

Parameters:
z Position $z$ to calculate $\rho(z)$
model The yanera_model to calculate.
yanera The general yanera_container.
Returns:
$\rho(z)$
For a set of $N$ layers, that run from bulk ($i=0$) to substrate ($i=N+1$) (or substrate to bulk), the scattering length density profile is a sum of the components that form it.

\begin{displaymath} \rho(z) = \sum_{i=0}^{N+1} \rho_i \times F(z;\textrm{cntr},\textrm{sigz},\textrm{thik}) \end{displaymath}

where $F(z)$ is a functional form of a component, that may have XML tags specifying the center (<cntr/>), roughness (<sigz/>), and thickness (<thik/>).

The bulk and/or substrate are modeled by error functions centered at 0 and at the total thickness given by the <cntr/> tag for the bulk in the XML file.

\begin{eqnarray*} \rho(z) &=& \textrm{rsld}_0 \left( 1-\mathrm{erf}\left(\frac{z}{\sqrt{2}\textrm{sigz}_0}\right) \right) \\ &+& \textrm{rsld}_{N+1} \left( 1+\mathrm{erf} \left(\frac{z-\textrm{cntr}_{N+1}}{\sqrt{2}\textrm{sigz}_{N+1}}\right) \right) \end{eqnarray*}

For a Gaussian function, the <sigz/> tag becomes the width of the gaussian, given by

\[ \textrm{rsld}\times e^{-(z-\textrm{cntr})/\textrm{sigz}^2} \]

A box function is a box of total width <thik/>, convoluted with a Gaussian of width <sigz/>:

\[ \textrm{rsld}\times\left[ \mathrm{erf}\left(\frac{z-(\textrm{cntr}-\textrm{thik}/2)} {\sqrt{2}\cdot\textrm{sigz}}\right) - \mathrm{erf}\left(\frac{z-(\textrm{cntr}+\textrm{thik}/2)} {\sqrt{2}\cdot\textrm{sigz}}\right) \right] \]

If <sigz/> is zero, then the box function becomes a Heavyside step function, and the Gaussian becomes zero.

Definition at line 144 of file yanera_profile.c.

double functionProfileReal ( double  z,
yanera_model model,
yanera_container yanera 
)

Parameters:
z Position $z$ to calculate $\rho(z)$
model The yanera_model to calculate.
yanera The general yanera_container.
Returns:
$\rho(z)$
This function calculates a slab type profile model, as shown in the function slabProfile, but for layers that have a functional form, that layer is evaluated according to the expression.

Definition at line 239 of file yanera_profile.c.

double layerProfileImag ( double  z,
yanera_model model,
yanera_container yanera 
)

See also:
slabProfileReal

Definition at line 318 of file yanera_profile.c.

double componentProfileImag ( double  z,
yanera_model model,
yanera_container yanera 
)

See also:
componentProfileReal

Definition at line 370 of file yanera_profile.c.

double functionProfileImag ( double  z,
yanera_model model,
yanera_container yanera 
)

See also:
functionProfileReal

Definition at line 457 of file yanera_profile.c.

void minMaxProfile ( double *  min,
double *  max,
yanera_model model,
yanera_container yanera 
)

Parameters:
min Allocated double to contain the calculated minimum $z$
max Allocated double to contain the calculated maximum $z$
model The yanera_model to calculate.
yanera The general yanera_container.
Figures the minimum and maximum $z$ for the SLD profile. This is model ype dependant.
Bug:
My confidence that this function works for all cases is about 95%.

Definition at line 527 of file yanera_profile.c.


Generated on Thu May 29 10:56:33 2008 by  doxygen 1.5.5