Construct the matrices in the AMG hierarchy (created in the twolevelmethod) with deterministic indices if possible.

The function 'coarsen' for the coarser level is called with the respective flag if it is defined. Then the matrices in the AMG hierarchy are constructed with deterministic indices.
If it is not defined yet, it is called without the flag and the matrices in the AMG hierarchy are constructed with non-deterministic indices.
This commit is contained in:
Lisa Julia Nebel
2024-01-24 08:29:33 +01:00
parent 60b0a33bd4
commit 5b50a4801f

View File

@@ -187,9 +187,8 @@ public:
std::vector<bool> excluded(fineOperator.getmat().N(), false);
VisitedMap vm(excluded.begin(), Dune::IdentityMap());
ParallelInformation pinfo;
std::size_t aggregates = renumberer.coarsen(pinfo, pg, vm,
*aggregatesMap_, pinfo,
noAggregates);
std::size_t aggregates = coarsen(renumberer, pinfo, pg, vm,*aggregatesMap_, noAggregates, true);
std::vector<bool>& visited=excluded;
typedef std::vector<bool>::iterator Iterator;
@@ -228,6 +227,30 @@ public:
}
private:
template <typename RN, typename PI, typename PG, typename VM, typename AM>
auto coarsen(RN& renumberer,
PI& pinfo,
PG& pg,
VM& vm,
AM& aggregatesMap,
int noAggregates,
bool useFixedOrder) ->
decltype(renumberer.coarsen(pinfo, pg, vm, aggregatesMap, pinfo, noAggregates, useFixedOrder))
{
return renumberer.coarsen(pinfo, pg, vm, aggregatesMap, pinfo, noAggregates, useFixedOrder);
}
template <typename RN, typename PI, typename PG, typename VM, typename AM>
auto coarsen(RN& renumberer,
PI& pinfo,
PG& pg,
VM& vm,
AM& aggregatesMap,
int noAggregates, ...)
{
return renumberer.coarsen(pinfo, pg, vm, aggregatesMap, pinfo, noAggregates);
}
typename O::matrix_type::field_type prolongDamp_;
std::shared_ptr<AggregatesMap> aggregatesMap_;
Criterion criterion_;