focus3d Class Reference

A class. More...

#include <focus3d.h>

Collaboration diagram for focus3d:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 focus3d (focus3d_parameters q)
 A Constructor.
 ~focus3d ()
 A Destructor.
void calculate_focus ()
 A method for calculating focal field distribution.
void reset_parameters (focus3d_parameters q)
 A method for resetting parameters.
void calculate_focus (Array< complex< double >, 3 > &x_comp, Array< complex< double >, 3 > &y_comp, Array< complex< double >, 3 > &z_comp)
 A method for calculating focal field distributon and outputting it.
void save_results (string idir)
 A method for saving the calculated results in a file.
void set_incident_field (Array< complex< double >, 2 > E_x, Array< complex< double >, 2 > E_y, Array< complex< double >, 2 > E_z)
 A method for loading the incident field from arrays.
void set_incident_field (complex< double > E_x, complex< double > E_y, complex< double > E_z)
 A method for loading the incident field from scalars.
void set_incident_field (string filename_xcomp, string filename_ycomp, string filename_zcomp)
 A method for loading the incident field from files.
void set_angular_weights (Array< complex< double >, 2 > aweights)
 A method for loading the angular weights from an array.
void set_angular_weights (string ampl_coeff_file, string phase_coeff_file)
 A method for loading the angular weights from files.
void set_angular_weights (string g_of_theta_file)
 A method for loading the angular weights from a file.


Detailed Description

A class.

Use this class to calculate the three dimensional distribution of the focal field. This class uses the arrays from the blitz++ library. Hence to use this class and the dipole_radiation class it would be a good idea to read up the documentation of blitz++ arrays.

Using this class in your code is pretty simple. The following piece of code generates the three dimensional vectorial focal field distribution and saves the results:

Examples:

focal_volume.cpp.


Constructor & Destructor Documentation

focus3d::focus3d ( focus3d_parameters  q  ) 

A Constructor.

Takes the input parameters through an object of focus3d_parameters class and initializes all the internal matrices. It calls internally the focus3d_parameters::test() memeber function to test the sanity of the parameters. If insane, the program quits. Internally, this constructor calls the reset_parameters() method.

Parameters:
q - A focus3d_parameters object

focus3d::~focus3d (  ) 

A Destructor.

Releases the the memory associated with all the allocated internal matrices.


Member Function Documentation

void focus3d::calculate_focus (  ) 

A method for calculating focal field distribution.

Calculates the focus field distributions for all the three components of polarization.

Returns:
void.
Examples:
focal_volume.cpp.

void focus3d::reset_parameters ( focus3d_parameters  q  ) 

A method for resetting parameters.

Reloads the new parameters and redefines the sizes of the internal matrices.

Parameters:
q an instance of focus3d_parameters class. Note the effect of using this function is that it resets the effects of previous calls to set_incident_field and set_angular_weights.
q - A focus3d_parameters object
Returns:
void.

void focus3d::calculate_focus ( Array< complex< double >, 3 > &  x_comp,
Array< complex< double >, 3 > &  y_comp,
Array< complex< double >, 3 > &  z_comp 
)

A method for calculating focal field distributon and outputting it.

Calculates the focus field distributions for all the three components saves the results in the variables called by reference. xcomp, ycomp and z_comp are matrices of size (Nx,Ny,Nz) allocated before passing to this function by reference.

Note: if the focal field is desired at just one point (x,y,z) then set the parameter variables Nx = Ny = Nz = 1 and xmin =x, ymin = y and zmin = z.

Parameters:
[out] x_comp - x-component of the focal field
[out] y_comp - y-component of the focal field
[out] z_comp - z-component of the focal field

void focus3d::save_results ( string  idir  ) 

A method for saving the calculated results in a file.

saves the calculated results to different files. The generated output files are:

  1. x.bar : blitz array corresponding to x coordinates
  2. y.bar : blitz array corresponding to y coordinates
  3. z.bar : blitz array corresponding to z coordinates
  4. theta.bar : blitz array corresponding to $\theta$ coordinates
  5. phi.bar : blitz array corresponding to $\phi$ coordinates
  6. E_focus_x.bar : blitz array cooresponding to the x-component of the focal field
  7. E_focus_y.bar : blitz array cooresponding to the y-component of the focal field
  8. E_focus_z.bar : blitz array cooresponding to the z-component of the focal field
  9. E_incident_x.bar : blitz array cooresponding to the x-component of the incident field
  10. E_incident_y.bar : blitz array cooresponding to the y-component of the incident field
  11. E_incident_z.bar : blitz array cooresponding to the z-component of the incident field
  12. angular_weights.bar : blitz array cooresponding to the angular weights / scattering coeffs.
  13. simulation_parameters.dat : an ascii file with the applied simulation parameters

Note:

  • all the files are stored in a subdirectory called (in MATLAB format) [idir '_focus_lam_' + num2str(lambda) + '/']
  • the first five files contain one dimensional real data
  • the next three files contain three dimensional complex data
  • the next four files contain two dimensional complex data as a function of ($\theta$, $\phi$)
  • each complex number A+iB is represented as (A,B)
  • the class uses the blitz++ arrays in column major format and hence the matrix A(i,j,k) is stored with the index k as the fastest running one and the index i being the slowest running one.

Parameters:
idir - prefix to the directory to which the results have to be saved
Returns:
void.
Examples:
focal_volume.cpp.

void focus3d::set_incident_field ( Array< complex< double >, 2 >  E_x,
Array< complex< double >, 2 >  E_y,
Array< complex< double >, 2 >  E_z 
)

A method for loading the incident field from arrays.

The incident field is the field that is incident on the flat surface tangent to the lens curvature. It has three components corresponding to x, y and z polarizations. If we denote them as E_x, E_y and E_z, then the inputs should be three matrices of the size of (Ntheta, Nphi), i.e. E_x = E_x($\theta$,$\phi$), E_z = E_y($\theta$,$\phi$) and E_z = E_z($\theta$,$\phi$). If the input is just an x-polarized plane parallel beam, then you might set E_x = 1; E_y =0; E_z = 0. This is the default case.

Parameters:
[in] E_x - E_x($\theta$,$\phi$)
[in] E_y - E_y($\theta$,$\phi$)
[in] E_z - E_z($\theta$,$\phi$)
Returns:
void.
Examples:
focal_volume.cpp.

void focus3d::set_incident_field ( complex< double >  E_x,
complex< double >  E_y,
complex< double >  E_z 
)

A method for loading the incident field from scalars.

The incident field is the field that is incident on the flat surface tangent to the lens curvature. It has three components corresponding to x, y and z polarizations. If we denote them as E_x, E_y and E_z, then the inputs should these three matrices of the size of (Ntheta, Nphi), i.e. E_x = E_x($q$,$f$), E_z = E_y($q$,$f$) and E_z = E_z($q$,$f$). But if the matrices are constant matrices, then this function can be used input the the three complex numbers corresponding to the three polarizations. For example: if the input is just an x-polarized plane parallel beam, then you might set E_x = 1; E_y =0; E_z = 0. This is the default case.

Parameters:
[in] E_x - value of x-polarization of the field
[in] E_y - value of y-polarization of the field
[in] E_z - value of z-polarization of the field
Returns:
void.

void focus3d::set_incident_field ( string  filename_xcomp,
string  filename_ycomp,
string  filename_zcomp 
)

A method for loading the incident field from files.

The incident field is the field that is incident on the flat surface tangent to the lens curvature. It has three components corresponding to x, y and z polarizations. If these three components are stored in three different files in blitz array format in column major ordering then, this function can be used to load them.

Parameters:
[in] filename_xcomp - name of the file containing x-component of the incident field
[in] filename_ycomp - name of the file containing y-component of the incident field
[in] filename_zcomp - name of the file containing z-component of the incident field
Returns:
void.

void focus3d::set_angular_weights ( Array< complex< double >, 2 >  aweights  ) 

A method for loading the angular weights from an array.

This function is used to include the effects of scattering on the focal amplitude. It populates an internal variable called angular_weights which effectively describes how much the rays traveling at angle ($\theta$,$\phi$) gets affected by the medium. If the medium is non-scattering then the input should be a uniform matrix of value 1.0 which is the case by default.

Parameters:
[in] aweights - matrix of size (Ntheta,Nphi) which effectively describes the scattering function of the medium.
Returns:
void.

void focus3d::set_angular_weights ( string  ampl_coeff_file,
string  phase_coeff_file 
)

A method for loading the angular weights from files.

This function is used to include the effects of scattering on the focal amplitude. It populates an internal variable called angular_weights which effectively describes how much the rays traveling at angle ($\theta$,$\phi$) gets affected by the medium.

Parameters:
[in] ampl_coeff_file - a std::string containing the name of the file with polynomial coefficients that fits the amplitude of the scattering of the medium.
[in] phase_coeff_file - a std::string containing the name of the file with polynomial coefficients that fits the phase of the scattering of the medium.
Returns:
void.

void focus3d::set_angular_weights ( string  g_of_theta_file  ) 

A method for loading the angular weights from a file.

This function is used to include the effects of scattering on the focal amplitude. It populates an internal variable called angular_weights which effectively describes how much the rays traveling at angle ($\theta$,$\phi$) gets affected by the medium.

Parameters:
[in] g_of_theta_file - std::string with filename of a file containing three colums corresponding to $ \theta $, $ |G(\theta)| $, and angle($ G(\theta) $).
Returns:
void.


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

Generated on Tue May 13 14:25:06 2008 for focal fields package by  doxygen 1.5.5