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

#include <vertex_phasors.h>

Public Member Functions

 VertexPhasors (const mxArray *ptr)
 Setup using data from an input file.
 
void set_from (const mxArray *ptr)
 Setup using data from an input file.
 
mxArray * get_mx_camplitudes ()
 Get the pointer to the data.
 
void setup_complex_amplitude_arrays (int n_frequencies)
 Allocate memory for the camplitude{R,I} arrays.
 
int n_vertices ()
 Fetch the number of vertices at which we are extracting phasors.
 
int n_components ()
 Fetch the number of field components we are extracting.
 
bool there_are_vertices_to_extract_at ()
 Returns true/false based on whether there are/aren't vertices to extract at.
 
bool there_are_elements_in_arrays ()
 
void normalise_vertices (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 extractPhasorsVertices (int frequency_index, ElectricSplitField &E, MagneticSplitField &H, int n, double omega, SimulationParameters &params)
 Extract the phasor values at the vertices on the surface, for the given frequency index.
 
void update_vertex_camplitudes (int frequency_index, int vertex_index, FullFieldSnapshot F)
 Incriments camplitudes{R,I} at the given index by the field values provided.
 

Private Attributes

Vertices vertices
 
FieldComponentsVector components
 
mxArray * mx_camplitudes = nullptr
 
int f_ex_vector_size
 
double *** camplitudesR = nullptr
 
double *** camplitudesI = nullptr
 

Detailed Description

Class container for handling complex amplitude samples at the vertices, and their extraction.

Abbreviated to CAmpSample in MATLAB code

Constructor & Destructor Documentation

◆ VertexPhasors()

VertexPhasors::VertexPhasors ( const mxArray *  ptr)
inline

Setup using data from an input file.

Parameters
ptrPointer to the struct containing the list of vertices and components to extract phasors at/for

Member Function Documentation

◆ extractPhasorsVertices()

void VertexPhasors::extractPhasorsVertices ( int  frequency_index,
ElectricSplitField E,
MagneticSplitField H,
int  n,
double  omega,
SimulationParameters params 
)

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

Parameters
frequency_indexThe entries in camplitudes{R,I}[frequency_index] will be written to
E,HThe electric,magnetic split field
nCurrent timestep index
omegaAngular frequency
paramsThe parameters for this simulation

◆ normalise_vertices()

void VertexPhasors::normalise_vertices ( 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 camplitudes{R,I} are divided by the (complex) Enorm. H-field components in camplitudes{R,I} are divided by the (complex) Hnorm.

Parameters
frequency_indexFrequency index, camplitudes{R,I}[frequency_index] will be normalised
Enorm,HnormThe {E,H}-norm to normalise the {E,H}-components by

◆ set_from()

void VertexPhasors::set_from ( const mxArray *  ptr)

Setup using data from an input file.

Parameters
ptrPointer to the struct containing the list of vertices and components to extract phasors at/for

◆ setup_complex_amplitude_arrays()

void VertexPhasors::setup_complex_amplitude_arrays ( int  n_frequencies)

Allocate memory for the camplitude{R,I} arrays.

Provided there are vertices for us to extract at, allocates the memory for the camplitude{R,I} arrays and creates the mx_camplitudes pointer to the output data.

Parameters
n_frequenciesThe number of frequencies at which we need to extract phasors

◆ update_vertex_camplitudes()

void VertexPhasors::update_vertex_camplitudes ( int  frequency_index,
int  vertex_index,
FullFieldSnapshot  F 
)

Incriments camplitudes{R,I} at the given index by the field values provided.

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

Only field components that we are extracting at the vertices are pulled out of F.

Parameters
frequency_indexFrequency index
vertex_indexVertex index
FField values to assign

Member Data Documentation

◆ camplitudesI

double *** VertexPhasors::camplitudesI = nullptr
private

◆ components

FieldComponentsVector VertexPhasors::components
private

The MATLAB indices of the field components we want to extract at the vertices.

◆ f_ex_vector_size

int VertexPhasors::f_ex_vector_size
private
Initial value:
=
0

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