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

improve registry of FieldVector/FieldMatrix now that they are not preregistered

parent 4c7aa058
No related branches found
No related tags found
1 merge request!790Feature/add python bindings
Pipeline #26001 passed
......@@ -5,6 +5,7 @@ set(HEADERS
dynmatrix.hh
dynvector.hh
fmatrix.hh
fvecmatregistry.hh
fvector.hh
getdimension.hh
logger.hh
......
#ifndef DUNE_PYTHON_COMMON_FVECMATREG_HH
#define DUNE_PYTHON_COMMON_FVECMATREG_HH
#include <dune/python/pybind11/pybind11.h>
#include <dune/python/common/fvector.hh>
#include <dune/python/common/fmatrix.hh>
namespace Dune
{
namespace Python
{
template <class Type>
struct registerFieldVecMat;
template <class K, int size>
struct registerFieldVecMat<Dune::FieldVector<K,size>>
{
static void apply()
{
pybind11::module scope = pybind11::module::import("dune.common");
registerFieldVector<K,size>(scope);
}
};
template< class K, int row, int col >
struct registerFieldVecMat<Dune::FieldMatrix<K,row,col>>
{
static void apply()
{
pybind11::module scope = pybind11::module::import("dune.common");
registerFieldMatrix<K,row,col>(scope);
registerFieldVector<K,col>(scope);
registerFieldVector<K,row>(scope);
}
};
}
}
#endif // DUNE_PYTHON_COMMON_FVECMATREG_HH
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