DUNE-FEM (unstable)

numpyoperator.hh
1#ifndef DUNE_FEMPY_NUMPYOPERATOR_HH
2#define DUNE_FEMPY_NUMPYOPERATOR_HH
3
4// dune-fem includes
5#include <dune/fem/operator/linear/spoperator.hh>
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
37 NumpyLinearOperator( const std::string & ,
38 const DomainSpaceType &domainSpace,
39 const RangeSpaceType &rangeSpace,
40 const SolverParameter& param = SolverParameter() ) :
42 {}
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
56 BaseType &systemMatrix()
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
SparseRowMatrixObject.
Definition: spmatrix.hh:579
void apply(const DomainFunction &arg, RangeFunction &dest) const
apply matrix to discrete function
Definition: spmatrix.hh:831
void clear()
clear matrix
Definition: spmatrix.hh:788
SparseRowMatrix.
Definition: spmatrix.hh:40
Dune namespace.
Definition: alignedallocator.hh:13
NumpyLinearOperator.
Definition: numpyoperator.hh:25
void apply(const DomainFunction &arg, RangeFunction &dest) const
apply matrix to discrete function
Definition: spmatrix.hh:831
virtual void operator()(const DomainFunction &arg, RangeFunction &dest) const
application operator
Definition: numpyoperator.hh:46
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)