Skip to content
Snippets Groups Projects
Commit f51aed9d authored by Jö Fahlke's avatar Jö Fahlke
Browse files

Implement a flexible matrix based operator to be used for reassembling

parent e64a8d31
No related branches found
No related tags found
1 merge request!2Implement linearizable operator, matrix-based version
......@@ -7,6 +7,42 @@
namespace PPS {
template<class X>
class LinearizedOperatorMixin {
public:
virtual void linearizeAt(const X &) = 0;
virtual ~LinearizedOperatorMixin() = default;
};
template<class Matrix>
struct AssembledLinearizedOperatorMatrix
{
Matrix matrix_;
};
template<class GridOperator, class Matrix, class X, class Y>
class AssembledLinearizedOperator :
private AssembledLinearizedOperatorMatrix<Matrix>,
public Dune::MatrixAdapter<Matrix, X, Y>,
public LinearizedOperatorMixin<X>
{
using MemBase = AssembledLinearizedOperatorMatrix<Matrix>;
const GridOperator *go_;
public:
AssembledLinearizedOperator(const GridOperator * go) :
MemBase{ go->pattern().template make<Matrix>() },
Dune::MatrixAdapter<Matrix, X, Y>(this->matrix_),
go_(go)
{ }
void linearizeAt(const X &linearizationPoint) override {
this->matrix_ = 0;
go_->jacobian(linearizationPoint, this->matrix_);
}
};
template<class MatrixType, class VectorType,
template<class,class,class,int> class Preconditioner,
template<class> class Solver>
......
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