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

The function 'setUseFixedOrder' is called if it is defined and the matrices in the AMG hierarchy are constructed with deterministic indices.
If it is not defined yet, it is not called 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:27:56 +01:00
parent 24ebb77257
commit 60b0a33bd4

View File

@ -95,6 +95,17 @@ struct AMGSmootherArgsHelper<Opm::ParallelOverlappingILU0<M,V,V,C>>
};
template <typename C>
auto setUseFixedOrder(C criterion, bool booleanValue) -> decltype(criterion.setUseFixedOrder(booleanValue))
{
return criterion.setUseFixedOrder(booleanValue); // Set flag to ensure that the matrices in the AMG hierarchy are constructed with deterministic indices.
}
template <typename C>
void setUseFixedOrder(C, ...)
{
// do nothing, since the function setUseFixedOrder does not exist yet
}
template <class Operator, class Comm, class Matrix, class Vector>
typename AMGHelper<Operator, Comm, Matrix, Vector>::Criterion
AMGHelper<Operator,Comm,Matrix,Vector>::criterion(const PropertyTree& prm)
@ -117,6 +128,7 @@ AMGHelper<Operator,Comm,Matrix,Vector>::criterion(const PropertyTree& prm)
criterion.setMaxConnectivity(prm.get<int>("maxconnectivity", 15));
criterion.setMaxAggregateSize(prm.get<int>("maxaggsize", 6));
criterion.setMinAggregateSize(prm.get<int>("minaggsize", 4));
setUseFixedOrder(criterion, true); // If possible, set flag to ensure that the matrices in the AMG hierarchy are constructed with deterministic indices.
return criterion;
}