incident.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. /* incident.c: The file for defining the incident wave function.
  17. * Input: current time (int)
  18. * Output: Amplitude of ez-field on left side of domain (double)*/
  19. #include <math.h>
  20. double incidentWaveOnLeftSide(int time, double cdtds) {
  21. // Sine-wave on half-space
  22. return sin(time * cdtds / 2.5);
  23. // Delta-pulse-line
  24. //if(time==0)
  25. // return 1/cdtds;
  26. //else
  27. // return 0;
  28. }