Initialize beam objects. More...
#include <iostream>#include <array>#include <cmath>#include <complex>#include "Utils.h"#include "Structs.h"#include "InterfaceReflector.h"Go to the source code of this file.
Macros | |
| #define | M_PI 3.14159265358979323846 |
| #define | __BeamInit_h |
Functions | |
| template<typename T , typename U , typename V > | |
| void | initFrame (T rdict, U *fr) |
| template<typename T , typename U , typename V > | |
| void | initRTGauss (T grdict, U *fr) |
| template<typename T > | |
| T | pdfGauss (std::vector< T > vars, std::vector< T > scales) |
| template<typename T , typename U , typename V , typename W , typename G > | |
| void | initGauss (T gdict, U refldict, V *res_field, V *res_current) |
| template<typename T , typename U , typename V , typename W , typename G > | |
| void | initScalarGauss (T sgdict, U refldict, V *res_field) |
| template<typename T , typename U , typename V , typename W > | |
| void | calcJM (T *res_field, T *res_current, V refldict, int mode) |
Initialize beam objects.
Initializes ray-trace frames, PO beams, and custom beams.
| void calcJM | ( | T * | res_field, |
| T * | res_current, | ||
| V | refldict, | ||
| int | mode | ||
| ) |
Calculate currents from electromagnetic field.
Calculate the J and M vectorial currents given a vectorial E and H field. Can calculate full currents, PMC and PEC surfaces.
| res_field | Pointer to c2Bundle or c2Bundlef object. |
| res_current | Pointer to c2Bundle or c2Bundlef object. |
| refldict | reflparams or reflparamsf object corresponding to surface on which to calculate currents. |
| mode | How to calculate currents. 0 is full currents, 1 is PMC and 2 is PEC. |
| void initFrame | ( | T | rdict, |
| U * | fr | ||
| ) |
| void initGauss | ( | T | gdict, |
| U | refldict, | ||
| V * | res_field, | ||
| V * | res_current | ||
| ) |
Initialize Gaussian beam from GPODict or GPODictf.
The generated Gaussian has E-field and magnetic currents only. This is what you want as a source in PO calculations.
Takes a GPODict or GPODictf and generates two c2Bundle or c2Bundlef objects, which contain the field and associated currents and are allocated to passed pointer arguments.
| void initRTGauss | ( | T | grdict, |
| U * | fr | ||
| ) |
| void initScalarGauss | ( | T | sgdict, |
| U | refldict, | ||
| V * | res_field | ||
| ) |
Initialize scalar Gaussian beam from GPODict or GPODictf.
Takes a ScalarGPODict or ScalarGPODictf and generates an arrC1 or arrC1f object.
| gdict | ScalarGPODict or ScalarGPODictf object from which to generate a Gaussian beam. |
| refldict | reflparams or reflparamsf object corresponding to surface on which to generate the Gaussian beam. |
| res_field | Pointer to arrC1 or arrC1f object. |
| T pdfGauss | ( | std::vector< T > | vars, |
| std::vector< T > | scales | ||
| ) |
Probability density function for drawing ray positions and tilts from Gaussian.
The density function is used for generating Gaussian ray-trace beams. Using rejection sampling, the method draws samples from the Gaussian pdf.
| vars | Vector of length 4, containing the xy positions and tilts of the ray to be checked. |
| scales | Vector of length 4 containing the scale factors along xy and tilts |