Lemma is an Electromagnetics API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pyLemmaCore.cpp 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 22/04/19 14:06:32
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@utah.edu
  14. * @copyright Copyright (c) 2019, University of Utah
  15. * @copyright Copyright (c) 2019, Lemma Software, LLC
  16. */
  17. #include "LemmaCore"
  18. #include <string>
  19. #include <boost/python.hpp>
  20. #include <boost/python/numpy.hpp>
  21. // Include the headers of MyLib
  22. //using namespace boost::python;
  23. namespace bp = boost::python;
  24. namespace np = boost::python::numpy;
  25. BOOST_PYTHON_MODULE(pyLemmaCore)
  26. {
  27. Py_Initialize();
  28. np::initialize();
  29. bp::class_<Lemma::RectilinearGrid, boost::noncopyable> ("RectilinearGrid", boost::python::no_init)
  30. // print
  31. .def(boost::python::self_ns::str(bp::self))
  32. // Lifecycle
  33. .def("__init__", boost::python::make_constructor(&Lemma::RectilinearGrid::NewSP))
  34. //.def("Serialize", &Lemma::RectilinearGrid::Serialize)
  35. //.def("DeSerialize", &Lemma::RectilinearGrid::DeSerialize)
  36. // Accessors
  37. .def("GetName", &Lemma::RectilinearGrid::GetName)
  38. .def("GetNx", &Lemma::RectilinearGrid::GetNx)
  39. .def("GetNy", &Lemma::RectilinearGrid::GetNy)
  40. .def("GetNz", &Lemma::RectilinearGrid::GetNz)
  41. .def("GetOx", &Lemma::RectilinearGrid::GetOx)
  42. .def("GetOy", &Lemma::RectilinearGrid::GetOy)
  43. .def("GetOz", &Lemma::RectilinearGrid::GetOz)
  44. //.def("GetDx", &Lemma::RectilinearGrid::GetDx)
  45. //.def("GetDy", &Lemma::RectilinearGrid::GetDy)
  46. //.def("GetDz", &Lemma::RectilinearGrid::GetDz)
  47. .def("SetDimensions", &Lemma::RectilinearGrid::SetDimensions)
  48. .def("SetOffset", &Lemma::RectilinearGrid::SetOffset)
  49. .def("SetSpacing", &Lemma::RectilinearGrid::SetSpacing)
  50. ;
  51. }