12#ifndef DUMUX_LINEAR_SYMMETRIZE_CONSTRAINTS_HH
13#define DUMUX_LINEAR_SYMMETRIZE_CONSTRAINTS_HH
17#include <dune/common/hybridutilities.hh>
18#include <dune/common/fmatrix.hh>
19#include <dune/istl/bcrsmatrix.hh>
20#include <dune/istl/multitypeblockmatrix.hh>
25template<
class K,
int rows,
int cols,
class VectorRow,
class VectorCol>
27 VectorRow& bRow,
const VectorCol& bCol,
28 const VectorCol& constrainedRows,
31 for (
int j = 0; j < A.M(); ++j)
34 const auto& constrainedRowsJ = constrainedRows[j];
35 if (constrainedRowsJ > 0.5)
37 for (
int i = 0; i < A.N(); ++i)
41 const auto& bj = bCol[j];
42 if (!((i == j) && isDiagonal))
53template<
class MBlock,
class VectorRow,
class VectorCol>
55 VectorRow& bRow,
const VectorCol& bCol,
56 const VectorCol& constrainedRows,
59 const auto rowEnd = A.end();
60 for (
auto row = A.begin(); row != rowEnd; ++row)
62 const auto colEnd = row->end();
63 for (
auto col = row->begin(); col != colEnd; ++col)
65 const auto i = row.index();
66 const auto j = col.index();
70 const auto& bj = bCol[j];
71 const auto& dj = constrainedRows[j];
79template<
class... MBlock,
class VectorRow,
class VectorCol>
81 VectorRow& bRow,
const VectorCol& bCol,
82 const VectorCol& constrainedRows,
85 using namespace Dune::Hybrid;
92 const auto& bj = bCol[j];
93 const auto& dj = constrainedRows[j];
116template<
class MBlock,
class Vector>
134template<
class... MBlock,
class Vector>
Definition: common/pdesolver.hh:26
void symmetrizeConstraints(Dune::BCRSMatrix< MBlock > &A, Vector &b, const Vector &constrainedRows)
Symmetrize the constrained system Ax=b.
Definition: symmetrize_constraints.hh:117
Distance implementation details.
Definition: cvfelocalresidual.hh:25
void symmetrizeConstraintsImpl(Dune::FieldMatrix< K, rows, cols > &A, VectorRow &bRow, const VectorCol &bCol, const VectorCol &constrainedRows, bool isDiagonal)
Definition: symmetrize_constraints.hh:26