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
Hierarchycurrently has some additional methods. These should be moved to the
elementcan be stored in an other container.
replace the manually implemented linked-list in
std::vector. The push_front feature isn't used anywhere.
I don't see a reason for a deep copy in the
Hierarchy. We should try to keep this copy as shallow as possible. (see #64)
The element-allocator of the
Hierarchyis 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
AMGcopy-constrcor? The are recreated in
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.hhwith a modern graph implementation, perhaps maintained outside of Dune?
twolevelsolver has a
LevelContextwhile the AMG keep different hierarchies. Can we unify this?