OGS
ogs_mesh_python_module.cpp
Go to the documentation of this file.
1
13#include <pybind11/eigen.h>
14#include <pybind11/pybind11.h>
15#include <pybind11/stl.h>
16#include <spdlog/spdlog.h>
17
18#include <numeric>
19#include <range/v3/numeric.hpp>
20#include <range/v3/range/conversion.hpp>
21#include <range/v3/view/enumerate.hpp>
22#include <range/v3/view/indirect.hpp>
23#include <range/v3/view/map.hpp>
24#include <range/v3/view/transform.hpp>
25#include <vector>
26
28#include "BaseLib/Logging.h"
29#include "InfoLib/GitInfo.h"
30#include "OGSMesh.h"
31
34{
35 m.attr("__name__") = "ogs.mesh";
36 m.doc() = "pybind11 ogs mesh example plugin";
37 pybind11::class_<OGSMesh>(m, "OGSMesh")
38 .def("getPointCoordinates", &OGSMesh::getPointCoordinates,
39 "get node coordinates")
40 .def("getCells", &OGSMesh::getCells,
41 pybind11::return_value_policy::copy, "get cells")
42 .def("getPointDataArray", &OGSMesh::getPointDataArray, "get point data")
43 .def("setPointDataArray", &OGSMesh::setPointDataArray, "set point data")
44 .def("setCellDataArray", &OGSMesh::setCellDataArray, "set cell data")
45 .def("getCellDataArray", &OGSMesh::getCellDataArray, "get cell data");
46}
Git information.
void setPointDataArray(std::string const &name, std::vector< double > const &values, std::size_t const number_of_components)
Definition OGSMesh.cpp:64
std::vector< double > getPointDataArray(std::string const &name, std::size_t const number_of_components=1) const
Definition OGSMesh.cpp:84
void setCellDataArray(std::string const &name, std::vector< double > const &values, std::size_t const number_of_components)
Definition OGSMesh.cpp:96
std::vector< double > getPointCoordinates() const
Definition OGSMesh.cpp:43
std::pair< std::vector< int >, std::vector< int > > getCells() const
Definition OGSMesh.cpp:49
std::vector< double > getCellDataArray(std::string const &name, std::size_t const number_of_components) const
Definition OGSMesh.cpp:116
PYBIND11_MODULE(mesh, m)
python module name is OpenGeoSys