Cleanup AMG
In order to improve maintainability and flexibility of the AMG I would like to see some code clean-up and modernization.
This issue should is a wish-list/feature request and a note to myself.
Here follows an incomplete list, which might grow while working on it...
- replace manual memory management with smart pointers
-
the iterator of
Hierarchy
currently has some additional methods. These should be moved to theElement
so thatelement
can be stored in an other container. -
replace the manually implemented linked-list in
Hierarchy
by eitherstd::deque
orstd::vector
. The push_front feature isn't used anywhere. -
I don't see a reason for a deep copy in the
AMG
and theHierarchy
. We should try to keep this copy as shallow as possible. (see #64 (closed)) -
The element-allocator of the
Hierarchy
is not used at all. This is at least surprising, as it is used as a rebound allocator. -
Why do we also clone the lhs, rhs, update vectors in the
AMG
copy-constrcor? The are recreated inpre(...)
anyway. - Remove construction traits.
And some strange features I'm unsure about...
- graph.hh:123 why should the internal type of the weight change, depending on the constness of the matrix?
- matrixhierarchy.hh:334 shouldn't origComm be const?
And some further wishes...
- factor out aggregation so far, that we pass in prolongation/restriction operators constructed somewhere else
- make restriction/prolongation fulfil the operator interface
-
can we replace
graph.hh
with a modern graph implementation, perhaps maintained outside of Dune? -
twolevelsolver has a
LevelContext
while the AMG keep different hierarchies. Can we unify this?