dune-fem 2.12-git
Loading...
Searching...
No Matches
numpyoperator.hh
Go to the documentation of this file.
1#ifndef DUNE_FEMPY_NUMPYOPERATOR_HH
2#define DUNE_FEMPY_NUMPYOPERATOR_HH
3
4// dune-fem includes
6
7// local includes
8#include <dune/fempy/pybind11/pybind11.hh>
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
17 template< class DomainFunction, class RangeFunction >
19 : public SparseRowMatrixObject< typename DomainFunction::DiscreteFunctionSpaceType,
20 typename RangeFunction::DiscreteFunctionSpaceType,
21 SparseRowMatrix< double, size_t,
22 pybind11::array_t< double >,
23 pybind11::array_t<size_t> > >,
24 public Fem::AssembledOperator< DomainFunction, RangeFunction >
25 {
26 typedef typename DomainFunction::DiscreteFunctionSpaceType DomainSpaceType;
27 typedef typename RangeFunction::DiscreteFunctionSpaceType RangeSpaceType;
29 // for numpy backend we need to use different storage classes
32
33 static constexpr bool assembled = true;
34
35 using BaseType::apply;
36
43
44 virtual void clear() { BaseType::clear(); }
45
46 virtual void operator()( const DomainFunction &arg, RangeFunction &dest ) const
47 {
48 apply( arg, dest );
49 }
50
51 const BaseType &systemMatrix() const
52 {
53 return *this;
54 }
55
57 {
58 return *this;
59 }
60 };
61
62 } // namespace Fem
63
64} // namespace Dune
65
66#endif // #ifndef DUNE_FEM_SPOPERATOR_HH
abstract matrix operator
Definition operator.hh:133
NumpyLinearOperator.
Definition numpyoperator.hh:25
static constexpr bool assembled
Definition numpyoperator.hh:33
SparseRowMatrixObject< DomainSpaceType, RangeSpaceType, Matrix > BaseType
Definition numpyoperator.hh:31
RangeFunction::DiscreteFunctionSpaceType RangeSpaceType
Definition numpyoperator.hh:27
BaseType & systemMatrix()
Definition numpyoperator.hh:56
DomainFunction::DiscreteFunctionSpaceType DomainSpaceType
Definition numpyoperator.hh:26
void apply(const DomainFunction &arg, RangeFunction &dest) const
apply matrix to discrete function
Definition spmatrix.hh:835
SparseRowMatrix< double, size_t, pybind11::array_t< double >, pybind11::array_t< size_t > > Matrix
Definition numpyoperator.hh:30
NumpyLinearOperator< DomainFunction, RangeFunction > ThisType
Definition numpyoperator.hh:28
const BaseType & systemMatrix() const
Definition numpyoperator.hh:51
NumpyLinearOperator(const std::string &, const DomainSpaceType &domainSpace, const RangeSpaceType &rangeSpace, const SolverParameter &param=SolverParameter())
Definition numpyoperator.hh:37
virtual void operator()(const DomainFunction &arg, RangeFunction &dest) const
application operator
Definition numpyoperator.hh:46
virtual void clear()
Definition numpyoperator.hh:44
SparseRowMatrix.
Definition spmatrix.hh:40
SparseRowMatrixObject.
Definition spmatrix.hh:583
void apply(const DomainFunction &arg, RangeFunction &dest) const
apply matrix to discrete function
Definition spmatrix.hh:835
void clear()
clear matrix
Definition spmatrix.hh:792
Definition solver/parameter.hh:25