-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E- and H-field interpolation tests, frequency domain interpolation #80
Conversation
…to its own function
…es of computational grid
Co-authored-by: Tom Young <[email protected]>
…wgraham-bandinterpolation
tdms/tests/unit/matlab_benchmark_scripts/benchmark_test_field_interpolation_E.m
Outdated
Show resolved
Hide resolved
tdms/tests/unit/matlab_benchmark_scripts/benchmark_test_field_interpolation_H.m
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This broadly looks great. I have made some comments which I think need some attention. Apologies if I have misunderstood something!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, for my part.
Obv. subject to Peter's change requests as above.
* Fix tensor3D allocation * Add split-E-field interpolation as class method * Update split-H-field class with interpolation method * Overhaul ElectricField to have interpolation method * H-field has interpolation methods * Remove redundant headers now class methods are established * Update tdms/include/arrays.h Co-authored-by: Sam Cunliffe <[email protected]> * Move interpolation functionality higher up class hierarchy * Add overrides for MacOS compilation Co-authored-by: Sam Cunliffe <[email protected]>
Interpolation Tests for the$E$ - and $H$ -fields.
Dependent on #74 | Dependent on #108 (namespacing issues)
Completes the following tasks in #44:
interpolate{TimeDomain,FrequencyDomain}{E,H}{x,y,z}
functions. #110Tests the performance of the BLi interpolation methods against the MATLAB function the scheme is based off. MATLAB scripts which output the error for particular field choices are included in the
tests/unit/matlab_benchmark_scripts
directory. The output error values are currently hard-coded into the respective tests; this is not an ideal solution, however in light of #70 is an adequate testing method until the MATLAB dependency question is answered.The tests themselves are against MATLAB's
interp
function. Using predefined functional forms for the components of the two fields; and a particular grid setup to mimic the Yee cells and stored field components, the maximum pointwise-error of the interpolation to the Yee cell centres is computed, and compared to that from MATLAB.Tests of the BLi method for complex data has been added to
test_interpolation_functions
.A field-wide time-domain interpolation test has been added to
test_field_interpolation.cpp
.Completes the following task in #44:
The codebase currently uses
mxArray
s to encode complex fields, and the functionsmxInterpolateFieldCentral{E,H}
to handle the interpolation. The new functions usecomplex
as the datatype for the inputs. This is to be consistent withtest_numerical_derivative
andfield.h
, and to use a complex datatype we are importing already (and which won't be removed by #70). However, these functions will be are unused by the code, as themxInterpolate
functions are still used untiliterator
's refactor is complete.It is also worth noting that interpolation in the frequency domain does not appear to use split-field components, unlike that in the time domain. As such, the functionality of the time domain and frequency domain functions are slightly different (which doesn't permit templating).
A test on the frequency-domain interpolation has been added to
test_field_interpolation.cpp
.Key Files to Check:
test_field_interpolation.cpp
test_BLi_vs_cubic_interpolation.cpp
interpolate_{E,H}.h
(although these changes just turn the field-interpolation functions into template functions, so we can usedouble
(time domain) orstd::complex<double>
(freq domain) data in each.