Skip to content
Snippets Groups Projects
Commit 79d7d23b authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[tests.operators] add MatrixOperatorBase

parent 686a8c89
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ struct OperatorBaseTraits ...@@ -40,6 +40,7 @@ struct OperatorBaseTraits
FunctionType; FunctionType;
typedef Dune::Stuff::Functions::Constant<EntityType, DomainFieldType, dimDomain, RangeFieldType, dimDomain, dimDomain> typedef Dune::Stuff::Functions::Constant<EntityType, DomainFieldType, dimDomain, RangeFieldType, dimDomain, dimDomain>
TensorFunctionType; TensorFunctionType;
typedef typename Stuff::LA::Container<RangeFieldType, Stuff::LA::default_backend>::MatrixType MatrixType;
typedef typename Stuff::LA::Container<RangeFieldType, Stuff::LA::default_backend>::VectorType VectorType; typedef typename Stuff::LA::Container<RangeFieldType, Stuff::LA::default_backend>::VectorType VectorType;
typedef DiscreteFunction<SpaceType, VectorType> DiscreteFunctionType; typedef DiscreteFunction<SpaceType, VectorType> DiscreteFunctionType;
}; // class OperatorBaseTraits }; // class OperatorBaseTraits
...@@ -60,6 +61,8 @@ struct OperatorBase ...@@ -60,6 +61,8 @@ struct OperatorBase
typedef typename Traits::FunctionType FunctionType; typedef typename Traits::FunctionType FunctionType;
typedef typename Traits::TensorFunctionType TensorFunctionType; typedef typename Traits::TensorFunctionType TensorFunctionType;
typedef typename Traits::DiscreteFunctionType DiscreteFunctionType; typedef typename Traits::DiscreteFunctionType DiscreteFunctionType;
typedef typename Traits::MatrixType MatrixType;
typedef typename Traits::VectorType VectorType;
static const size_t dimDomain = Traits::dimDomain; static const size_t dimDomain = Traits::dimDomain;
OperatorBase() OperatorBase()
...@@ -103,6 +106,28 @@ struct LocalizableProductBase : public OperatorBase<SpaceType> ...@@ -103,6 +106,28 @@ struct LocalizableProductBase : public OperatorBase<SpaceType>
}; // class LocalizableProductBase }; // class LocalizableProductBase
template <class SpaceType>
struct MatrixOperatorBase : public OperatorBase<SpaceType>
{
typedef OperatorBase<SpaceType> BaseType;
using typename BaseType::GridViewType;
using typename BaseType::MatrixType;
template <class OperatorImp>
void matrix_operator_test(OperatorImp& op)
{
const auto& DUNE_UNUSED(matrix) = op.matrix();
auto& DUNE_UNUSED(non_const_matrix) = op.matrix();
const auto& DUNE_UNUSED(source_space) = op.source_space();
const auto& DUNE_UNUSED(range_space) = op.range_space();
Stuff::Grid::Walker<GridViewType> walker(this->space_.grid_view());
walker.add(op);
walker.walk();
} // ... matrix_operator_test(...)
}; // class LocalizableProductBase
} // namespace Tests } // namespace Tests
} // namespace GDT } // namespace GDT
} // namespace Dune } // namespace Dune
......
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