Skip to content
Snippets Groups Projects
Commit 0a28851b authored by Andreas Dedner's avatar Andreas Dedner
Browse files

need to make sure FV needed for reference elements are registered

parent 8c0c27fb
No related branches found
No related tags found
1 merge request!140Feature/add python bindings
Pipeline #25738 passed
......@@ -24,6 +24,7 @@ add_subdirectory("dune")
add_subdirectory("doc")
add_subdirectory("lib")
add_subdirectory("python")
dune_python_install_package(PATH python)
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
......@@ -10,6 +10,9 @@
#include <dune/geometry/referenceelements.hh>
#include <dune/geometry/type.hh>
#include <dune/python/common/fvector.hh>
#include <dune/python/common/fmatrix.hh>
#include <dune/python/geometry/quadraturerules.hh>
#include <dune/python/pybind11/pybind11.h>
......@@ -96,6 +99,11 @@ namespace Dune
pybind11::options opts;
opts.disable_function_signatures();
static const std::size_t dimension = RefElement::dimension;
typedef typename RefElement::ctype ctype;
registerFieldVector<ctype,dimension>( module );
registerFieldMatrix<ctype,dimension,dimension>( module );
cls.def_property_readonly( "dimension", [] ( pybind11::object ) { return pybind11::int_( RefElement::dimension ); } );
cls.def( "size", [] ( const RefElement &self, int c ) {
......
......@@ -4,3 +4,4 @@ add_python_targets(geometry
quadpy
)
dune_add_pybind11_module(NAME _geometry)
set_property(TARGET _geometry PROPERTY LINK_LIBRARIES dunecommon dunegeometry)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment