Skip to content

Commit

Permalink
Add safe map check in contact helpers and start working on fixing Seg…
Browse files Browse the repository at this point in the history
…regatedAggBlockedA test
  • Loading branch information
csteimer committed Nov 30, 2023
1 parent 27ae30d commit f6ec1dc
Show file tree
Hide file tree
Showing 4 changed files with 423 additions and 242 deletions.
2 changes: 1 addition & 1 deletion packages/muelu/src/Misc/MueLu_SegregatedAFactory_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>
Array<GO> localDropMapGIDList = localDropMap->getLocalElementList();
const int GIDListSize = localDropMap->getMaxAllGlobalIndex()+1;

// Create a list of GID with only an incomplete/partial set of GIDs, which can then be completed by reduceAll
// Create a list of GID with only an incomplete/partial set of GIDs, which can then be completed by reduceAll
Array<GO> partialDropMapGIDList(GIDListSize, -Teuchos::ScalarTraits<GlobalOrdinal>::one());
Array<GO> redundantDropMapGIDList(GIDListSize, -Teuchos::ScalarTraits<GlobalOrdinal>::one());

Expand Down
10 changes: 5 additions & 5 deletions packages/muelu/test/contact/SegregatedAggFromFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@
// MueLu
#include "MueLu_AmalgamationFactory.hpp"
#include "MueLu_CoalesceDropFactory.hpp"
#include "MueLu_CreateXpetraPreconditioner.hpp"
#include "MueLu_FactoryManager.hpp"
#include "MueLu_GenericRFactory.hpp"
#include "MueLu_Hierarchy.hpp"
#include "MueLu_MapTransferFactory.hpp"
#include "MueLu_NullspaceFactory.hpp"
#include "MueLu_ParameterListInterpreter.hpp"
Expand All @@ -67,7 +65,6 @@
#include <Teuchos_XMLParameterListHelpers.hpp>

// Xpetra
#include <Xpetra_IO.hpp>
#include <Xpetra_MatrixUtils.hpp>
#include <Xpetra_MapFactory.hpp>
#include <Xpetra_StridedMapFactory.hpp>
Expand Down Expand Up @@ -288,9 +285,11 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int ar
TEUCHOS_ASSERT(levelOne->IsRequested("A", rapFactLevelZero.get()));

rapFactLevelZero->Build(*levelZero, *levelOne);

TEUCHOS_ASSERT(levelOne->IsAvailable("A", rapFactLevelZero.get()));
TEUCHOS_ASSERT(levelZero->IsAvailable("Aggregates", uncoupledAggFactLevelZero.get()));
RCP<Aggregates> aggsLevelZero = levelZero->Get<RCP<Aggregates>>("Aggregates", uncoupledAggFactLevelZero.get());

RCP<Aggregates> aggsLevelZero = levelZero->Get<RCP<Aggregates>>("Aggregates", uncoupledAggFactLevelZero.get());
MueLuTests::checkAggregatesMapPair<SC, LO, GO, NO>(aggsLevelZero, stridingInfo,
levelZero->Get<RCP<const Map>>(dropMap1Name, MueLu::NoFactory::get()),
levelZero->Get<RCP<const Map>>(dropMap2Name, MueLu::NoFactory::get()));
Expand All @@ -305,10 +304,11 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int ar

uncoupledAggFactLevelOne->Build(*levelOne);

TEUCHOS_ASSERT(levelOne->IsAvailable(dropMap1Name, MueLu::NoFactory::get()));
TEUCHOS_ASSERT(levelOne->IsAvailable(dropMap2Name, MueLu::NoFactory::get()));
TEUCHOS_ASSERT(levelOne->IsAvailable("Aggregates", uncoupledAggFactLevelOne.get()));

RCP<Aggregates> primalAggsLevelOne = levelOne->Get<RCP<Aggregates>>("Aggregates", uncoupledAggFactLevelOne.get());

MueLuTests::checkAggregatesMapPair<SC, LO, GO, NO>(primalAggsLevelOne, stridingInfo,
levelOne->Get<RCP<const Map>>(dropMap1Name, MueLu::NoFactory::get()),
levelOne->Get<RCP<const Map>>(dropMap2Name, MueLu::NoFactory::get()));
Expand Down
Loading

0 comments on commit f6ec1dc

Please sign in to comment.