#include <focus3d.h>

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. | |
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:
| 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.
| q | - A focus3d_parameters object |
| focus3d::~focus3d | ( | ) |
A Destructor.
Releases the the memory associated with all the allocated internal matrices.
| void focus3d::calculate_focus | ( | ) |
A method for calculating focal field distribution.
Calculates the focus field distributions for all the three components of polarization.
| void focus3d::reset_parameters | ( | focus3d_parameters | q | ) |
A method for resetting parameters.
Reloads the new parameters and redefines the sizes of the internal matrices.
| 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 |
| 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.
| [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:
coordinates
coordinatesNote:
,
)
| idir | - prefix to the directory to which the results have to be saved |
| 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(
,
), E_z = E_y(
,
) and E_z = E_z(
,
). 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.
| [in] | E_x | - E_x( , ) |
| [in] | E_y | - E_y( , ) |
| [in] | E_z | - E_z( , ) |
| 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(
,
), E_z = E_y(
,
) and E_z = E_z(
,
). 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.
| [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 |
| 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.
| [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 |
| 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 (
,
) 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.
| [in] | aweights | - matrix of size (Ntheta,Nphi) which effectively describes the scattering function of the medium. |
| 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 (
,
) gets affected by the medium.
| [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. |
| 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 (
,
) gets affected by the medium.
| [in] | g_of_theta_file | - std::string with filename of a file containing three colums corresponding to , , and angle( ). |
1.5.5