Skip to content
Snippets Groups Projects
Commit dfa8258a authored by Martin Nolte's avatar Martin Nolte
Browse files

Merge remote-tracking branch 'origin/master' into feature/pybind11-v2.2.1

parents 90dafa8c 536473bb
No related branches found
No related tags found
No related merge requests found
from .. import common
from ._istl import *
......@@ -9,17 +9,34 @@
#include <dune/corepy/istl/bcrsmatrix.hh>
#include <dune/corepy/istl/bvector.hh>
#include <dune/corepy/istl/operators.hh>
#include <dune/corepy/istl/preconditioners.hh>
#include <dune/corepy/istl/solvers.hh>
#include <dune/corepy/pybind11/pybind11.h>
PYBIND11_MODULE( _istl, module )
{
Dune::CorePy::registerBCRSMatrix< Dune::BCRSMatrix< Dune::FieldMatrix< double, 1, 1 > > >( module );
Dune::CorePy::registerBlockVector< Dune::BlockVector< Dune::FieldVector< double, 1 > > >( module );
// export solver category
pybind11::enum_< Dune::SolverCategory::Category > solverCategory( module, "SolverCategory" );
solverCategory.value( "sequential", Dune::SolverCategory::sequential );
solverCategory.value( "nonoverlapping", Dune::SolverCategory::nonoverlapping );
solverCategory.value( "overlapping", Dune::SolverCategory::overlapping );
// export block vector with block size 1
typedef Dune::BlockVector< Dune::FieldVector< double, 1 > > Vector;
Dune::CorePy::registerBlockVector< Vector >( module );
// export linear operator, preconditioners, and solvers for blockvectors with block size 1
pybind11::class_< Dune::LinearOperator< Vector, Vector > > clsLinearOperator( module, "LinearOperator" );
Dune::CorePy::registerLinearOperator( clsLinearOperator );
Dune::CorePy::registerPreconditioners( module, clsLinearOperator );
Dune::CorePy::registerSolvers( module, clsLinearOperator );
// export BCRS matrix with block size 1x1
typedef Dune::BCRSMatrix< Dune::FieldMatrix< double, 1, 1 > > Matrix;
Dune::CorePy::registerBCRSMatrix< Matrix >( module );
// export matrix-based preconditioners for BCRS matrix with block size 1x1
Dune::CorePy::registerMatrixPreconditioners< Matrix >( module, clsLinearOperator );
}
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