Verified Commit cc34f834 authored by Nils-Arne Dreier's avatar Nils-Arne Dreier
Browse files

assert sequential operator in creators of direct solvers

parent b0263dfd
Pipeline #44865 passed with stage
in 35 minutes and 43 seconds
......@@ -385,6 +385,11 @@ private:
using OpTraits = decltype(opTraits);
using M = typename OpTraits::matrix_type;
using D = typename OpTraits::domain_type;
// works only for sequential operators
if constexpr (OpTraits::isParallel){
if(opTraits.getCommOrThrow(op).communicator().size() > 1)
DUNE_THROW(Dune::InvalidStateException, "CholMod works only for sequential operators.");
}
if constexpr (OpTraits::isAssembled &&
// check whether the Matrix field_type is double or float
(std::is_same_v<typename FieldTraits<D>::field_type, double> ||
......
......@@ -374,6 +374,11 @@ namespace Dune {
{
using OpTraits = decltype(opTraits);
using M = typename OpTraits::matrix_type;
// works only for sequential operators
if constexpr (OpTraits::isParallel){
if(opTraits.getCommOrThrow(op).communicator().size() > 1)
DUNE_THROW(Dune::InvalidStateException, "LDL works only for sequential operators.");
}
// check if LDL<M>* is convertible to
// InverseOperator*. This allows only the explicit
// specialized variants of LDL
......
......@@ -329,6 +329,11 @@ namespace Dune {
{
using OpTraits = decltype(opTraits);
using M = typename OpTraits::matrix_type;
// works only for sequential operators
if constexpr (OpTraits::isParallel){
if(opTraits.getCommOrThrow(op).communicator().size() > 1)
DUNE_THROW(Dune::InvalidStateException, "SPQR works only for sequential operators.");
}
// check if SPQR<M>* is convertible to
// InverseOperator*. This allows only the explicit
// specialized variants of SPQR
......
......@@ -729,6 +729,11 @@ namespace Dune
{
using OpTraits = decltype(opTraits);
using M = typename OpTraits::matrix_type;
// works only for sequential operators
if constexpr (OpTraits::isParallel){
if(opTraits.getCommOrThrow(op).communicator().size() > 1)
DUNE_THROW(Dune::InvalidStateException, "SuperLU works only for sequential operators.");
}
if constexpr (OpTraits::isAssembled &&
// check whether the Matrix field_type is double or complex<double>
std::is_same_v<typename FieldTraits<M>::real_type, double>){
......
......@@ -609,6 +609,11 @@ namespace Dune {
-> std::shared_ptr<typename decltype(opTraits)::solver_type>
{
using OpTraits = decltype(opTraits);
// works only for sequential operators
if constexpr (OpTraits::isParallel){
if(opTraits.getCommOrThrow(op).communicator().size() > 1)
DUNE_THROW(Dune::InvalidStateException, "UMFPack works only for sequential operators.");
}
if constexpr (OpTraits::isAssembled){
using M = typename OpTraits::matrix_type;
// check if SuperLU<M>* is convertible to
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment