abctmz.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. 2D FDTD simulator
  3. Copyright (C) 2019 Emilia Blåsten
  4. This program is free software: you can redistribute it and/or
  5. modify it under the terms of the GNU Affero General Public License
  6. as published by the Free Software Foundation, either version 3 of
  7. the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public
  13. License along with this program. If not, see
  14. <http://www.gnu.org/licenses/>.
  15. */
  16. /* abctmz.h: Header file that defines the ABC structure and contains the
  17. * related prototype functions. It contains the coefficient for updating
  18. * the second order ABC boundary condition. It also contains pointers to
  19. * four arrays containing the boundary data on the left, right, top and
  20. * bottom. */
  21. #ifndef _ABCTMZ_H
  22. #define _ABCTMZ_H
  23. #include "gridtmz.h"
  24. struct Abc {
  25. double coef0, coef1, coef2;
  26. double ***ezLeft;
  27. double **ezLeftTfixed;
  28. double *ezLeftTOfixed;
  29. double ***ezRight;
  30. double **ezRightTfixed;
  31. double *ezRightTOfixed;
  32. double ***ezTop;
  33. double **ezTopTfixed;
  34. double *ezTopTOfixed;
  35. double ***ezBottom;
  36. double **ezBottomTfixed;
  37. double *ezBottomTOfixed;
  38. };
  39. typedef struct Abc Abc;
  40. Abc *abcCreate(int sizeX, int sizeY);
  41. void abcInit(Abc *ab, Grid *g);
  42. void abcDestroy(Abc *ab);
  43. void abc(Abc *ab, Grid *g);
  44. #endif