Electromagnetic Template Library (EMTL)
Loading...
Searching...
No Matches
uiDetector Class Reference

User interface class to store information about detectors. More...

#include <uiexp.h>

Collaboration diagram for uiDetector:

Public Member Functions

void SetTextureParams (valtype k=1., valtype shift=0., valtype k_disp=1., valtype shift_disp=0.)
 Underlying media may be displayed in QPLT format by overimposing them on the fields.
 
int SetUpdateInterval (int ufreq_=1)
 Set update detector update interval in steps, -1 for inactive detector.
 
int SetObliqueFrequency (int oblfreq_=1, int oblphase_=0)
 Set update detector update frequency in oblique iterations.
 
int SetOutPlaneMode (int dir=-1)
 Sets 'output plane mode' for grid detectors: in this mode extra separators are put in the output file between the data corresponding to detector grid planes in the direction given by dir (0=x, 1=y, 2=z, -1= no separators).
 
int SetBinFormat (int format_=0)
 Format for string binary files.
 
int SetEdges (int edges_)
 Sets box edges (one of BOX_SIDES) that contribute to the surface detector set.
 
int SetBraggVectors (Vector_3 *Braggs, int num, int managed=1)
 Set Bragg vectors defining reciprocal lattice vectors (k-points) to obtain transition/flux spectra over a surface.
 
int SetBraggVectors (std::vector< Vector_3 > Braggs)
 Set Bragg vectors defining reciprocal lattice vectors (k-points) to obtain transition/flux spectra over a surface.
 
int SetSync (int sync_)
 If set to 1, the detector works only at sychronous steps.
 
bool SetThetaFirst (bool theta_first_=true)
 Sets the angle output order for Near2Far detectors.
 
int GetTimeFreqRange (valtype *tf1_=nullptr, valtype *tf2_=nullptr, valtype *dtf_=nullptr) const
 Gets the number of timesteps or frequencies (for DET_F Fourier detectors) that are to be recorded for the current detector.
 
int GetSpaceRange ()
 Gets the number of space steps (locations) in the detector set.
 
int GetFields (valtype tf, int ispace, Vector_3 &E, Vector_3 &H, int ch=0)
 Get fields for certain time (frequency for detectors marked as DET_F) and space point measured by current detector.
 
int GetFields (int itf, int ispace, Vector_3 &E, Vector_3 &H, int ch=0)
 Get fields for certain time (frequency for detectors marked as DET_F) and space point measured by current detector.
 
int GetCFields (valtype tf, int ispace, cVector_3 &E, cVector_3 &H, int ch=0)
 Same as GetFields(valtype tf, int ispace, Vector_3 &E, Vector_3 &H, int ch = 0) but for fourier transformed complex fields (for detectors marked as DET_F).
 
int GetCFields (int itf, int ispace, cVector_3 &E, cVector_3 &H, int ch=0)
 Same as GetFields(int tf, int ispace, Vector_3 &E, Vector_3 &H, int ch = 0) but for fourier transformed complex fields (for detectors marked as DET_F).
 
bool UseTimeProfile (bool use=true)
 Specifies whether to use time profile skew for this detector set (used for delayed boundary).
 
int Bind (uiDetector *child, bool analyze_child=false)
 Binds a child detector.
 
int Bind (const std::string &dname, bool analyze_child=false)
 Same as above referencing detector by name.
 
int SetDuplicate (const iVector_3 &dump_dup=iVector_3(1), const iVector_3 &dump_dup_orig=iVector_3(0))
 Specifies how many elementary cells are duplicated in each direction for dump and duplication origin.
 

Protected Member Functions

int if_record (int nobl, int obl_inum, int obl_dfreq)
 Returns 0 if no recording needed,
1 if this is a new record
2 if this ia a record refreshing existing one.
 
int prepare_ran ()
 Prepares record analyzer.
 
int adjust_range (valtype dt, int itnum, valtype f1, valtype f2, valtype df, bool on_fly)
 Matches detector internal range with the simulation timestep and duration.
 

Protected Attributes

int m_ran
 Management flag for ran.
 
int type
 detector type (see DET_TYPES).
 
int sourceid
 -2 (container), -1 (any first source), or number of some source
 
Vector_3 v0
 For grid and box detectors: coordinate of opposite corners.
 
iVector_3 n
 For grid and box detectors: resolution.
 
std::vector< Vector_3 > coords
 For vector detector: detectors positions.
 
Vector_3 origin
 Near-to-far detectors:
 
valtype R
 distance from origin to detectors
 
int ufreq
 Update frequency in steps, -1 for inactive detector.

 
int oblfreq
 Update frequency in oblique iterations.
 
int oblphase
 Start iteration for record.
 
int analytic
 1 - analytical detector, 2 - other
 
int sync
 1 - works only at sychronous steps
 
bool analyze
 If true, need to analyze (get detector text output) after computation.
 
bool interm_an
 If true, need to analyze (get detector output) intermideately in course of computation.
 
valtype dtf
 Time or frequency range for analysis.
 
int bin_format
 Format for binary files, one of DATAFILE_BIN_FORMAT.
 
std::vector< valtype > tparams
 Texture settings.
 
int refresh
 1= refresh existing file in oblique iterations instead of rewriting it.
 

Friends

class uiExperiment
 

Detailed Description

User interface class to store information about detectors.

Member Function Documentation

◆ Bind()

int uiDetector::Bind ( uiDetector child,
bool  analyze_child = false 
)
inline

Binds a child detector.

The child channels will be added to parent output, appearing as extra columns. The parent and child should have the same amount of projected data (number of space points and times/frequencies), otherwise the child output may be incorrect. If analyze_child is true, the child detector is analyzed both separately and inside parent.

◆ GetFields() [1/2]

int uiDetector::GetFields ( int  itf,
int  ispace,
Vector_3 &  E,
Vector_3 &  H,
int  ch = 0 
)

Get fields for certain time (frequency for detectors marked as DET_F) and space point measured by current detector.

Works the after analysis phase is completed. The measurement points are indexed by integer values in sequence. In case of complex fields (Fourier transformed) returns the absolute values of the fields. To obtain the exact complex fields use GetCFields(int tf, int ispace, cVector_3 &E, cVector_3 &H, int ch = 0).

Parameters
itfan index of timestep or frequency within current calculation range.
ispaceis an index of spatial location within the vector set associated with the detector. For array detectors index of Z changes first, then Y, X
chis the optional channel (column) number for multi-channel detectors, such as RTA detectors (see uiExperiment::AddRTASet())
Returns
<0 on error, 1 otherwise.

◆ GetFields() [2/2]

int uiDetector::GetFields ( valtype  tf,
int  ispace,
Vector_3 &  E,
Vector_3 &  H,
int  ch = 0 
)

Get fields for certain time (frequency for detectors marked as DET_F) and space point measured by current detector.

Works the after analysis phase is completed. The measurement points are indexed by integer values in sequence. In case of complex fields (Fourier transformed) returns the absolute values of the fields. To obtain the exact complex fields use GetCFields(valtype tf, int ispace, cVector_3 &E, cVector_3 &H, int ch = 0).

Parameters
tfis time or frequency value of interest, returns the fields for the closest available value within the current calculation range.
ispaceis an index of spatial location within the vector set associated with the detector. For array detectors index of Z changes first, then Y, X
chis the optional channel (column) number for multi-channel detectors, such as RTA detectors (see uiExperiment::AddRTASet())
Returns
<0 on error, 1 otherwise.

◆ GetSpaceRange()

int uiDetector::GetSpaceRange ( )

Gets the number of space steps (locations) in the detector set.

For array detectors the most rapidly changing index is Z, then Y, X.

◆ GetTimeFreqRange()

int uiDetector::GetTimeFreqRange ( valtype *  tf1_ = nullptr,
valtype *  tf2_ = nullptr,
valtype *  dtf_ = nullptr 
) const
inline

Gets the number of timesteps or frequencies (for DET_F Fourier detectors) that are to be recorded for the current detector.

Works after the analysis phase is complete.

Parameters
[out]tf1_if not nullptr, contains the left border of the interval in time or frequency
[out]tf2_if not nullptr, contains the right border of the interval in time or frequency
[out]dtf_if not nullptr, contains the step in time or frequency
Returns
the number of available time/frequency steps.

◆ SetBraggVectors() [1/2]

int uiDetector::SetBraggVectors ( std::vector< Vector_3 >  Braggs)
inline

Set Bragg vectors defining reciprocal lattice vectors (k-points) to obtain transition/flux spectra over a surface.

Each vector \(k_B\) corresponds to \(exp(-ik_Br)\) multiplyer when integrating over the flux surface (r belongs to the integration surface). Extra output column in the spectra will be given for each Bragg vector in the output file. For example, to measure normal flux, Braggs[]={Vector_3(0,0,0)}, num =1.

◆ SetBraggVectors() [2/2]

int uiDetector::SetBraggVectors ( Vector_3 *  Braggs,
int  num,
int  managed = 1 
)
inline

Set Bragg vectors defining reciprocal lattice vectors (k-points) to obtain transition/flux spectra over a surface.

Each vector \(k_B\) corresponds to \(exp(-ik_Br)\) multiplyer when integrating over the flux surface (r belongs to the integration surface). Extra output column in the spectra will be given for each Bragg vector in the output file. For example, to measure normal flux, Braggs[]={Vector_3(0,0,0)}, num =1.

◆ SetDuplicate()

int uiDetector::SetDuplicate ( const iVector_3 &  dump_dup = iVector_3(1),
const iVector_3 &  dump_dup_orig = iVector_3(0) 
)
inline

Specifies how many elementary cells are duplicated in each direction for dump and duplication origin.

Returns
1 if duplication is supported, 0 otherwise

◆ SetEdges()

int uiDetector::SetEdges ( int  edges_)
inline

Sets box edges (one of BOX_SIDES) that contribute to the surface detector set.

Valid for DET_FLUX_BOX and DET_NEAR_TO_FAR detector types.

Returns
previous edge setting or -1 if edge change is not possible.

◆ SetOutPlaneMode()

int uiDetector::SetOutPlaneMode ( int  dir = -1)
inline

Sets 'output plane mode' for grid detectors: in this mode extra separators are put in the output file between the data corresponding to detector grid planes in the direction given by dir (0=x, 1=y, 2=z, -1= no separators).

This mode is used when drawing surface plots (e.g. by gnuplot). Effective only for grid detectors Since the order of passing dimensions of grid data iterator is preset (z,y,x) if the set is full grid, then normally dir=2 for single planes dir must be the first nonconstant direction from the set(z,y,x)

Returns
the previous setting.

◆ SetTextureParams()

void uiDetector::SetTextureParams ( valtype  k = 1.,
valtype  shift = 0.,
valtype  k_disp = 1.,
valtype  shift_disp = 0. 
)
inline

Underlying media may be displayed in QPLT format by overimposing them on the fields.

This is acconmplished by recalculating field values as Fnew = F+ k*real(epsilon) + shift, at the locations where media are present (epsilon!=1), with different parameters k a d shift for dispersive and nondispersive media. The new values are stored in the binary detector file.

◆ SetUpdateInterval()

int uiDetector::SetUpdateInterval ( int  ufreq_ = 1)
inline

Set update detector update interval in steps, -1 for inactive detector.

The detector is activeted and the data is recorded each ufreq step.

◆ UseTimeProfile()

bool uiDetector::UseTimeProfile ( bool  use = true)
inline

Specifies whether to use time profile skew for this detector set (used for delayed boundary).

Default is true.

Returns
the previous setting.

Member Data Documentation

◆ origin

Vector_3 uiDetector::origin
protected

Near-to-far detectors:

origin


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