TDMS
Time Domain Maxwell Solver
|
#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 ¶ms) |
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 |
Class container for handling complex amplitude samples at the vertices, and their extraction.
Abbreviated to CAmpSample in MATLAB code
|
inline |
Setup using data from an input file.
ptr | Pointer to the struct containing the list of vertices and components to extract phasors at/for |
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.
frequency_index | The entries in camplitudes{R,I}[frequency_index] will be written to |
E,H | The electric,magnetic split field |
n | Current timestep index |
omega | Angular frequency |
params | The parameters for this simulation |
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.
frequency_index | Frequency index, camplitudes{R,I}[frequency_index] will be normalised |
Enorm,Hnorm | The {E,H}-norm to normalise the {E,H}-components by |
void VertexPhasors::set_from | ( | const mxArray * | ptr | ) |
Setup using data from an input file.
ptr | Pointer to the struct containing the list of vertices and components to extract phasors at/for |
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.
n_frequencies | The number of frequencies at which we need to extract phasors |
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.
frequency_index | Frequency index |
vertex_index | Vertex index |
F | Field values to assign |
|
private |
|
private |
The MATLAB indices of the field components we want to extract at the vertices.
|
private |