nmie-pybind11.hpp 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //**********************************************************************************//
  2. // Copyright (C) 2009-2018 Ovidio Pena <ovidio@bytesfall.com> //
  3. // Copyright (C) 2013-2018 Konstantin Ladutenko <kostyfisik@gmail.com> //
  4. // //
  5. // This file is part of scattnlay //
  6. // //
  7. // This program is free software: you can redistribute it and/or modify //
  8. // it under the terms of the GNU General Public License as published by //
  9. // the Free Software Foundation, either version 3 of the License, or //
  10. // (at your option) any later version. //
  11. // //
  12. // This program is distributed in the hope that it will be useful, //
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of //
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
  15. // GNU General Public License for more details. //
  16. // //
  17. // The only additional remark is that we expect that all publications //
  18. // describing work using this software, or all commercial products //
  19. // using it, cite at least one of the following references: //
  20. // [1] O. Pena and U. Pal, "Scattering of electromagnetic radiation by //
  21. // a multilayered sphere," Computer Physics Communications, //
  22. // vol. 180, Nov. 2009, pp. 2348-2354. //
  23. // [2] K. Ladutenko, U. Pal, A. Rivera, and O. Pena-Rodriguez, "Mie //
  24. // calculation of electromagnetic near-field for a multilayered //
  25. // sphere," Computer Physics Communications, vol. 214, May 2017, //
  26. // pp. 225-230. //
  27. // //
  28. // You should have received a copy of the GNU General Public License //
  29. // along with this program. If not, see <http://www.gnu.org/licenses/>. //
  30. //**********************************************************************************//
  31. #include <complex>
  32. #include <vector>
  33. #include <pybind11/pybind11.h>
  34. #include <pybind11/numpy.h>
  35. namespace py = pybind11;
  36. py::tuple py_ScattCoeffs(const py::array_t<double, py::array::c_style | py::array::forcecast> &py_x,
  37. const py::array_t<std::complex<double>, py::array::c_style | py::array::forcecast> &py_m,
  38. const int nmax=-1, const int pl=-1);
  39. py::tuple py_scattnlay(const py::array_t<double, py::array::c_style | py::array::forcecast> &py_x,
  40. const py::array_t<std::complex<double>, py::array::c_style | py::array::forcecast> &py_m,
  41. const py::array_t<double, py::array::c_style | py::array::forcecast> &py_theta,
  42. const int nmax=-1, const int pl=-1);
  43. py::tuple py_fieldnlay(const py::array_t<double, py::array::c_style | py::array::forcecast> &py_x,
  44. const py::array_t<std::complex<double>, py::array::c_style | py::array::forcecast> &py_m,
  45. const py::array_t<double, py::array::c_style | py::array::forcecast> &py_Xp,
  46. const py::array_t<double, py::array::c_style | py::array::forcecast> &py_Yp,
  47. const py::array_t<double, py::array::c_style | py::array::forcecast> &py_Zp,
  48. const int nmax=-1, const int pl=-1);