Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patrick Jaap
dune-istl
Commits
3e267ec4
Commit
3e267ec4
authored
4 years ago
by
Andreas Dedner
Browse files
Options
Downloads
Patches
Plain Diff
complete move of bindings to dune-common
parent
0acfcf09
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
__init__.py
+4
-4
4 additions, 4 deletions
__init__.py
_istl.cc
+56
-0
56 additions, 0 deletions
_istl.cc
with
61 additions
and
4 deletions
CMakeLists.txt
+
1
−
0
View file @
3e267ec4
add_python_targets
(
istl
__init__
)
dune_add_pybind11_module
(
NAME _istl CMAKE_GUARD dune-istl_FOUND
)
This diff is collapsed.
Click to expand it.
__init__.py
+
4
−
4
View file @
3e267ec4
from
..
import
common
import
dune.
common
from
.
._istl
import
BCRSMatrix
as
BCRSMatrix11
from
.
._istl
import
BlockVector
as
BlockVector1
from
.
._istl
import
*
from
._istl
import
BCRSMatrix
as
BCRSMatrix11
from
._istl
import
BlockVector
as
BlockVector1
from
._istl
import
*
from
dune.generator.generator
import
SimpleGenerator
from
dune.common.hashit
import
hashIt
...
...
This diff is collapsed.
Click to expand it.
_istl.cc
0 → 100644
+
56
−
0
View file @
3e267ec4
// -*- 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>
#include
<dune/python/common/typeregistry.hh>
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
;
// register the BCRS matrix of size 1-1 in the type registry
Dune
::
Python
::
registerBCRSMatrix
<
Matrix
>
(
module
);
// export buildmode
using
BuildMode
=
Matrix
::
BuildMode
;
pybind11
::
enum_
<
BuildMode
>
buildMode
(
module
,
"BuildMode"
);
buildMode
.
value
(
"row_wise"
,
BuildMode
::
row_wise
);
buildMode
.
value
(
"random"
,
BuildMode
::
random
);
buildMode
.
value
(
"implicit"
,
BuildMode
::
implicit
);
buildMode
.
value
(
"unknown"
,
BuildMode
::
unknown
);
// export matrix-based preconditioners for BCRS matrix with block size 1x1
Dune
::
Python
::
registerMatrixPreconditioners
<
Matrix
>
(
module
,
clsLinearOperator
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment