Skip to content
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

Modify interpolation scheme #44

Closed
9 of 11 tasks
t-young31 opened this issue Jul 25, 2022 · 2 comments
Closed
9 of 11 tasks

Modify interpolation scheme #44

t-young31 opened this issue Jul 25, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request priority:1 Top priority

Comments

@t-young31
Copy link
Member

t-young31 commented Jul 25, 2022

Overhaul interpolation from the split grid to the central grid.

  1. Different scheme required for each field component.
  2. Is implemented for the electric field, although interpolateTimeDomainFieldCentralEBandLimited was hacked to work for the 2D case, this should be checked.
  3. More significant work required for the magnetic field
  4. Enable interpolation to be performed right up to the edge of the computational domain.

Dependencies:


Tasks specified in PSTD_interpolation_scheme.pdf:

@t-young31 t-young31 added priority:1 Top priority enhancement New feature or request context required More context/information is required labels Jul 25, 2022
@giordano
Copy link
Member

giordano commented Jul 25, 2022

Now done!

Related to interpolation, there are many interpolation functions which are supposed to return int, but the return value is never actually used. For example

int mxInterpolateFieldCentralH_TM( mxArray *Hx_yee , mxArray *Hy_yee , mxArray *Hz_yee,
can return -1 under certain conditions

TDMS/tdms/src/interpolate.cpp

Lines 1094 to 1096 in 805e5dd

if( mxGetNumberOfDimensions(Hx_yee) != 2){
fprintf(stderr,"Error in mxInterpolateFieldCentralH_TM, Ex_yee does not have 3 dimensions\n");
return -1;
but its use at
mxInterpolateFieldCentralH_TM( plhs[3] , plhs[4] , plhs[5],
&plhs[16] ,&plhs[17] , &plhs[18],
2, pind_iu - pind_il - 1, 2, pind_ju - pind_jl - 1, 0, 0);
doesn't check the return value, so that an error would never be caught.

I guess these functions should either be void and throw errors when needed, or at very least the return values should be checked and appropriately dealt with.

@samcunliffe
Copy link
Member

Closing as this as done: #44 can stay open until someone with research time wants to take it on, and #109 will be addressed independently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:1 Top priority
Projects
None yet
Development

No branches or pull requests

4 participants