OGS
ogs_mesh_python_module.cpp File Reference

Detailed Description

Implementation of OpenGeoSys mesh python module.

Definition in file ogs_mesh_python_module.cpp.

#include <algorithm>
#include <pybind11/eigen.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <spdlog/spdlog.h>
#include <numeric>
#include <range/v3/numeric.hpp>
#include <range/v3/range/conversion.hpp>
#include <range/v3/view/enumerate.hpp>
#include <range/v3/view/indirect.hpp>
#include <range/v3/view/map.hpp>
#include <range/v3/view/transform.hpp>
#include <vector>
#include "BaseLib/ExportSymbol.h"
#include "BaseLib/Logging.h"
#include "InfoLib/GitInfo.h"
#include "OGSMesh.h"
Include dependency graph for ogs_mesh_python_module.cpp:

Go to the source code of this file.

Functions

 PYBIND11_MODULE (mesh, m)
 python module name is OpenGeoSys
 

Function Documentation

◆ PYBIND11_MODULE()

PYBIND11_MODULE ( mesh ,
m  )

python module name is OpenGeoSys

Definition at line 34 of file ogs_mesh_python_module.cpp.

35{
36 m.attr("__name__") = "ogs.mesh";
37 m.doc() = "pybind11 ogs mesh example plugin";
38 pybind11::class_<OGSMesh>(m, "OGSMesh")
39 .def("getPointCoordinates", &OGSMesh::getPointCoordinates,
40 "get node coordinates")
41 .def("getCells", &OGSMesh::getCells,
42 pybind11::return_value_policy::copy, "get cells")
43 .def("getPointDataArray", &OGSMesh::getPointDataArray, "get point data")
44 .def("setPointDataArray", &OGSMesh::setPointDataArray, "set point data")
45 .def("setCellDataArray", &OGSMesh::setCellDataArray, "set cell data")
46 .def("getCellDataArray", &OGSMesh::getCellDataArray, "get cell data");
47}
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:44
std::pair< std::vector< int >, std::vector< int > > getCells() const
Definition OGSMesh.cpp:50
std::vector< double > getCellDataArray(std::string const &name, std::size_t const number_of_components) const
Definition OGSMesh.cpp:116

References OGSMesh::getCellDataArray(), OGSMesh::getCells(), OGSMesh::getPointCoordinates(), OGSMesh::getPointDataArray(), OGSMesh::setCellDataArray(), and OGSMesh::setPointDataArray().