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

The Source class stores values of the Source field across a particular plane. More...

#include <source.h>

Public Member Functions

 Source (const mxArray *ptr, int dim1, int dim2, const std::string &name)
 
bool is_empty () const
 Check if the source term is empty (true) or not (false)
 
std::complex< double > operator[] (SourceIndex index) const
 
std::complex< double > value_or_zero_if_empty (SourceIndex index) const
 Return the value at the index provided if the Source is nonempty, otherwise return 0 if the Source is empty.
 

Public Attributes

double *** real = nullptr
 Real data for the source term.
 
double *** imag = nullptr
 Imag data for the source term.
 

Private Attributes

bool no_data_stored = true
 

Detailed Description

The Source class stores values of the Source field across a particular plane.

Let A (= {i,j,k}) be the axial direction that the plane the given Source instance is storing data for. Let B, C be the remaining axial directions, with C being the axial direction with the slower-varying index. That is: A = i : B = j : C = k, A = j : B = i : C = k, A = k : B = i : C = j.

The Source data (real and imag) is indexed by 3 indices, accessed via {real,imag}[cell_c][cell_b][split_field_ID].

split_field_ID ranges between 0-7 inclusive. TODO: Indices <-> sources need to be deduced from input file generator functions.

Let cell_a be the A-index of the plane that the instance is storing data on. Then (cell_A, cell_B, cell_C) is the Yee-cell index whose (source) data we are accessing with this call.

Member Function Documentation

◆ value_or_zero_if_empty()

std::complex< double > Source::value_or_zero_if_empty ( SourceIndex  index) const
inline

Return the value at the index provided if the Source is nonempty, otherwise return 0 if the Source is empty.

This is for use in the update equations, where the split-H field requires updating by a non-zero offset despite potentially having no source terms provided.

Parameters
indexElement to access (if it exists)
Returns
std::complex<double>

Member Data Documentation

◆ no_data_stored

bool Source::no_data_stored = true
private

Flags if the array is empty to avoid pointer preservation


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