Feature/multitype arithmetic
I added some code to deal with matrices of type MultiTypeBlockMatrix
.
I am not quite convinced that the way in which I extended the traits are the best way to go.
In particular, the isStatic
is ambiguous, because actually all other matrices but BCRS
are static as well, but do not work well with my implementation.
Therefore, I am happy about any kind of ideas for improvements.
The technology is there. I found a useful code basis in dune-solvers and I believe it is reasonable to migrate Only minor parts from dune-solvers algorithm.hh
to dune-matrix-vector.arithmetic.hh
are needed. The vast hybrid utility power is in dune-common now.
All static/dynamic & sparse/dense-magic is handled therein.
Merge request reports
Activity
assigned to @maxka
A better switch thanisStatic
could beisDense
, which might allow to process all dense matrices through theDune::Hybrid::forEach
functionality and handle the other cases separately (*). I fail to set up a method that compiles for both,MultiTypeBlockMatrix
andFieldMatrix
, either because some hybrid utilities are still missing or I do not know how to apply the existing ones to full effect.(*) Perhaps, this might require even more case switches.Edited by maxkaadded 6 commits
- fa6787d2 - Revert "Add addProduct method for static matrix (MultiTypeBlockMatrix)."
- 3d0af5d5 - Revert "Add traits for MultiTypeBlockMatrix."
- b3009429 - Add traits for MultiTypeBlockMatrix.
- 2e38ff75 - Import algorithm from dune-solvers.
- 58309c56 - Add sparseRangeFor support for MultiTypeBlockMatrices.
- 7d973149 - Use hybrid algorithms for addProduct operation.
Toggle commit listadded 12 commits
-
c0d5f251 - 1 commit from branch
master
- 72dd418b - Add traits for MultiTypeBlockMatrix.
- 69b98568 - Add addProduct test for MultiTypeBlockMatrix arithmetic.
- 0e3d1bf7 - Add addProduct method for static matrix (MultiTypeBlockMatrix).
- 82392773 - Revert "Add addProduct method for static matrix (MultiTypeBlockMatrix)."
- f339ad46 - Revert "Add traits for MultiTypeBlockMatrix."
- debfbf50 - Add traits for MultiTypeBlockMatrix.
- e97169f3 - Import algorithm from dune-solvers.
- 0f4c6573 - Add sparseRangeFor support for MultiTypeBlockMatrices.
- 191b881e - Use hybrid algorithms for addProduct operation.
- e1e42adb - Use hybrid utilities from dune-common.
- 40064bb1 - Rename method rangeForEach to sparseRangeFor.
Toggle commit list-
c0d5f251 - 1 commit from branch
added 2 commits
added 2 commits
I think I made reasonable advances here. Shoutouts to @pipping for his feedback, though it does not show up here.
As the branch now does more than its name suggests, I will rebase it next week and continue to merge it to master soon.
added 9 commits
- 50760d5a - Add addProduct test for MultiTypeBlockMatrix arithmetic.
- d9c8060e - Add traits for MultiTypeBlockMatrix.
- efe3ba56 - Add an improved algorithm header
- 277ecb9f - Use hybrid algorithms for addProduct operation.
- de316c97 - Reorder declarations+definitions and add forward declarations for helper.
- f7a65e41 - Replace more code with hybrid functionality.
- dc65d9df - Remove BCRS workaround.
- 62050346 - Remove superfluous braces
- 422673f5 - Use std::enable_if_t consistently
Toggle commit listadded 8 commits
- e191a626 - Add traits for MultiTypeBlockMatrix.
- 03ccc931 - Add an improved algorithm header
- 85410206 - Use hybrid algorithms for addProduct operation.
- e252b305 - Reorder declarations+definitions and add forward declarations for helper.
- 7bb519c1 - Replace more code with hybrid functionality.
- 5ee0a804 - Remove BCRS workaround.
- 59e753f3 - Remove superfluous braces
- 35a71037 - Use std::enable_if_t consistently
Toggle commit listadded 9 commits
- 881d0299 - Add addProduct test for MultiTypeBlockMatrix arithmetic.
- c23b682b - Add traits for MultiTypeBlockMatrix.
- ff955a37 - Add an improved algorithm header
- 592b1f66 - Use hybrid algorithms for addProduct operation.
- 4fb6a818 - Reorder declarations+definitions and add forward declarations for helper.
- 98347ebd - Replace more code with hybrid functionality.
- e6dd8473 - Remove BCRS workaround.
- 6c6d1d62 - Remove superfluous braces
- daac8c49 - Use std::enable_if_t consistently
Toggle commit listPutting this here as an afterthought (not meant to block the merge):
It would be nice if
IsMultiTypeBlockContainer
was closer to the idea of duck typing: What features do we expect from such a container? What's the general interface we have in mind here?I noticed while thinking about and replying to https://gitlab.dune-project.org/core/dune-common/issues/74 that this would also allow us to do away with the
#include
inalgorithm.hh
.Note to self:
isScalar
has made it into dune-common by now, under the more fitting nameIsNumber
. I plan on putting this to use here, too; probably later today.Update: done.
Edited by pipping