Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MueLu CoalesceDrop: Error out if dropTol > 1.0 #13663

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ void CoalesceDropFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(Level

} else
GetOStream(Runtime0) << "algorithm = \"" << algo << "\": threshold = " << threshold << ", blocksize = " << A->GetFixedBlockSize() << std::endl;

if (((algo == "classical") && (classicalAlgoStr.find("scaled") != std::string::npos)) || ((algo == "distance laplacian") && (distanceLaplacianAlgoStr.find("scaled") != std::string::npos)))
TEUCHOS_TEST_FOR_EXCEPTION(realThreshold > 1.0, Exceptions::RuntimeError, "For cut-drop algorithms, \"aggregation: drop tol\" = " << threshold << ", needs to be <= 1.0");

Set<bool>(currentLevel, "Filtering", (threshold != STS::zero()));

const typename STS::magnitudeType dirichletThreshold = STS::magnitude(as<SC>(pL.get<double>("aggregation: Dirichlet threshold")));
Expand Down
9 changes: 0 additions & 9 deletions packages/muelu/src/Headers/LO-GO-NO.tmpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// @HEADER
// *****************************************************************************
// MueLu: A package for multigrid based preconditioning
//
// Copyright 2012 NTESS and the MueLu contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *****************************************************************************
// @HEADER

#ifdef MUELU_$TMPL_UPPERCASECLASS_SHORT
using $TMPL_CLASS [[maybe_unused]] = MueLu::$TMPL_CLASS<LocalOrdinal, GlobalOrdinal, Node>;
#endif
6 changes: 0 additions & 6 deletions packages/muelu/src/Headers/MueLu_UseShortNamesScalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ using MergedBlockedMatrixFactory [[maybe_unused]] = MueLu::MergedBlockedMatrixFa
#ifdef MUELU_MERGEDSMOOTHER_SHORT
using MergedSmoother [[maybe_unused]] = MueLu::MergedSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
#endif
#ifdef MUELU_MLPARAMETERLISTINTERPRETER_SHORT
using MLParameterListInterpreter [[maybe_unused]] = MueLu::MLParameterListInterpreter<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
#endif
#ifdef MUELU_MULTIVECTORTRANSFERFACTORY_SHORT
using MultiVectorTransferFactory [[maybe_unused]] = MueLu::MultiVectorTransferFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
#endif
Expand All @@ -221,9 +218,6 @@ using NotayAggregationFactory [[maybe_unused]] = MueLu::NotayAggregationFactory<
#ifdef MUELU_NULLSPACEFACTORY_SHORT
using NullspaceFactory [[maybe_unused]] = MueLu::NullspaceFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
#endif
#ifdef MUELU_NULLSPACEFACTORY_KOKKOS_SHORT
using NullspaceFactory_kokkos [[maybe_unused]] = MueLu::NullspaceFactory_kokkos<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
#endif
#ifdef MUELU_NULLSPACEPRESMOOTHFACTORY_SHORT
using NullspacePresmoothFactory [[maybe_unused]] = MueLu::NullspacePresmoothFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
#endif
Expand Down
9 changes: 0 additions & 9 deletions packages/muelu/src/Headers/Non-Templated.tmpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// @HEADER
// *****************************************************************************
// MueLu: A package for multigrid based preconditioning
//
// Copyright 2012 NTESS and the MueLu contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *****************************************************************************
// @HEADER

#ifdef MUELU_$TMPL_UPPERCASECLASS_SHORT
using $TMPL_CLASS [[maybe_unused]] = MueLu::$TMPL_CLASS;
#endif
9 changes: 0 additions & 9 deletions packages/muelu/src/Headers/SC-LO-GO-NO.tmpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// @HEADER
// *****************************************************************************
// MueLu: A package for multigrid based preconditioning
//
// Copyright 2012 NTESS and the MueLu contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *****************************************************************************
// @HEADER

#ifdef MUELU_$TMPL_UPPERCASECLASS_SHORT
using $TMPL_CLASS [[maybe_unused]] = MueLu::$TMPL_CLASS<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
#endif
23 changes: 20 additions & 3 deletions packages/muelu/src/Headers/gen_UseShortNames.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@

classListDir=../Utils/ClassList/

echo "// Type definitions for templated classes (generally graph-related) that do not require a scalar." > MueLu_UseShortNamesOrdinal.hpp
echo "// @HEADER" > MueLu_UseShortNamesOrdinal.hpp
echo "// *****************************************************************************" >> MueLu_UseShortNamesOrdinal.hpp
echo "// MueLu: A package for multigrid based preconditioning" >> MueLu_UseShortNamesOrdinal.hpp
echo "//" >> MueLu_UseShortNamesOrdinal.hpp
echo "// Copyright 2012 NTESS and the MueLu contributors." >> MueLu_UseShortNamesOrdinal.hpp
echo "// SPDX-License-Identifier: BSD-3-Clause" >> MueLu_UseShortNamesOrdinal.hpp
echo "// *****************************************************************************" >> MueLu_UseShortNamesOrdinal.hpp
echo "// @HEADER" >> MueLu_UseShortNamesOrdinal.hpp
echo "" >> MueLu_UseShortNamesOrdinal.hpp
echo "// Type definitions for templated classes (generally graph-related) that do not require a scalar." >> MueLu_UseShortNamesOrdinal.hpp
echo >> MueLu_UseShortNamesOrdinal.hpp
echo "#include <Xpetra_UseShortNamesOrdinal.hpp>" >> MueLu_UseShortNamesOrdinal.hpp
echo >> MueLu_UseShortNamesOrdinal.hpp
Expand All @@ -27,8 +36,16 @@ done
#
# Scalar
#

echo "// New definition of types using the types Scalar, LocalOrdinal, GlobalOrdinal, Node of the current context." > MueLu_UseShortNamesScalar.hpp
echo "// @HEADER" > MueLu_UseShortNamesScalar.hpp
echo "// *****************************************************************************" >> MueLu_UseShortNamesScalar.hpp
echo "// MueLu: A package for multigrid based preconditioning" >> MueLu_UseShortNamesScalar.hpp
echo "//" >> MueLu_UseShortNamesScalar.hpp
echo "// Copyright 2012 NTESS and the MueLu contributors." >> MueLu_UseShortNamesScalar.hpp
echo "// SPDX-License-Identifier: BSD-3-Clause" >> MueLu_UseShortNamesScalar.hpp
echo "// *****************************************************************************" >> MueLu_UseShortNamesScalar.hpp
echo "// @HEADER" >> MueLu_UseShortNamesScalar.hpp
echo "" >> MueLu_UseShortNamesScalar.hpp
echo "// New definition of types using the types Scalar, LocalOrdinal, GlobalOrdinal, Node of the current context." >> MueLu_UseShortNamesScalar.hpp
echo >> MueLu_UseShortNamesScalar.hpp
echo "#include <Xpetra_UseShortNamesScalar.hpp>" >> MueLu_UseShortNamesScalar.hpp
echo >> MueLu_UseShortNamesScalar.hpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
#include "MueLu_CoalesceDropFactory_kokkos_fwd.hpp"
#include "MueLu_GeometricInterpolationPFactory_kokkos_fwd.hpp"
#ifdef HAVE_MUELU_DEPRECATED_CODE
#include "MueLu_NullspaceFactory_kokkos_fwd.hpp"
#include "MueLu_SaPFactory_kokkos_fwd.hpp"
#endif
#include "MueLu_SemiCoarsenPFactory_kokkos_fwd.hpp"
Expand Down
2 changes: 0 additions & 2 deletions packages/muelu/src/Interface/MueLu_FactoryFactory_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
#include "MueLu_CoalesceDropFactory_kokkos.hpp"
#include "MueLu_GeometricInterpolationPFactory_kokkos.hpp"
#ifdef HAVE_MUELU_DEPRECATED_CODE
#include "MueLu_NullspaceFactory_kokkos.hpp"
#include "MueLu_SaPFactory_kokkos.hpp"
#endif
#include "MueLu_SemiCoarsenPFactory_kokkos.hpp"
Expand Down Expand Up @@ -216,7 +215,6 @@ RCP<const FactoryBase> FactoryFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>
if (factoryName == "CoalesceDropFactory_kokkos") return Build2<CoalesceDropFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
if (factoryName == "GeometricInterpolationPFactory_kokkos") return Build2<GeometricInterpolationPFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
#ifdef HAVE_MUELU_DEPRECATED_CODE
if (factoryName == "NullspaceFactory_kokkos") return Build2<NullspaceFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
if (factoryName == "SaPFactory_kokkos") return Build2<SaPFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
#endif
if (factoryName == "SemiCoarsenPFactory_kokkos") return Build2<SemiCoarsenPFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
Expand Down

This file was deleted.

Loading
Loading