diff --git a/CMakeLists.txt b/CMakeLists.txt index 918c1ff79a88d9b677291754ad21f3989aa27a08..abc5b0201705bf8726092471eb6566ea56dae746 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,3 @@ add_python_targets(istl __init__ ) - -dune_add_pybind11_module(NAME _istl CMAKE_GUARD dune-istl_FOUND) diff --git a/__init__.py b/__init__.py index de7d10968e5919b169e75f43f8b62cdfc90ebdc9..181ee6b635f88fdb56ad908181f218746f2af6fc 100644 --- a/__init__.py +++ b/__init__.py @@ -1,3 +1,3 @@ from .. import common -from ._istl import * +from .._istl import * diff --git a/_istl.cc b/_istl.cc deleted file mode 100644 index 78b15775503f12256f6a03b1279f61d565be5f02..0000000000000000000000000000000000000000 --- a/_istl.cc +++ /dev/null @@ -1,43 +0,0 @@ -// -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -// vi: set et ts=4 sw=2 sts=2: -#include <config.h> - -#include <dune/common/fmatrix.hh> - -#include <dune/istl/bcrsmatrix.hh> -#include <dune/istl/bvector.hh> - -#include <dune/python/common/fvector.hh> -#include <dune/python/istl/bcrsmatrix.hh> -#include <dune/python/istl/bvector.hh> -#include <dune/python/istl/operators.hh> -#include <dune/python/istl/preconditioners.hh> -#include <dune/python/istl/solvers.hh> - -#include <dune/python/pybind11/pybind11.h> - -PYBIND11_MODULE( _istl, 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::Python::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::Python::registerLinearOperator( clsLinearOperator ); - Dune::Python::registerPreconditioners( module, clsLinearOperator ); - Dune::Python::registerSolvers( module, clsLinearOperator ); - - // export BCRS matrix with block size 1x1 - typedef Dune::BCRSMatrix< Dune::FieldMatrix< double, 1, 1 > > Matrix; - Dune::Python::registerBCRSMatrix< Matrix >( module ); - - // export matrix-based preconditioners for BCRS matrix with block size 1x1 - Dune::Python::registerMatrixPreconditioners< Matrix >( module, clsLinearOperator ); -}