From 1ee25f2c9bd76c01e11acc1db26d3a9643a1aeca Mon Sep 17 00:00:00 2001 From: Jonathan Youett <youett@math.fu-berlin.de> Date: Wed, 20 Sep 2017 17:12:24 +0200 Subject: [PATCH] Remove deprecated blockmatrixview.hh, it moved to dune-matrix-vector --- dune/fufem/CMakeLists.txt | 1 - dune/fufem/blockmatrixview.hh | 94 ----------------------------------- 2 files changed, 95 deletions(-) delete mode 100644 dune/fufem/blockmatrixview.hh diff --git a/dune/fufem/CMakeLists.txt b/dune/fufem/CMakeLists.txt index 87071162..55596ca7 100644 --- a/dune/fufem/CMakeLists.txt +++ b/dune/fufem/CMakeLists.txt @@ -17,7 +17,6 @@ install(FILES arcofcircle.hh arithmetic.hh basistraceindexset.hh - blockmatrixview.hh boundaryiterator.hh boundarypatch.hh boundarypatchprolongator.hh diff --git a/dune/fufem/blockmatrixview.hh b/dune/fufem/blockmatrixview.hh deleted file mode 100644 index a7109e3c..00000000 --- a/dune/fufem/blockmatrixview.hh +++ /dev/null @@ -1,94 +0,0 @@ -// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set ts=8 sw=4 et sts=4: -#ifndef DUNE_FUFEM_BLOCK_MATRIX_VIEW_HH -#define DUNE_FUFEM_BLOCK_MATRIX_VIEW_HH - -#include <array> -#include <vector> - -#include <dune/istl/matrixindexset.hh> - -template <class MatrixType> -class DUNE_DEPRECATED_MSG("This class is deprecated, please use BlockMatrixView.hh from dune-matrix-vector") BlockMatrixView -{ -public: - - BlockMatrixView(const std::vector<const MatrixType*>& submat) { - - offsets_.resize(submat.size()); - offsets_[0][0] = 0; - offsets_[0][1] = 0; - - size_t i; - for (i=0; i<submat.size()-1; i++) { - offsets_[i+1][0] = offsets_[i][0] + submat[i]->N(); - offsets_[i+1][1] = offsets_[i][1] + submat[i]->M(); - } - - nRows_ = offsets_[i][0] + submat[i]->N(); - nCols_ = offsets_[i][1] + submat[i]->M(); - - } - - int row(int block, int index) const { - return offsets_[block][0] + index; - } - - int col(int block, int index) const { - return offsets_[block][1] + index; - } - - int nRows() const { - return nRows_; - } - - int nCols() const { - return nCols_; - } - - /** \brief Combine submatrices in a big matrix. */ - static void setupBlockMatrix(const std::vector<MatrixType>& submat, MatrixType& mat) { - std::vector<const MatrixType*> dummy(submat.size()); - for (size_t i=0; i<dummy.size(); i++) - dummy[i] = &submat[i]; - setupBlockMatrix(dummy,mat); - } - - /** \brief Combine submatrices in a big matrix. */ - static void setupBlockMatrix(const std::vector<const MatrixType*>& submat, MatrixType& mat); -protected: - std::vector<std::array<int,2> > offsets_; - - int nRows_, nCols_; - -}; - -template <class MatrixType> -void BlockMatrixView<MatrixType>::setupBlockMatrix(const std::vector<const MatrixType*>& submat, MatrixType& mat) { - - BlockMatrixView<MatrixType> blockView(submat); - Dune::MatrixIndexSet indexSet(blockView.nRows(), blockView.nCols()); - - for (size_t i=0; i<submat.size(); i++) - indexSet.import(*submat[i], blockView.row(i,0), blockView.col(i,0)); - - indexSet.exportIdx(mat); - mat = 0; - - for (size_t i=0; i<submat.size(); i++) { - - auto row = submat[i]->begin(); - auto rowEnd = submat[i]->end(); - - for (; row != rowEnd; row++) { - - auto col = row->begin(); - auto colEnd = row->end(); - - for (; col != colEnd; col++) - mat[blockView.row(i,row.index())][blockView.col(i,col.index())] = *col; - } - } -} - -#endif -- GitLab