TDMS
Time Domain Maxwell Solver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
SurfacePhasors Class Reference

A class that handles the extraction of the phasors on the user-specified surface. More...

#include <surface_phasors.h>

Public Member Functions

 SurfacePhasors (mxArray *mx_surface_vertices, int _f_ex_vector_size)
 Construct a new Surface Phasors object, using the set_from_matlab_array() method.
 
void set_from_matlab_array (mxArray *mx_surface_vertices, int f_ex_vector_size)
 Sets the surface_vertices pointer and number of surface vertices tracker from the MATLAB array passed in.
 
void zero_surface_EH ()
 Zeros the surface_EH{r,i} arrays.
 
int get_n_surface_vertices ()
 Get the number of surface vertices.
 
mxArray * get_vertex_list ()
 Get the list of vertices.
 
mxArray * get_mx_surface_amplitudes ()
 Get the array of complex surface amplitudes.
 
void normalise_surface (int frequency_index, std::complex< double > Enorm, std::complex< double > Hnorm)
 Normalise the surface amplitudes at frequency_vector_index by the E- and H-norms provided.
 
void extractPhasorsSurface (int frequency_index, ElectricSplitField &E, MagneticSplitField &H, int n, double omega, int Nt, SimulationParameters &params, bool interpolate=true)
 Extract the phasor values at the vertices on the surface, for the given frequency index.
 
void create_vertex_list (GridLabels input_grid_labels)
 Pulls the GridLabels information of vertices on the surface into vertex_list, a continuous block of memory.
 
void update_surface_EH (int frequency_index, int vertex_index, FullFieldSnapshot F)
 Incriments surface_EH{r,i} at the given index by the field values provided.
 

Private Attributes

int ** surface_vertices = nullptr
 Pointer to the vertices on the surface.
 
int n_surface_vertices = 0
 Number of vertices on the surface.
 
mxArray * vertex_list = nullptr
 
double ** vertex_list_data_ptr
 
mxArray * mx_surface_amplitudes = nullptr
 
int f_ex_vector_size
 
double *** surface_EHr = nullptr
 
double *** surface_EHi = nullptr
 

Detailed Description

A class that handles the extraction of the phasors on the user-specified surface.

This class stores:

  • The number of vertices on the surface,
  • Their indicies in the global indexing convention,
  • The data (phasors) at each of these vertices,
  • A pointer to the output array

Member Function Documentation

◆ create_vertex_list()

void SurfacePhasors::create_vertex_list ( GridLabels  input_grid_labels)

Pulls the GridLabels information of vertices on the surface into vertex_list, a continuous block of memory.

The vertex_list attribute will consist only of vertices that lie on the surface that the given class instance defines.

Parameters
input_grid_labels

◆ extractPhasorsSurface()

void SurfacePhasors::extractPhasorsSurface ( int  frequency_index,
ElectricSplitField E,
MagneticSplitField H,
int  n,
double  omega,
int  Nt,
SimulationParameters params,
bool  interpolate = true 
)

Extract the phasor values at the vertices on the surface, for the given frequency index.

Parameters
frequency_indexThe entries in surface_EH{r,i}[frequency_index] will be written to
E,HThe electric,magnetic field
nCurrent timestep index
omegaAngular frequency
NtThe number of timesteps in a sinusoidal period
paramsThe parameters for this simulation
interpolateIf true, perform interpolation on the fields when extracting phasors

◆ normalise_surface()

void SurfacePhasors::normalise_surface ( int  frequency_index,
std::complex< double >  Enorm,
std::complex< double >  Hnorm 
)

Normalise the surface amplitudes at frequency_vector_index by the E- and H-norms provided.

E-field components in surface_EH are divided by the (complex) Enorm. H-field components in surface_EH are divided by the (complex) Hnorm.

Parameters
frequency_vector_indexFrequency index, surface_EH{r,i}[frequency_vector_index] will be normalised
Enorm,HnormThe {E,H}-norm to normalise the {E,H}-components by

◆ set_from_matlab_array()

void SurfacePhasors::set_from_matlab_array ( mxArray *  mx_surface_vertices,
int  f_ex_vector_size 
)

Sets the surface_vertices pointer and number of surface vertices tracker from the MATLAB array passed in.

Parameters
mx_surface_verticesMATLAB array containing the vertex information
_f_ex_vector_sizeThe FrequencyExtractionVector size, which we need to reserve sufficient memory

◆ update_surface_EH()

void SurfacePhasors::update_surface_EH ( int  frequency_index,
int  vertex_index,
FullFieldSnapshot  F 
)

Incriments surface_EH{r,i} at the given index by the field values provided.

If we allow element-wise assignment, we are essentially performing the operations: surface_EHr[frequency_vector_index][:][vertex_index] += F.real(), surface_EHi[frequency_vector_index][:][vertex_index] += F.imag().

Parameters
frequency_indexFrequency vector index (k) to assign to
vertex_indexVertex index (i) to assign to
FField values to assign

Member Data Documentation

◆ f_ex_vector_size

int SurfacePhasors::f_ex_vector_size
private
Initial value:
=
0

◆ surface_EHi

double *** SurfacePhasors::surface_EHi = nullptr
private

◆ vertex_list_data_ptr

double** SurfacePhasors::vertex_list_data_ptr
private
Initial value:
=
nullptr

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