diff --git a/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp b/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp index ff05a39c0b3f..abdf18320f47 100644 --- a/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp +++ b/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp @@ -248,7 +248,6 @@ void InterfaceAggregationFactory::Bui primalInterfaceDofRowMap = Get>(currentLevel, "Primal interface DOF map"); } TEUCHOS_ASSERT(!primalInterfaceDofRowMap.is_null()); - if (A01->IsView("stridedMaps") && rcp_dynamic_cast(A01->getRowMap("stridedMaps")) != Teuchos::null) { auto stridedRowMap = rcp_dynamic_cast(A01->getRowMap("stridedMaps")); auto stridedColMap = rcp_dynamic_cast(A01->getColMap("stridedMaps")); @@ -286,9 +285,8 @@ void InterfaceAggregationFactory::Bui * - is 2 or 3 (for 2d or 3d problems) on coarser levels (same as on finest level, whereas there * are 3 or 6 displacement dofs per node) */ - GlobalOrdinal dualDofOffset = A01->getColMap()->getMinAllGlobalIndex(); + GlobalOrdinal dualDofOffset = A01->getRowMap()->getMaxAllGlobalIndex() + 1; LocalOrdinal dualBlockDim = numDofsPerDualNode; - // Generate global replicated mapping "lagrNodeId -> dispNodeId" RCP dualDofMap = A01->getDomainMap(); GlobalOrdinal gMaxDualNodeId = AmalgamationFactory::DOFGid2NodeId( @@ -326,22 +324,22 @@ void InterfaceAggregationFactory::Bui const GlobalOrdinal gPrimalNodeId = AmalgamationFactory::DOFGid2NodeId(gPrimalRowId, primalBlockDim, primalDofOffset, primalInterfaceDofRowMap->getIndexBase()); const LocalOrdinal lPrimalNodeId = lPrimalRowId / numDofsPerPrimalNode; const LocalOrdinal primalAggId = primalVertex2AggId[lPrimalNodeId]; - - const GlobalOrdinal gDualDofId = A01->getColMap()->getGlobalElement(r); - - const GlobalOrdinal gDualNodeId = AmalgamationFactory::DOFGid2NodeId(gDualDofId, dualBlockDim, dualDofOffset, 0); - - if (local_dualNodeId2primalNodeId[gDualNodeId - gMinDualNodeId] == -GO_ONE) { - local_dualNodeId2primalNodeId[gDualNodeId - gMinDualNodeId] = gPrimalNodeId; - local_dualNodeId2primalAggId[gDualNodeId - gMinDualNodeId] = primalAggId; - } else { - GetOStream(Warnings) << "PROC: " << myRank << " gDualNodeId " << gDualNodeId << " is already connected to primal nodeId " - << local_dualNodeId2primalNodeId[gDualNodeId - gMinDualNodeId] - << ". Ignore new dispNodeId: " << gPrimalNodeId << std::endl; - } + const GlobalOrdinal gDualDofId = A01->getDomainMap()->getGlobalElement(r); + const GlobalOrdinal gDualNodeId = AmalgamationFactory::DOFGid2NodeId(gDualDofId, dualBlockDim, dualDofOffset, 0); + + TEUCHOS_TEST_FOR_EXCEPTION(local_dualNodeId2primalNodeId[gDualNodeId - gMinDualNodeId] != -GO_ONE, + MueLu::Exceptions::RuntimeError, + "PROC: " << myRank << " gDualNodeId " << gDualNodeId + << " is already connected to primal nodeId " + << local_dualNodeId2primalNodeId[gDualNodeId - gMinDualNodeId] + << ". This shouldn't be. A possible reason might be: " + "Check if parallel distribution of primalInterfaceDofRowMap corresponds " + "to the parallel distribution of subblock matrix A01."); + + local_dualNodeId2primalNodeId[gDualNodeId - gMinDualNodeId] = gPrimalNodeId; + local_dualNodeId2primalAggId[gDualNodeId - gMinDualNodeId] = primalAggId; } } - const int dualNodeId2primalNodeIdSize = Teuchos::as(local_dualNodeId2primalNodeId.size()); Teuchos::reduceAll(*comm, Teuchos::REDUCE_MAX, dualNodeId2primalNodeIdSize, &local_dualNodeId2primalNodeId[0], &dualNodeId2primalNodeId[0]); @@ -389,7 +387,6 @@ void InterfaceAggregationFactory::Bui } const LocalOrdinal fullblocksize = numDofsPerDualNode; - const GlobalOrdinal offset = A01->getColMap()->getMinAllGlobalIndex(); const LocalOrdinal blockid = -1; const LocalOrdinal nStridedOffset = 0; const LocalOrdinal stridedblocksize = fullblocksize; @@ -408,7 +405,7 @@ void InterfaceAggregationFactory::Bui RCP dualAmalgamationInfo = rcp(new AmalgamationInfo(rowTranslation, colTranslation, A01->getDomainMap(), A01->getDomainMap(), A01->getDomainMap(), - fullblocksize, offset, blockid, nStridedOffset, stridedblocksize)); + fullblocksize, dualDofOffset, blockid, nStridedOffset, stridedblocksize)); dualAggregates->SetNumAggregates(nLocalAggregates); dualAggregates->AggregatesCrossProcessors(primalAggregates->AggregatesCrossProcessors()); diff --git a/packages/muelu/src/Misc/MueLu_SegregatedAFactory_decl.hpp b/packages/muelu/src/Misc/MueLu_SegregatedAFactory_decl.hpp index 18f87c51dd0c..d71bd93fb95d 100644 --- a/packages/muelu/src/Misc/MueLu_SegregatedAFactory_decl.hpp +++ b/packages/muelu/src/Misc/MueLu_SegregatedAFactory_decl.hpp @@ -47,26 +47,62 @@ #ifndef MUELU_SEGREGATEDAFACTORY_DECL_HPP #define MUELU_SEGREGATEDAFACTORY_DECL_HPP -#include "MueLu_ConfigDefs.hpp" -#include "MueLu_SegregatedAFactory_fwd.hpp" - -#include "MueLu_Level_fwd.hpp" #include "MueLu_SingleLevelFactoryBase.hpp" namespace MueLu { /*! - @class SegregatedAFactory class. - @brief Factory for building a new "segregated" A operator. Here, "segregated" means that the user - provides a map (containing a subset of the row gids of the input matrix A) and the factory - drops the off-diagonal entries (a,b) and (b,a) in A where "a" denotes a GID entry in the provided map - and "b" denotes a GID that is not contained in the provided map. + @class SegregatedAFactory class. + @brief Factory for building a new "segregated" A operator. Here, "segregated" means that the user + provides some map(s) (containing a subset of GIDs of the input matrix A) and the factory + drops entries depending on the dropping scheme. + + ## Idea ## + + The idea is to use the output matrix A as input for the aggregation factory to have control over + the aggregates and make sure that aggregates do not cross certain areas. + + ## Remarks ## + + This factory supports multiple dropping schemes based on different inputs. They are: + + - blockmap: Based on the user provided "blockmap", the off-diagonal entries (a,b) and (b,a) in A are dropped. + "a" denotes a GID entry in the provided map and "b" denotes a GID that is not contained in the provided map. + In this use case the Factory expects a dropMap1 (==blockmap). + The blockmap scheme also doesn't support the "Call ReduceAll on dropMap1/2" options. + + - map-pair: Based on a "map-pair", the user provides two maps "dropMap1" and "dropMap2", + which specify global row/column pairs in the operator A to be dropped. + The Factory drops any possible combination of the dropMaps 1 and 2. To ensure that entry A(a,b) is + dropped, as well as entry A(b,a), there is an option to create redundant dropMaps on all Procs. + This ensures that entries aren't overlooked due to the local rowmaps of the operator A. + + Note: we have to drop the entries (i.e. not just set them to zero) as the CoalesceDropFactory + does not distinguish between matrix entries which are zero and nonzero. + + ## Input/output of this factory ## - The idea is to use the output matrix A as input for the aggregation factory to have control over - the aggregates and make sure that aggregates do not cross certain areas. + ### User parameters of SegregatedAFactory ### + Parameter | type | default | master.xml | validated | requested | description + ----------|------|---------|:----------:|:---------:|:---------:|------------ + A | Factory | null | | * | * | Generating factory of the matrix A + droppingScheme| string | vague | | * | * | Strategy to drop entries from matrix A based on the input of some map(s) [blockmap, map-pair] + dropMap1 | Factory | null | | * | * | Generating factory for dropMap1 + dropMap2 | Factory | null | | * | * | Generating factory for dropMap2 + Call ReduceAll on dropMap1 | bool | | * | | Boolean for calling reduceAll on dropMap1 + Call ReduceAll on dropMap2 | bool | | * | | Boolean for calling reduceAll on dropMap2 - Note: we have to drop the entries (i.e. not just set them to zero) as the CoalesceDropFactory - does not distinguish between matrix entries which are zero and nonzero. + The * in the @c master.xml column denotes that the parameter is defined in the @c master.xml file.
+ The * in the @c validated column means that the parameter is declared in the list of valid input parameters (see @c GetValidParameters() ).
+ The * in the @c requested column states that the data is requested as input with all dependencies (see @c DeclareInput() ). + + ### Variables provided by this factory ### + + After SegregatedAFactory::Build the following data is available (if requested) + + Parameter | generated by | description + ----------|--------------|------------ + A | SegregatedAFactory | Provides a filtered Matrix, where all possible combinations of the entries of the dropMap(s) have been removed from the input matrix A */ template GetValidParameterList() const; + RCP GetValidParameterList() const override; - //@} + void DeclareInput(Level& currentLevel) const override; //! @name Build methods. - //@{ /*! @brief Build method. Builds filtered matrix and returns it in currentLevel. */ - void Build(Level& currentLevel) const; - - //@} + void Build(Level& currentLevel) const override; private: - //! Generating factory of input variable - mutable RCP mapFact_; + void BuildBasedOnBlockmap(Level& currentLevel) const; + + void BuildBasedOnMapPair(Level& currentLevel) const; + + // RCP CreateRedundantMaps(Teuchos::RCP localDropMap, Teuchos::RCP Ain) const; }; // class SegregatedAFactory diff --git a/packages/muelu/src/Misc/MueLu_SegregatedAFactory_def.hpp b/packages/muelu/src/Misc/MueLu_SegregatedAFactory_def.hpp index 27d2daee78a3..24fde9ac68f5 100644 --- a/packages/muelu/src/Misc/MueLu_SegregatedAFactory_def.hpp +++ b/packages/muelu/src/Misc/MueLu_SegregatedAFactory_def.hpp @@ -51,9 +51,9 @@ #include "MueLu_SegregatedAFactory_decl.hpp" -#include "MueLu_FactoryManager.hpp" #include "MueLu_Level.hpp" #include "MueLu_Monitor.hpp" +#include "MueLu_Utilities_decl.hpp" namespace MueLu { @@ -61,86 +61,109 @@ template RCP SegregatedAFactory::GetValidParameterList() const { RCP validParamList = rcp(new ParameterList()); -#define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name)) -#undef SET_VALID_ENTRY + validParamList->set>("A", Teuchos::null, "Generating factory of the matrix A to be filtered"); + validParamList->set("droppingScheme", "vague", "Strategy to drop entries from matrix A based on the input of some map(s) [blockmap, map-pair]"); - validParamList->set>("A", Teuchos::null, "Generating factory of the matrix A used for filtering"); - - validParamList->set("map: name", "", "Name of map (Xpetra::Map) provided by user containing the special DOFs."); - validParamList->set("map: factory", "", "Name of generating factory for 'map: name'"); + validParamList->set>("dropMap1", Teuchos::null, "Generating factory for dropMap1"); //// + validParamList->set>("dropMap2", Teuchos::null, "Generating factory for dropMap2'"); return validParamList; -} +} // GetValidParameterList template -void SegregatedAFactory::DeclareInput(Level& currentLevel) const { +void SegregatedAFactory::DeclareInput(Level ¤tLevel) const { + const ParameterList &pL = GetParameterList(); + + TEUCHOS_TEST_FOR_EXCEPTION(pL.get>("A") == Teuchos::null, Exceptions::InvalidArgument, + "Please specify a generating factory for the matrix \"A\" to be filtered.") + TEUCHOS_TEST_FOR_EXCEPTION(pL.get("droppingScheme") == "vague", Exceptions::InvalidArgument, + "Input map type not selected. Please select one of the available strategies.") + TEUCHOS_TEST_FOR_EXCEPTION( + (pL.get("droppingScheme") != "blockmap" && pL.get("droppingScheme") != "map-pair"), + Exceptions::InvalidArgument, + "Unknown User Input: droppingScheme (=" << pL.get("droppingScheme") << ")") + Input(currentLevel, "A"); - const ParameterList& pL = GetParameterList(); - std::string mapName = pL.get("map: name"); - std::string mapFactName = pL.get("map: factory"); + if (pL.get("droppingScheme") == "blockmap") { + if (currentLevel.GetLevelID() == 0) { + currentLevel.DeclareInput("dropMap1", NoFactory::get(), this); + } else { + Input(currentLevel, "dropMap1"); + } + } else if (pL.get("droppingScheme") == "map-pair") { + if (currentLevel.GetLevelID() == 0) { + currentLevel.DeclareInput("dropMap1", NoFactory::get(), this); + currentLevel.DeclareInput("dropMap2", NoFactory::get(), this); + } else { + Input(currentLevel, "dropMap1"); + Input(currentLevel, "dropMap2"); + } + } else + TEUCHOS_TEST_FOR_EXCEPTION(true, Exceptions::InvalidArgument, "Unknown droppingScheme.") - if (currentLevel.GetLevelID() == 0) { - // Not needed, if the map is provided as user data - currentLevel.DeclareInput(mapName, NoFactory::get(), this); +} // DeclareInput + +template +void SegregatedAFactory::Build(Level ¤tLevel) const { + // Call a specialized build routine based on the format of user-given input + const ParameterList &pL = GetParameterList(); + const std::string parameterName = "droppingScheme"; + if (pL.get(parameterName) == "blockmap") { + BuildBasedOnBlockmap(currentLevel); + } else if (pL.get(parameterName) == "map-pair") { + BuildBasedOnMapPair(currentLevel); } else { - // check whether user has provided a specific name for the MapFactory - if (mapFactName == "" || mapFactName == "NoFactory") - mapFact_ = MueLu::NoFactory::getRCP(); - else if (mapFactName != "null") - mapFact_ = currentLevel.GetFactoryManager()->GetFactory(mapFactName); - - // request map generated by mapFact_ - currentLevel.DeclareInput(mapName, mapFact_.get(), this); + TEUCHOS_TEST_FOR_EXCEPTION(true, Exceptions::InvalidArgument, + "MueLu::SegregatedAFactory::Build(): Unknown map type of user input. " + "Set a valid value for the parameter \"" + << parameterName << "\".") } -} +} // Build template -void SegregatedAFactory::Build(Level& currentLevel) const { - FactoryMonitor m(*this, "Matrix filtering (segregation)", currentLevel); - - RCP Ain = Get>(currentLevel, "A"); +void SegregatedAFactory::BuildBasedOnBlockmap(Level ¤tLevel) const { + FactoryMonitor m(*this, "Matrix filtering (segregation, blockmap)", currentLevel); - const ParameterList& pL = GetParameterList(); - std::string mapName = pL.get("map: name"); - std::string mapFact = pL.get("map: factory"); + RCP Ain = Get>(currentLevel, "A"); + RCP dropMap1 = Teuchos::null; + const std::string dropMap1Name = "dropMap1"; - // fetch map from level - RCP map = Teuchos::null; + // fetch maps from level if (currentLevel.GetLevelID() == 0) { - map = currentLevel.Get>(mapName, NoFactory::get()); - GetOStream(Statistics0) << "User provided map \"" << mapName << "\": length dimension=" << map->getGlobalNumElements() << std::endl; + dropMap1 = currentLevel.Get>(dropMap1Name, NoFactory::get()); + GetOStream(Statistics0) << "User provided dropMap1 \"" << dropMap1Name << "\": length dimension=" << dropMap1->getGlobalNumElements() << std::endl; } else { - if (currentLevel.IsAvailable(mapName, mapFact_.get()) == false) - GetOStream(Runtime0) << "User provided map \"" << mapName << "\" not found in Level class on level " << currentLevel.GetLevelID() << "." << std::endl; - map = currentLevel.Get>(mapName, mapFact_.get()); + dropMap1 = Get>(currentLevel, dropMap1Name); } + TEUCHOS_ASSERT(!dropMap1.is_null()); // create new empty Operator Teuchos::RCP Aout = MatrixFactory::Build(Ain->getRowMap(), Ain->getGlobalMaxNumRowEntries()); size_t numLocalRows = Ain->getLocalNumRows(); - for (size_t row = 0; row < numLocalRows; row++) { // how can i replace this by a parallel for? + for (size_t row = 0; row < numLocalRows; row++) { GlobalOrdinal grid = Ain->getRowMap()->getGlobalElement(row); // global row id - bool isInMap = map->isNodeGlobalElement(grid); + bool isInMap = dropMap1->isNodeGlobalElement(grid); // extract row information from input matrix - Teuchos::ArrayView indices; - Teuchos::ArrayView vals; - Ain->getLocalRowView(row, indices, vals); + auto lclMat = Ain->getLocalMatrixHost(); + auto rowView = lclMat.row(row); // just copy all values in output - Teuchos::ArrayRCP indout(indices.size(), Teuchos::ScalarTraits::zero()); - Teuchos::ArrayRCP valout(indices.size(), Teuchos::ScalarTraits::zero()); + Teuchos::ArrayRCP indout(rowView.length, Teuchos::ScalarTraits::zero()); + Teuchos::ArrayRCP valout(rowView.length, Teuchos::ScalarTraits::zero()); size_t nNonzeros = 0; - for (size_t i = 0; i < (size_t)indices.size(); i++) { // or can be parallelize this loop? - GlobalOrdinal gcid = Ain->getColMap()->getGlobalElement(indices[i]); // global column id - bool isInMap2 = map->isNodeGlobalElement(gcid); + for (LO jj = 0; jj < rowView.length; ++jj) { + LO lcid = rowView.colidx(jj); + GO gcid = Ain->getColMap()->getGlobalElement(lcid); + auto val = rowView.value(jj); + bool isInMap2 = dropMap1->isNodeGlobalElement(gcid); if (isInMap == isInMap2) { indout[nNonzeros] = gcid; - valout[nNonzeros] = vals[i]; + valout[nNonzeros] = val; nNonzeros++; } } @@ -158,7 +181,91 @@ void SegregatedAFactory::Build(Level& GetOStream(Statistics0, 0) << "Nonzeros in A (input): " << Ain->getGlobalNumEntries() << ", Nonzeros after filtering A: " << Aout->getGlobalNumEntries() << std::endl; Set(currentLevel, "A", Aout); -} +} // BuildBasedOnBlockmap + +template +void SegregatedAFactory::BuildBasedOnMapPair(Level ¤tLevel) const { + FactoryMonitor m(*this, "Matrix filtering (segregation, map-pair)", currentLevel); + + RCP Ain = Get>(currentLevel, "A"); + + // fetch maps from level + RCP dropMap1 = Teuchos::null; + RCP dropMap2 = Teuchos::null; + + const std::string dropMap1Name = "dropMap1"; + const std::string dropMap2Name = "dropMap2"; + + if (currentLevel.GetLevelID() == 0) { + dropMap1 = currentLevel.Get>(dropMap1Name, NoFactory::get()); + dropMap2 = currentLevel.Get>(dropMap2Name, NoFactory::get()); + GetOStream(Statistics0) << "User provided dropMap1 \"" << dropMap1Name << "\": length dimension=" << dropMap1->getGlobalNumElements() << std::endl; + GetOStream(Statistics0) << "User provided dropMap2 \"" << dropMap2Name << "\": length dimension=" << dropMap2->getGlobalNumElements() << std::endl; + } else { + dropMap1 = Get>(currentLevel, dropMap1Name); + dropMap2 = Get>(currentLevel, dropMap2Name); + } + + TEUCHOS_ASSERT(!dropMap1.is_null()); + TEUCHOS_ASSERT(!dropMap2.is_null()); + + // create new empty Operator + Teuchos::RCP Aout = MatrixFactory::Build(Ain->getRowMap(), Ain->getGlobalMaxNumRowEntries()); + + // import the dropping information from other procs for off Rank entries + Teuchos::RCP finalDropMap1 = Teuchos::null; + Teuchos::RCP finalDropMap2 = Teuchos::null; + + finalDropMap1 = MueLu::importOffRankDroppingInfo(dropMap1, Ain); + finalDropMap2 = MueLu::importOffRankDroppingInfo(dropMap2, Ain); + + // Start copying the matrix row by row and dropping any entries that are contained as a combination of entries of + // dropMap1 and dropMap2 + size_t numLocalMatrixRows = Ain->getLocalNumRows(); + + for (size_t row = 0; row < numLocalMatrixRows; row++) { + GO grid = Ain->getRowMap()->getGlobalElement(row); // global row id + bool rowIsInMap1 = finalDropMap1->isNodeGlobalElement(grid); + bool rowIsInMap2 = finalDropMap2->isNodeGlobalElement(grid); + + // extract row information from input matrix + auto lclMat = Ain->getLocalMatrixHost(); + auto rowView = lclMat.row(row); + + // just copy all values in output + Teuchos::ArrayRCP indout(rowView.length, Teuchos::ScalarTraits::zero()); + Teuchos::ArrayRCP valout(rowView.length, Teuchos::ScalarTraits::zero()); + + size_t nNonzeros = 0; + for (LO jj = 0; jj < rowView.length; ++jj) { + LO lcid = rowView.colidx(jj); + GO gcid = Ain->getColMap()->getGlobalElement(lcid); // global column id + auto val = rowView.value(jj); + bool colIsInMap1 = finalDropMap1->isNodeGlobalElement(gcid); + bool colIsInMap2 = finalDropMap2->isNodeGlobalElement(gcid); + + if ((rowIsInMap1 && colIsInMap2) || (rowIsInMap2 && colIsInMap1)) { + // do nothing == drop this entry + } else { + indout[nNonzeros] = gcid; + valout[nNonzeros] = val; + nNonzeros++; + } + } + indout.resize(nNonzeros); + valout.resize(nNonzeros); + Aout->insertGlobalValues(Ain->getRowMap()->getGlobalElement(row), indout.view(0, indout.size()), valout.view(0, valout.size())); + } + + Aout->fillComplete(Ain->getDomainMap(), Ain->getRangeMap()); + + // copy block size information + Aout->SetFixedBlockSize(Ain->GetFixedBlockSize()); + + GetOStream(Statistics0, 0) << "Nonzeros in A (input): " << Ain->getGlobalNumEntries() << ", Nonzeros after filtering A: " << Aout->getGlobalNumEntries() << std::endl; + + currentLevel.Set("A", Aout, this); +} // BuildBasedOnMapPair } // namespace MueLu diff --git a/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_def.hpp b/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_def.hpp index 6c4defcc4116..47aa3267e18f 100644 --- a/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_def.hpp +++ b/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_def.hpp @@ -132,6 +132,7 @@ void HierarchyUtils::AddNonSerializab name != "Pnodal" && name != "NodeMatrix" && name != "NodeAggMatrix" && name != "Nullspace" && name != "Coordinates" && name != "pcoarsen: element to node map" && name != "Node Comm" && name != "DualNodeID2PrimalNodeID" && name != "Primal interface DOF map" && + name != "dropMap1" && name != "dropMap2" && !IsParamMuemexVariable(name), Exceptions::InvalidArgument, std::string("MueLu::Utils::AddNonSerializableDataToHierarchy: parameter list contains unknown data type(") + name + ")"); @@ -260,6 +261,12 @@ void HierarchyUtils::AddNonSerializab } else if (name == "Primal interface DOF map") { level->AddKeepFlag(name, NoFactory::get(), MueLu::UserData); level->Set(name, Teuchos::getValue>(levelListEntry->second), NoFactory::get()); + } else if (name == "dropMap1") { + level->AddKeepFlag(name, NoFactory::get(), MueLu::UserData); + level->Set(name, Teuchos::getValue>(levelListEntry->second), NoFactory::get()); + } else if (name == "dropMap2") { + level->AddKeepFlag(name, NoFactory::get(), MueLu::UserData); + level->Set(name, Teuchos::getValue>(levelListEntry->second), NoFactory::get()); } #ifdef HAVE_MUELU_INTREPID2 else if (name == "pcoarsen: element to node map") { @@ -321,6 +328,7 @@ void HierarchyUtils::AddNonSerializab name != "NodeMatrix" && name != "Nullspace" && name != "Coordinates" && name != "pcoarsen: element to node map" && name != "Node Comm" && name != "DualNodeID2PrimalNodeID" && name != "Primal interface DOF map" && + name != "dropMap1" && name != "dropMap2" && name != "output stream" && !IsParamValidVariable(name), Exceptions::InvalidArgument, @@ -353,6 +361,12 @@ void HierarchyUtils::AddNonSerializab } else if (name == "Primal interface DOF map") { level->AddKeepFlag(name, NoFactory::get(), MueLu::UserData); level->Set(name, Teuchos::getValue>(userListEntry->second), NoFactory::get()); + } else if (name == "dropMap1") { + level->AddKeepFlag(name, NoFactory::get(), MueLu::UserData); + level->Set(name, Teuchos::getValue>(userListEntry->second), NoFactory::get()); + } else if (name == "dropMap2") { + level->AddKeepFlag(name, NoFactory::get(), MueLu::UserData); + level->Set(name, Teuchos::getValue>(userListEntry->second), NoFactory::get()); } #ifdef HAVE_MUELU_INTREPID2 else if (name == "pcoarsen: element to node map") { diff --git a/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp b/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp index ec4f388127e0..546619153806 100644 --- a/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp +++ b/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp @@ -106,37 +106,42 @@ namespace MueLu { #ifdef HAVE_MUELU_EPETRA // defined after Utilities class template -RCP > +RCP> Convert_Epetra_CrsMatrix_ToXpetra_CrsMatrixWrap(RCP& epAB); template -RCP > +RCP> EpetraCrs_To_XpetraMatrix(const Teuchos::RCP& A); template -RCP > +RCP> EpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP& V); #endif template -RCP > -TpetraCrs_To_XpetraMatrix(const Teuchos::RCP >& Atpetra); +RCP> +TpetraCrs_To_XpetraMatrix(const Teuchos::RCP>& Atpetra); template -RCP > -TpetraFECrs_To_XpetraMatrix(const Teuchos::RCP >& Atpetra); +RCP> +TpetraFECrs_To_XpetraMatrix(const Teuchos::RCP>& Atpetra); template -RCP > -TpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP >& Vtpetra); +RCP> +TpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP>& Vtpetra); template -RCP > -TpetraFEMultiVector_To_XpetraMultiVector(const Teuchos::RCP >& Vtpetra); +RCP> +TpetraFEMultiVector_To_XpetraMultiVector(const Teuchos::RCP>& Vtpetra); template void leftRghtDofScalingWithinNode(const Xpetra::Matrix& Atpetra, size_t blkSize, size_t nSweeps, Teuchos::ArrayRCP& rowScaling, Teuchos::ArrayRCP& colScaling); +template +Teuchos::RCP> importOffRankDroppingInfo( + Teuchos::RCP>& localDropMap, + Teuchos::RCP>& Ain); + /*! @class Utilities @brief MueLu utility class. @@ -158,14 +163,14 @@ class Utilities : public UtilitiesBase MV2EpetraMV(RCP > const vec); - static RCP MV2NonConstEpetraMV(RCP > vec); + static RCP MV2EpetraMV(RCP> const vec); + static RCP MV2NonConstEpetraMV(RCP> vec); static const Epetra_MultiVector& MV2EpetraMV(const Xpetra::MultiVector& vec); static Epetra_MultiVector& MV2NonConstEpetraMV(Xpetra::MultiVector& vec); - static RCP Op2EpetraCrs(RCP > Op); - static RCP Op2NonConstEpetraCrs(RCP > Op); + static RCP Op2EpetraCrs(RCP> Op); + static RCP Op2NonConstEpetraCrs(RCP> Op); static const Epetra_CrsMatrix& Op2EpetraCrs(const Xpetra::Matrix& Op); static Epetra_CrsMatrix& Op2NonConstEpetraCrs(Xpetra::Matrix& Op); @@ -175,29 +180,29 @@ class Utilities : public UtilitiesBase > MV2TpetraMV(RCP > const vec); - static RCP > MV2NonConstTpetraMV(RCP > vec); - static RCP > MV2NonConstTpetraMV2(Xpetra::MultiVector& vec); + static RCP> MV2TpetraMV(RCP> const vec); + static RCP> MV2NonConstTpetraMV(RCP> vec); + static RCP> MV2NonConstTpetraMV2(Xpetra::MultiVector& vec); static const Tpetra::MultiVector& MV2TpetraMV(const Xpetra::MultiVector& vec); static Tpetra::MultiVector& MV2NonConstTpetraMV(Xpetra::MultiVector& vec); - static RCP > Op2TpetraCrs(RCP > Op); - static RCP > Op2NonConstTpetraCrs(RCP > Op); + static RCP> Op2TpetraCrs(RCP> Op); + static RCP> Op2NonConstTpetraCrs(RCP> Op); static const Tpetra::CrsMatrix& Op2TpetraCrs(const Xpetra::Matrix& Op); static Tpetra::CrsMatrix& Op2NonConstTpetraCrs(Xpetra::Matrix& Op); - static RCP > Op2TpetraBlockCrs(RCP > Op); - static RCP > Op2NonConstTpetraBlockCrs(RCP > Op); + static RCP> Op2TpetraBlockCrs(RCP> Op); + static RCP> Op2NonConstTpetraBlockCrs(RCP> Op); static const Tpetra::BlockCrsMatrix& Op2TpetraBlockCrs(const Xpetra::Matrix& Op); static Tpetra::BlockCrsMatrix& Op2NonConstTpetraBlockCrs(Xpetra::Matrix& Op); - static RCP > Op2TpetraRow(RCP > Op); - static RCP > Op2NonConstTpetraRow(RCP > Op); + static RCP> Op2TpetraRow(RCP> Op); + static RCP> Op2NonConstTpetraRow(RCP> Op); - static const RCP > Map2TpetraMap(const Xpetra::Map& map); + static const RCP> Map2TpetraMap(const Xpetra::Map& map); static void MyOldScaleMatrix(Xpetra::Matrix& Op, const Teuchos::ArrayRCP& scalingVector, bool doInverse = true, bool doFillComplete = true, bool doOptimizeStorage = true); @@ -207,11 +212,11 @@ class Utilities : public UtilitiesBase& Op, const Teuchos::ArrayRCP& scalingVector, bool doFillComplete, bool doOptimizeStorage); - static RCP > Transpose(Xpetra::Matrix& Op, bool optimizeTranspose = false, const std::string& label = std::string(), const Teuchos::RCP& params = Teuchos::null); + static RCP> Transpose(Xpetra::Matrix& Op, bool optimizeTranspose = false, const std::string& label = std::string(), const Teuchos::RCP& params = Teuchos::null); - static RCP > RealValuedToScalarMultiVector(RCP::coordinateType, LocalOrdinal, GlobalOrdinal, Node> > X); + static RCP> RealValuedToScalarMultiVector(RCP::coordinateType, LocalOrdinal, GlobalOrdinal, Node>> X); - static RCP::magnitudeType, LocalOrdinal, GlobalOrdinal, Node> > ExtractCoordinatesFromParameterList(ParameterList& paramList); + static RCP::magnitudeType, LocalOrdinal, GlobalOrdinal, Node>> ExtractCoordinatesFromParameterList(ParameterList& paramList); }; // class Utilities @@ -322,29 +327,29 @@ class Utilities : public UtilitiesBase > MV2TpetraMV(RCP const vec) { + static RCP> MV2TpetraMV(RCP const vec) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("MV2TpetraMV: Tpetra has not been compiled with support for LO=GO=int."); #else - RCP > tmpVec = rcp_dynamic_cast >(vec); + RCP> tmpVec = rcp_dynamic_cast>(vec); if (tmpVec == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::MultiVector to Xpetra::TpetraMultiVector failed"); return tmpVec->getTpetra_MultiVector(); #endif } - static RCP > MV2NonConstTpetraMV(RCP vec) { + static RCP> MV2NonConstTpetraMV(RCP vec) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("MV2NonConstTpetraMV: Tpetra has not been compiled with support for LO=GO=int."); #else - RCP > tmpVec = rcp_dynamic_cast >(vec); + RCP> tmpVec = rcp_dynamic_cast>(vec); if (tmpVec == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::MultiVector to Xpetra::TpetraMultiVector failed"); return tmpVec->getTpetra_MultiVector(); #endif } - static RCP > MV2NonConstTpetraMV2(MultiVector& vec) { + static RCP> MV2NonConstTpetraMV2(MultiVector& vec) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("MV2NonConstTpetraMV2: Tpetra has not been compiled with support for LO=GO=int."); @@ -373,7 +378,7 @@ class Utilities : public UtilitiesBase > Op2TpetraCrs(RCP Op) { + static RCP> Op2TpetraCrs(RCP Op) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("Op2TpetraCrs: Tpetra has not been compiled with support for LO=GO=int."); @@ -382,13 +387,13 @@ class Utilities : public UtilitiesBase crsOp = rcp_dynamic_cast(Op); if (crsOp == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed"); - const RCP >& tmp_ECrsMtx = rcp_dynamic_cast >(crsOp->getCrsMatrix()); + const RCP>& tmp_ECrsMtx = rcp_dynamic_cast>(crsOp->getCrsMatrix()); if (tmp_ECrsMtx == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::CrsMatrix to Xpetra::TpetraCrsMatrix failed"); return tmp_ECrsMtx->getTpetra_CrsMatrix(); #endif } - static RCP > Op2NonConstTpetraCrs(RCP Op) { + static RCP> Op2NonConstTpetraCrs(RCP Op) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("Op2NonConstTpetraCrs: Tpetra has not been compiled with support for LO=GO=int."); @@ -396,7 +401,7 @@ class Utilities : public UtilitiesBase crsOp = rcp_dynamic_cast(Op); if (crsOp == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed"); - const RCP >& tmp_ECrsMtx = rcp_dynamic_cast >(crsOp->getCrsMatrix()); + const RCP>& tmp_ECrsMtx = rcp_dynamic_cast>(crsOp->getCrsMatrix()); if (tmp_ECrsMtx == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::CrsMatrix to Xpetra::TpetraCrsMatrix failed"); return tmp_ECrsMtx->getTpetra_CrsMatrixNonConst(); @@ -440,7 +445,7 @@ class Utilities : public UtilitiesBase > Op2TpetraBlockCrs(RCP Op) { + static RCP> Op2TpetraBlockCrs(RCP Op) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("Op2TpetraBlockCrs: Tpetra has not been compiled with support for LO=GO=int."); @@ -449,14 +454,14 @@ class Utilities : public UtilitiesBase crsOp = rcp_dynamic_cast(Op); if (crsOp == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed"); - const RCP >& tmp_ECrsMtx = rcp_dynamic_cast >(crsOp->getCrsMatrix()); + const RCP>& tmp_ECrsMtx = rcp_dynamic_cast>(crsOp->getCrsMatrix()); if (tmp_ECrsMtx == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::CrsMatrix to Xpetra::TpetraBlockCrsMatrix failed"); return tmp_ECrsMtx->getTpetra_BlockCrsMatrix(); #endif } - static RCP > Op2NonConstTpetraBlockCrs(RCP Op) { + static RCP> Op2NonConstTpetraBlockCrs(RCP Op) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("Op2NonConstTpetraBlockCrs: Tpetra has not been compiled with support for LO=GO=int."); @@ -464,7 +469,7 @@ class Utilities : public UtilitiesBase crsOp = rcp_dynamic_cast(Op); if (crsOp == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed"); - const RCP >& tmp_ECrsMtx = rcp_dynamic_cast >(crsOp->getCrsMatrix()); + const RCP>& tmp_ECrsMtx = rcp_dynamic_cast>(crsOp->getCrsMatrix()); if (tmp_ECrsMtx == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::CrsMatrix to Xpetra::TpetraBlockCrsMatrix failed"); return tmp_ECrsMtx->getTpetra_BlockCrsMatrixNonConst(); @@ -508,25 +513,25 @@ class Utilities : public UtilitiesBase > Op2TpetraRow(RCP Op) { + static RCP> Op2TpetraRow(RCP Op) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("Op2TpetraRow: Tpetra has not been compiled with support for LO=GO=int."); #else - RCP mat = rcp_dynamic_cast(Op); - RCP > rmat = rcp_dynamic_cast >(Op); + RCP mat = rcp_dynamic_cast(Op); + RCP> rmat = rcp_dynamic_cast>(Op); if (!mat.is_null()) { RCP crsOp = rcp_dynamic_cast(mat); if (crsOp == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed"); - RCP crsMat = crsOp->getCrsMatrix(); - const RCP > tmp_Crs = rcp_dynamic_cast >(crsMat); - RCP > tmp_BlockCrs; + RCP crsMat = crsOp->getCrsMatrix(); + const RCP> tmp_Crs = rcp_dynamic_cast>(crsMat); + RCP> tmp_BlockCrs; if (!tmp_Crs.is_null()) { return tmp_Crs->getTpetra_CrsMatrixNonConst(); } else { - tmp_BlockCrs = rcp_dynamic_cast >(crsMat); + tmp_BlockCrs = rcp_dynamic_cast>(crsMat); if (tmp_BlockCrs.is_null()) throw Exceptions::BadCast("Cast from Xpetra::CrsMatrix to Xpetra::TpetraCrsMatrix and Xpetra::TpetraBlockCrsMatrix failed"); return tmp_BlockCrs->getTpetra_BlockCrsMatrixNonConst(); @@ -534,33 +539,33 @@ class Utilities : public UtilitiesBasegetTpetra_RowMatrix(); } else { - RCP tpOp = rcp_dynamic_cast(Op, true); - RCP > tOp = tpOp->getOperatorConst(); - RCP > tRow = rcp_dynamic_cast >(tOp, true); + RCP tpOp = rcp_dynamic_cast(Op, true); + RCP> tOp = tpOp->getOperatorConst(); + RCP> tRow = rcp_dynamic_cast>(tOp, true); return tRow; } #endif } - static RCP > Op2NonConstTpetraRow(RCP Op) { + static RCP> Op2NonConstTpetraRow(RCP Op) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("Op2NonConstTpetraRow: Tpetra has not been compiled with support for LO=GO=int."); #else - RCP mat = rcp_dynamic_cast(Op); - RCP > rmat = rcp_dynamic_cast >(Op); + RCP mat = rcp_dynamic_cast(Op); + RCP> rmat = rcp_dynamic_cast>(Op); if (!mat.is_null()) { RCP crsOp = rcp_dynamic_cast(mat); if (crsOp == Teuchos::null) throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed"); - RCP crsMat = crsOp->getCrsMatrix(); - const RCP > tmp_Crs = rcp_dynamic_cast >(crsMat); - RCP > tmp_BlockCrs; + RCP crsMat = crsOp->getCrsMatrix(); + const RCP> tmp_Crs = rcp_dynamic_cast>(crsMat); + RCP> tmp_BlockCrs; if (!tmp_Crs.is_null()) { return tmp_Crs->getTpetra_CrsMatrixNonConst(); } else { - tmp_BlockCrs = rcp_dynamic_cast >(crsMat); + tmp_BlockCrs = rcp_dynamic_cast>(crsMat); if (tmp_BlockCrs.is_null()) throw Exceptions::BadCast("Cast from Xpetra::CrsMatrix to Xpetra::TpetraCrsMatrix and Xpetra::TpetraBlockCrsMatrix failed"); return tmp_BlockCrs->getTpetra_BlockCrsMatrixNonConst(); @@ -568,20 +573,20 @@ class Utilities : public UtilitiesBasegetTpetra_RowMatrixNonConst(); } else { - RCP tpOp = rcp_dynamic_cast(Op, true); - RCP > tOp = tpOp->getOperator(); - RCP > tRow = rcp_dynamic_cast >(tOp, true); + RCP tpOp = rcp_dynamic_cast(Op, true); + RCP> tOp = tpOp->getOperator(); + RCP> tRow = rcp_dynamic_cast>(tOp, true); return tRow; } #endif }; - static const RCP > Map2TpetraMap(const Map& map) { + static const RCP> Map2TpetraMap(const Map& map) { #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) throw Exceptions::RuntimeError("Map2TpetraMap: Tpetra has not been compiled with support for LO=GO=int."); #else - const RCP >& tmp_TMap = rcp_dynamic_cast >(rcpFromRef(map)); + const RCP>& tmp_TMap = rcp_dynamic_cast>(rcpFromRef(map)); if (tmp_TMap == Teuchos::null) throw Exceptions::BadCast("Utilities::Map2TpetraMap : Cast from Xpetra::Map to Xpetra::TpetraMap failed"); return tmp_TMap->getTpetra_Map(); @@ -624,9 +629,9 @@ class Utilities : public UtilitiesBase& tpOp = Op2NonConstTpetraCrs(Op); - const RCP > rowMap = tpOp.getRowMap(); - const RCP > domainMap = tpOp.getDomainMap(); - const RCP > rangeMap = tpOp.getRangeMap(); + const RCP> rowMap = tpOp.getRowMap(); + const RCP> domainMap = tpOp.getDomainMap(); + const RCP> rangeMap = tpOp.getRangeMap(); size_t maxRowSize = tpOp.getLocalMaxNumRowEntries(); if (maxRowSize == Teuchos::as(-1)) // hasn't been determined yet @@ -738,7 +743,7 @@ class Utilities : public UtilitiesBase& tpetraOp = Utilities::Op2TpetraCrs(Op); // Compute the transpose A of the Tpetra matrix tpetraOp. - RCP > A; + RCP> A; Tpetra::RowMatrixTransposer transposer(rcpFromRef(tpetraOp), label); { @@ -749,9 +754,9 @@ class Utilities : public UtilitiesBase > AA = rcp(new Xpetra::TpetraCrsMatrix(A)); - RCP AAA = rcp_implicit_cast(AA); - RCP AAAA = rcp(new CrsMatrixWrap(AAA)); + RCP> AA = rcp(new Xpetra::TpetraCrsMatrix(A)); + RCP AAA = rcp_implicit_cast(AA); + RCP AAAA = rcp(new CrsMatrixWrap(AAA)); if (Op.IsView("stridedMaps")) AAAA->CreateView("stridedMaps", Teuchos::rcpFromRef(Op), true /*doTranspose*/); @@ -774,9 +779,9 @@ class Utilities : public UtilitiesBase > AA = rcp(new Xpetra::TpetraBlockCrsMatrix(At)); - RCP AAA = rcp_implicit_cast(AA); - RCP AAAA = rcp(new CrsMatrixWrap(AAA)); + RCP> AA = rcp(new Xpetra::TpetraBlockCrsMatrix(At)); + RCP AAA = rcp_implicit_cast(AA); + RCP AAAA = rcp(new CrsMatrixWrap(AAA)); if (Op.IsView("stridedMaps")) AAAA->CreateView("stridedMaps", Teuchos::rcpFromRef(Op), true /*doTranspose*/); @@ -819,16 +824,16 @@ class Utilities : public UtilitiesBase::magnitudeType, LocalOrdinal, GlobalOrdinal, Node> > - RealValuedToScalarMultiVector(RCP::coordinateType, LocalOrdinal, GlobalOrdinal, Node> > X) { - RCP > Xscalar = rcp_dynamic_cast >(X, true); + static RCP::magnitudeType, LocalOrdinal, GlobalOrdinal, Node>> + RealValuedToScalarMultiVector(RCP::coordinateType, LocalOrdinal, GlobalOrdinal, Node>> X) { + RCP> Xscalar = rcp_dynamic_cast>(X, true); return Xscalar; } /*! @brief Extract coordinates from parameter list and return them in a Xpetra::MultiVector */ - static RCP::magnitudeType, LocalOrdinal, GlobalOrdinal, Node> > ExtractCoordinatesFromParameterList(ParameterList& paramList) { - RCP::magnitudeType, LocalOrdinal, GlobalOrdinal, Node> > coordinates = Teuchos::null; + static RCP::magnitudeType, LocalOrdinal, GlobalOrdinal, Node>> ExtractCoordinatesFromParameterList(ParameterList& paramList) { + RCP::magnitudeType, LocalOrdinal, GlobalOrdinal, Node>> coordinates = Teuchos::null; // check whether coordinates are contained in parameter list if (paramList.isParameter("Coordinates") == false) @@ -850,15 +855,15 @@ class Utilities : public UtilitiesBase::magnitudeType, LocalOrdinal, GlobalOrdinal, Node> tdMV; RCP doubleCoords = Teuchos::null; - if (paramList.isType >("Coordinates")) { + if (paramList.isType>("Coordinates")) { // Coordinates are stored as a double vector - doubleCoords = paramList.get >("Coordinates"); + doubleCoords = paramList.get>("Coordinates"); paramList.remove("Coordinates"); } #if !defined(HAVE_TPETRA_EXPLICIT_INSTANTIATION) || defined(HAVE_TPETRA_INST_FLOAT) - else if (paramList.isType >("Coordinates")) { + else if (paramList.isType>("Coordinates")) { // check if coordinates are stored as a float vector - floatCoords = paramList.get >("Coordinates"); + floatCoords = paramList.get>("Coordinates"); paramList.remove("Coordinates"); doubleCoords = rcp(new tdMV(floatCoords->getMap(), floatCoords->getNumVectors())); deep_copy(*doubleCoords, *floatCoords); @@ -873,11 +878,11 @@ class Utilities : public UtilitiesBase doubleEpCoords; - if (paramList.isType >("Coordinates")) { - doubleEpCoords = paramList.get >("Coordinates"); + if (paramList.isType>("Coordinates")) { + doubleEpCoords = paramList.get>("Coordinates"); paramList.remove("Coordinates"); - RCP > epCoordinates = Teuchos::rcp(new Xpetra::EpetraMultiVectorT(doubleEpCoords)); - coordinates = rcp_dynamic_cast::magnitudeType, LocalOrdinal, GlobalOrdinal, Node> >(epCoordinates); + RCP> epCoordinates = Teuchos::rcp(new Xpetra::EpetraMultiVectorT(doubleEpCoords)); + coordinates = rcp_dynamic_cast::magnitudeType, LocalOrdinal, GlobalOrdinal, Node>>(epCoordinates); TEUCHOS_TEST_FOR_EXCEPT(doubleEpCoords->NumVectors() != Teuchos::as(coordinates->getNumVectors())); } #endif @@ -945,7 +950,7 @@ bool IsParamValidVariable(const std::string& name); TODO move this function to an Xpetra utility file */ template -RCP > +RCP> EpetraCrs_To_XpetraMatrix(const Teuchos::RCP& A) { typedef Xpetra::EpetraCrsMatrixT XECrsMatrix; typedef Xpetra::CrsMatrix XCrsMatrix; @@ -960,7 +965,7 @@ EpetraCrs_To_XpetraMatrix(const Teuchos::RCP& A) { TODO move this function to an Xpetra utility file */ template -RCP > +RCP> EpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP& V) { return rcp(new Xpetra::EpetraMultiVectorT(V)); } @@ -971,8 +976,8 @@ EpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP& V TODO move this function to an Xpetra utility file */ template -RCP > -TpetraCrs_To_XpetraMatrix(const Teuchos::RCP >& Atpetra) { +RCP> +TpetraCrs_To_XpetraMatrix(const Teuchos::RCP>& Atpetra) { typedef Xpetra::TpetraCrsMatrix XTCrsMatrix; typedef Xpetra::CrsMatrix XCrsMatrix; typedef Xpetra::CrsMatrixWrap XCrsMatrixWrap; @@ -1095,8 +1100,8 @@ void leftRghtDofScalingWithinNode(const Xpetra::Matrix -RCP > -TpetraFECrs_To_XpetraMatrix(const Teuchos::RCP >& Atpetra) { +RCP> +TpetraFECrs_To_XpetraMatrix(const Teuchos::RCP>& Atpetra) { typedef typename Tpetra::FECrsMatrix::crs_matrix_type tpetra_crs_matrix_type; typedef Xpetra::TpetraCrsMatrix XTCrsMatrix; typedef Xpetra::CrsMatrix XCrsMatrix; @@ -1111,8 +1116,8 @@ TpetraFECrs_To_XpetraMatrix(const Teuchos::RCP -RCP > -TpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP >& Vtpetra) { +RCP> +TpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP>& Vtpetra) { return rcp(new Xpetra::TpetraMultiVector(Vtpetra)); } @@ -1121,8 +1126,8 @@ TpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP -RCP > -TpetraFEMultiVector_To_XpetraMultiVector(const Teuchos::RCP >& Vtpetra) { +RCP> +TpetraFEMultiVector_To_XpetraMultiVector(const Teuchos::RCP>& Vtpetra) { typedef Tpetra::MultiVector MV; RCP Vmv = Teuchos::rcp_dynamic_cast(Vtpetra); return rcp(new Xpetra::TpetraMultiVector(Vmv)); @@ -1142,7 +1147,7 @@ std::string toString(const T& what) { TODO move this function to an Xpetra utility file */ template -RCP > +RCP> EpetraCrs_To_XpetraMatrix(const Teuchos::RCP& A); /*! \fn EpetraMultiVector_To_XpetraMultiVector @@ -1150,7 +1155,7 @@ EpetraCrs_To_XpetraMatrix(const Teuchos::RCP& A); TODO move this function to an Xpetra utility file */ template -RCP > +RCP> EpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP& V); #endif @@ -1159,23 +1164,58 @@ EpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP& V TODO move this function to an Xpetra utility file */ template -RCP > -TpetraCrs_To_XpetraMatrix(const Teuchos::RCP >& Atpetra); +RCP> +TpetraCrs_To_XpetraMatrix(const Teuchos::RCP>& Atpetra); /*! \fn TpetraMultiVector_To_XpetraMultiVector @brief Helper function to convert a Tpetra::MultiVector to an Xpetra::MultiVector TODO move this function to an Xpetra utility file */ template -RCP > -TpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP >& Vtpetra); +RCP> +TpetraMultiVector_To_XpetraMultiVector(const Teuchos::RCP>& Vtpetra); // Generates a communicator whose only members are other ranks of the baseComm on my node -Teuchos::RCP > GenerateNodeComm(RCP >& baseComm, int& NodeId, const int reductionFactor); +Teuchos::RCP> GenerateNodeComm(RCP>& baseComm, int& NodeId, const int reductionFactor); // Lower case string std::string lowerCase(const std::string& s); +template +Teuchos::RCP> importOffRankDroppingInfo( + Teuchos::RCP>& localDropMap, + Teuchos::RCP>& Ain) { + using SC = Scalar; + using LO = LocalOrdinal; + using GO = GlobalOrdinal; + using NO = Node; + using MT = typename Teuchos::ScalarTraits::magnitudeType; + + Teuchos::RCP> comm = localDropMap->getComm(); + + Teuchos::RCP> toggleVec = Xpetra::VectorFactory::Build(localDropMap); + toggleVec->putScalar(1); + + Teuchos::RCP> finalVec = Xpetra::VectorFactory::Build(Ain->getColMap(), true); + Teuchos::RCP> importer = Xpetra::ImportFactory::Build(localDropMap, Ain->getColMap()); + finalVec->doImport(*toggleVec, *importer, Xpetra::ABSMAX); + + std::vector finalDropMapEntries = {}; + auto finalVec_h_2D = finalVec->getHostLocalView(Xpetra::Access::ReadOnly); + auto finalVec_h_1D = Kokkos::subview(finalVec_h_2D, Kokkos::ALL(), 0); + const size_t localLength = finalVec->getLocalLength(); + + for (size_t k = 0; k < localLength; ++k) { + if (Teuchos::ScalarTraits::magnitude(finalVec_h_1D(k)) > Teuchos::ScalarTraits::zero()) { + finalDropMapEntries.push_back(finalVec->getMap()->getGlobalElement(k)); + } + } + + Teuchos::RCP> finalDropMap = Xpetra::MapFactory::Build( + localDropMap->lib(), Teuchos::OrdinalTraits::invalid(), finalDropMapEntries, 0, comm); + return finalDropMap; +} // importOffRankDroppingInfo + } // namespace MueLu #define MUELU_UTILITIES_SHORT diff --git a/packages/muelu/test/CMakeLists.txt b/packages/muelu/test/CMakeLists.txt index d4eaec2adfb3..637815343d2a 100644 --- a/packages/muelu/test/CMakeLists.txt +++ b/packages/muelu/test/CMakeLists.txt @@ -27,6 +27,7 @@ ENDIF() TRIBITS_ADD_TEST_DIRECTORIES(factories) TRIBITS_ADD_TEST_DIRECTORIES(maxwell) TRIBITS_ADD_TEST_DIRECTORIES(navierstokes) +TRIBITS_ADD_TEST_DIRECTORIES(contact) TRIBITS_ADD_TEST_DIRECTORIES(meshtying) if (NOT MUELU_VALGRIND_TESTING) # JJH 4Feb2014: This is failing the nightly MPI valgrind test. It runs fine diff --git a/packages/muelu/test/contact/CMakeLists.txt b/packages/muelu/test/contact/CMakeLists.txt new file mode 100644 index 000000000000..4d244f26c56f --- /dev/null +++ b/packages/muelu/test/contact/CMakeLists.txt @@ -0,0 +1,87 @@ +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../unit_tests) + +# first ensure that these cmake boolean variables are defined +ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Tpetra) + +IF (${PACKAGE_NAME}_ENABLE_Tpetra) + + TRIBITS_COPY_FILES_TO_BINARY_DIR(Contact + SOURCE_FILES + segregatedAgg_block_matrix.mm + segregatedAgg_filtered_matrix.mm + segregatedAgg_matrix.mm + segregatedAgg_nullspace.mm + segregatedAgg_interface_dof_map_MPI1.mm + segregatedAgg_interface_dof_map_MPI3.mm + ) + + TRIBITS_ADD_EXECUTABLE( + SegregatedAggFromFile + SOURCES + SegregatedAggFromFile.cpp + contact_Helpers.cpp + COMM serial mpi + ) + + TRIBITS_ADD_EXECUTABLE( + SegregatedAggFromFactory + SOURCES + SegregatedAggFromFactory.cpp + contact_Helpers.cpp + COMM serial mpi + ) + + TRIBITS_ADD_EXECUTABLE( + SegregatedAggFromFactoryBlockedA + SOURCES + SegregatedAggFromFactoryBlockedA.cpp + contact_Helpers.cpp + COMM serial mpi + ) + + TRIBITS_ADD_TEST( + SegregatedAggFromFile + NAME "UnsegregatedAggFromFile" + ARGS "--probName=segregatedAgg --nDof=54 --nDofPerNode=2" + COMM serial mpi + NUM_MPI_PROCS 1 + WILL_FAIL + ) + TRIBITS_ADD_TEST( + SegregatedAggFromFile + NAME "SegregatedAggFromFile" + ARGS "--probName=segregatedAgg_filtered --nDof=54 --nDofPerNode=2" + COMM serial mpi + NUM_MPI_PROCS 1 + ) + TRIBITS_ADD_TEST( + SegregatedAggFromFactory + NAME "SegregatedAggFromFactoryInterfaceMaps" + ARGS "--probName=segregatedAgg --nDof=54 --nDofPerNode=2" + COMM serial mpi + NUM_MPI_PROCS 1 + ) + TRIBITS_ADD_TEST( + SegregatedAggFromFactory + NAME "SegregatedAggFromFactoryInterfaceMaps" + ARGS "--probName=segregatedAgg --nDof=54 --nDofPerNode=2" + COMM serial mpi + NUM_MPI_PROCS 3 + ) + TRIBITS_ADD_TEST( + SegregatedAggFromFactoryBlockedA + NAME "SegregatedAggFromFactoryBlockedAInterfaceMaps" + ARGS "--probName=segregatedAgg --nPrimalDof=54 --nDualDof=6 --numPrimalDofPerNode=2 --numDualDofPerNode=2" + COMM serial mpi + NUM_MPI_PROCS 1 + ) + TRIBITS_ADD_TEST( + SegregatedAggFromFactoryBlockedA + NAME "SegregatedAggFromFactoryBlockedAInterfaceMaps" + ARGS "--probName=segregatedAgg --nPrimalDof=54 --nDualDof=6 --numPrimalDofPerNode=2 --numDualDofPerNode=2" + COMM serial mpi + NUM_MPI_PROCS 3 + ) + +ENDIF() \ No newline at end of file diff --git a/packages/muelu/test/contact/SegregatedAggFromFactory.cpp b/packages/muelu/test/contact/SegregatedAggFromFactory.cpp new file mode 100644 index 000000000000..49d9697bb8cc --- /dev/null +++ b/packages/muelu/test/contact/SegregatedAggFromFactory.cpp @@ -0,0 +1,237 @@ +// @HEADER +// +// *********************************************************************** +// +// MueLu: A package for multigrid based preconditioning +// Copyright 2012 Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact +// Jonathan Hu (jhu@sandia.gov) +// Ray Tuminaro (rstumin@sandia.gov) +// +// *********************************************************************** +// +// @HEADER + +// Test +#include "contact_Helpers.hpp" + +// MueLu +#include "MueLu_AmalgamationFactory.hpp" +#include "MueLu_CoalesceDropFactory.hpp" +#include "MueLu_FactoryManager.hpp" +#include "MueLu_GenericRFactory.hpp" +#include "MueLu_MapTransferFactory.hpp" +#include "MueLu_NullspaceFactory.hpp" +#include "MueLu_ParameterListInterpreter.hpp" +#include "MueLu_RAPFactory.hpp" +#include "MueLu_SegregatedAFactory.hpp" +#include "MueLu_TentativePFactory.hpp" +#include "MueLu_TestHelpers.hpp" +#include "MueLu_TransPFactory.hpp" +#include "MueLu_UncoupledAggregationFactory.hpp" + +// Teuchos +#include + +// Xpetra +#include +#include +#include + +template +int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int argc, char *argv[]) { +#include "MueLu_UseShortNames.hpp" + + // The SegregatedAFactory tests only work with real Scalar types, + if (Teuchos::ScalarTraits::isComplex) return EXIT_SUCCESS; + + using GST = Teuchos::ScalarTraits; + + using Teuchos::RCP; + using Teuchos::rcp; + + RCP> comm = Teuchos::DefaultComm::getComm(); + + std::string probName = ""; + clp.setOption("probName", &probName, "Short name of the problem. Used to read-in the problem from files."); + GO numTotalDofs = -GST::one(); + clp.setOption("nDof", &numTotalDofs, "Total number of DOFs"); + int nDofPerNode = -1; + clp.setOption("nDofPerNode", &nDofPerNode, "Number of DOFS per Node"); + + clp.recogniseAllOptions(true); + switch (clp.parse(argc, argv)) { + case Teuchos::CommandLineProcessor::PARSE_HELP_PRINTED: + return EXIT_SUCCESS; + case Teuchos::CommandLineProcessor::PARSE_ERROR: + case Teuchos::CommandLineProcessor::PARSE_UNRECOGNIZED_OPTION: + return EXIT_FAILURE; + case Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL: + break; + } + + TEUCHOS_TEST_FOR_EXCEPTION(probName == "", MueLu::Exceptions::InvalidArgument, "Please specify the problem name on the command line."); + TEUCHOS_TEST_FOR_EXCEPTION(numTotalDofs == -GST::one(), MueLu::Exceptions::InvalidArgument, "Please specify the global number of DOF on the command line."); + TEUCHOS_TEST_FOR_EXCEPTION(nDofPerNode == -1, MueLu::Exceptions::InvalidArgument, "Please specify the number of DOF per mesh node on the command line."); + + const std::string matrixFileName = probName + "_matrix.mm"; + const std::string nullspaceFileName = probName + "_nullspace.mm"; + const std::string dropMap1Name = "dropMap1"; + const std::string dropMap2Name = "dropMap2"; + const std::string droppingScheme = "map-pair"; + + std::vector stridingInfo; + stridingInfo.push_back(nDofPerNode); + TEUCHOS_ASSERT(!matrixFileName.empty()); + RCP mat = Xpetra::IO::Read(matrixFileName, lib, comm); + Xpetra::MatrixUtils::convertMatrixToStridedMaps(mat, stridingInfo, stridingInfo); + RCP rowmap = mat->getRowMap(); + TEUCHOS_ASSERT(!nullspaceFileName.empty()); + RCP nullspace = Xpetra::IO::ReadMultiVector(nullspaceFileName, rowmap); + + // Create the interface dof row maps + std::vector integration_side_map_Entries{42, 43, 44, 45, 52, 53}; + RCP dropMap1 = Xpetra::MapFactory::Build(lib, integration_side_map_Entries.size(), integration_side_map_Entries, 0, + comm); + std::vector projection_side_map_Entries{0, 1, 6, 7, 22, 23}; + RCP dropMap2 = Xpetra::MapFactory::Build(lib, projection_side_map_Entries.size(), projection_side_map_Entries, 0, + comm); + ///////////// Factories Definitions ///////////// + //// Factories: level 0 + // define segregatedAFactory that provides Matrix A to CoalesceDropFactory + RCP segregatedAFactLevelZero = RCP(new SegregatedAFactory()); + segregatedAFactLevelZero->SetFactory("A", MueLu::NoFactory::getRCP()); + segregatedAFactLevelZero->SetParameter("droppingScheme", Teuchos::ParameterEntry(droppingScheme)); + segregatedAFactLevelZero->SetFactory(dropMap1Name, MueLu::NoFactory::getRCP()); + segregatedAFactLevelZero->SetFactory(dropMap2Name, MueLu::NoFactory::getRCP()); + + // define amalgamation factory + RCP amalgFactLevelZero = RCP(new AmalgamationFactory()); + + // define CoalesceDropFactory that provides Graph + RCP dropFactLevelZero = RCP(new CoalesceDropFactory()); + dropFactLevelZero->SetFactory("UnAmalgamationInfo", amalgFactLevelZero); + dropFactLevelZero->SetFactory("A", segregatedAFactLevelZero); + + // Setup aggregation factory + RCP uncoupledAggFactLevelZero = rcp(new UncoupledAggregationFactory()); + uncoupledAggFactLevelZero->SetFactory("Graph", dropFactLevelZero); + uncoupledAggFactLevelZero->SetFactory("DofsPerNode", dropFactLevelZero); + uncoupledAggFactLevelZero->SetOrdering("graph"); + uncoupledAggFactLevelZero->SetParameter("aggregation: min agg size", Teuchos::ParameterEntry(2)); + uncoupledAggFactLevelZero->SetParameter("aggregation: max agg size", Teuchos::ParameterEntry(3)); + + // Setup TentativePFactory + RCP tentativePFactLevelZero = rcp(new TentativePFactory()); + tentativePFactLevelZero->SetFactory("A", segregatedAFactLevelZero); + tentativePFactLevelZero->SetFactory("Aggregates", uncoupledAggFactLevelZero); + + // Setup transPFact for generating R + RCP transPFactLevelZero = rcp(new TransPFactory()); + transPFactLevelZero->SetFactory("P", tentativePFactLevelZero); + + // Setup nullspace Factory + RCP nullspaceFactLevelZero = rcp(new NullspaceFactory()); + nullspaceFactLevelZero->SetParameter("Fine level nullspace", Teuchos::ParameterEntry(std::string("Nullspace"))); + nullspaceFactLevelZero->SetFactory("Nullspace", tentativePFactLevelZero); + + // Setup RAP Factory + RCP rapFactLevelZero = rcp(new RAPFactory()); + rapFactLevelZero->SetFactory("A", MueLu::NoFactory::getRCP()); + rapFactLevelZero->SetFactory("P", tentativePFactLevelZero); + rapFactLevelZero->SetFactory("R", transPFactLevelZero); + + // Main Factory manager + RCP M0 = rcp(new FactoryManager()); + M0->SetFactory("A", MueLu::NoFactory::getRCP()); + M0->SetFactory("Graph", dropFactLevelZero); + M0->SetFactory("UnAmalgamationInfo", amalgFactLevelZero); + M0->SetFactory("Nullspace", nullspaceFactLevelZero); + M0->SetFactory("P", tentativePFactLevelZero); + M0->SetFactory("R", transPFactLevelZero); + M0->SetFactory("Aggregates", uncoupledAggFactLevelZero); + M0->SetFactory(dropMap1Name, MueLu::NoFactory::getRCP()); + M0->SetFactory(dropMap2Name, MueLu::NoFactory::getRCP()); + + ///////////// Level Definition ///////////// + RCP levelZero = rcp(new Level()); + RCP levelOne = rcp(new Level()); + + levelZero->SetLevelID(0); + levelOne->SetLevelID(1); + + levelOne->SetPreviousLevel(levelZero); + + TEUCHOS_ASSERT_EQUALITY(levelZero->GetLevelID(), 0); + TEUCHOS_ASSERT_EQUALITY(levelOne->GetLevelID(), 1); + + levelZero->Set("A", mat); + levelZero->Set("Nullspace", nullspace); + levelZero->Set(dropMap1Name, dropMap1); + levelZero->Set(dropMap2Name, dropMap2); + + TEUCHOS_ASSERT(levelZero->IsAvailable("A", MueLu::NoFactory::get())); + TEUCHOS_ASSERT(levelZero->IsAvailable("Nullspace", MueLu::NoFactory::get())); + TEUCHOS_ASSERT(levelZero->IsAvailable(dropMap1Name, MueLu::NoFactory::get())); + TEUCHOS_ASSERT(levelZero->IsAvailable(dropMap2Name, MueLu::NoFactory::get())); + + levelZero->SetFactoryManager(M0); + + ///////////// Request and build level info ///////////// + levelZero->Request("Aggregates", uncoupledAggFactLevelZero.get()); + levelZero->Request(*uncoupledAggFactLevelZero); + levelOne->Request("A", rapFactLevelZero.get()); + + TEUCHOS_ASSERT(levelZero->IsRequested("Aggregates", uncoupledAggFactLevelZero.get())); + TEUCHOS_ASSERT(levelOne->IsRequested("A", rapFactLevelZero.get())); + + rapFactLevelZero->Build(*levelZero, *levelOne); + + TEUCHOS_ASSERT(levelZero->IsAvailable("Aggregates", uncoupledAggFactLevelZero.get())); + + RCP aggsLevelZero = levelZero->Get>("Aggregates", uncoupledAggFactLevelZero.get()); + MueLuTests::checkAggregatesMapPair(aggsLevelZero, stridingInfo, + levelZero->Get>(dropMap1Name, MueLu::NoFactory::get()), + levelZero->Get>(dropMap2Name, MueLu::NoFactory::get())); + + return EXIT_SUCCESS; +} + +//----------------------------------------------------------- +#define MUELU_AUTOMATIC_TEST_ETI_NAME main_ +#include "MueLu_Test_ETI.hpp" + +int main(int argc, char *argv[]) { + return Automatic_Test_ETI(argc, argv); +} \ No newline at end of file diff --git a/packages/muelu/test/contact/SegregatedAggFromFactoryBlockedA.cpp b/packages/muelu/test/contact/SegregatedAggFromFactoryBlockedA.cpp new file mode 100644 index 000000000000..343709966067 --- /dev/null +++ b/packages/muelu/test/contact/SegregatedAggFromFactoryBlockedA.cpp @@ -0,0 +1,372 @@ +// @HEADER +// +// *********************************************************************** +// +// MueLu: A package for multigrid based preconditioning +// Copyright 2012 Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact +// Jonathan Hu (jhu@sandia.gov) +// Ray Tuminaro (rstumin@sandia.gov) +// +// *********************************************************************** +// +// @HEADER + +// Test +#include "contact_Helpers.hpp" + +// MueLu +#include "MueLu_AmalgamationFactory.hpp" +#include "MueLu_BlockedCoarseMapFactory.hpp" +#include "MueLu_BlockedPFactory.hpp" +#include "MueLu_BlockedRAPFactory.hpp" +#include "MueLu_CoalesceDropFactory.hpp" +#include "MueLu_CoarseMapFactory.hpp" +#include "MueLu_CreateXpetraPreconditioner.hpp" +#include "MueLu_FactoryManager.hpp" +#include "MueLu_GenericRFactory.hpp" +#include "MueLu_InterfaceAggregationFactory.hpp" +#include "MueLu_MapTransferFactory.hpp" +#include "MueLu_NullspaceFactory.hpp" +#include "MueLu_ParameterListInterpreter.hpp" +#include "MueLu_SegregatedAFactory.hpp" +#include "MueLu_SubBlockAFactory.hpp" +#include "MueLu_TentativePFactory.hpp" +#include "MueLu_UncoupledAggregationFactory.hpp" + +// Teuchos +#include + +// Xpetra +#include +#include +#include +#include + +template +int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int argc, char *argv[]) { +#include "MueLu_UseShortNames.hpp" + + // The SegregatedAFactory tests only work with real Scalar types, + if (Teuchos::ScalarTraits::isComplex) return EXIT_SUCCESS; + + using Teuchos::Array; + using Teuchos::ArrayRCP; + using Teuchos::ParameterList; + using Teuchos::RCP; + using Teuchos::rcp; + + using ST = Teuchos::ScalarTraits; + using GST = Teuchos::ScalarTraits; + + RCP> comm = Teuchos::DefaultComm::getComm(); + auto numRanks = comm->getSize(); + + std::string probName = ""; + clp.setOption("probName", &probName, "Short name of the problem. Used to read-in the problem from files."); + GO numGlobalDofPrimal = -GST::one(); + clp.setOption("nPrimalDof", &numGlobalDofPrimal, "total number of primal Dof"); + GO numGlobalDofDual = -GST::one(); + clp.setOption("nDualDof", &numGlobalDofDual, "total number of dual Dof"); + int numPrimalDofPerNode = -1; + clp.setOption("numPrimalDofPerNode", &numPrimalDofPerNode, "number of primal Dof per mesh node"); + int numDualDofPerNode = -1; + clp.setOption("numDualDofPerNode", &numDualDofPerNode, "number of dual Dof per interface node"); + + clp.recogniseAllOptions(true); + switch (clp.parse(argc, argv)) { + case Teuchos::CommandLineProcessor::PARSE_HELP_PRINTED: + return EXIT_SUCCESS; + case Teuchos::CommandLineProcessor::PARSE_ERROR: + case Teuchos::CommandLineProcessor::PARSE_UNRECOGNIZED_OPTION: + return EXIT_FAILURE; + case Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL: + break; + } + + TEUCHOS_TEST_FOR_EXCEPTION(probName == "", MueLu::Exceptions::InvalidArgument, + "Please specify a valid problem name."); + TEUCHOS_TEST_FOR_EXCEPTION(numGlobalDofPrimal == -GST::one(), MueLu::Exceptions::InvalidArgument, + "Please specify the global number of primal Dof on the command line."); + TEUCHOS_TEST_FOR_EXCEPTION(numGlobalDofDual == -GST::one(), MueLu::Exceptions::InvalidArgument, + "Please specify the global number of dual Dof on the command line."); + TEUCHOS_TEST_FOR_EXCEPTION(numPrimalDofPerNode == -1, MueLu::Exceptions::InvalidArgument, + "Please specify the number of primal Dof per mesh node on the command line."); + TEUCHOS_TEST_FOR_EXCEPTION(numDualDofPerNode == -1, MueLu::Exceptions::InvalidArgument, + "Please specify the number of dual Dof per interface node on the command line."); + + const std::string matrixFileName = probName + "_block_matrix.mm"; + const std::string nullspace1FileName = probName + "_nullspace.mm"; + const std::string primalInterfaceMapFileName = probName + "_interface_dof_map_MPI" + std::to_string(numRanks) + ".mm"; + const std::string dropMap1Name = "dropMap1"; + const std::string dropMap2Name = "dropMap2"; + const std::string droppingScheme = "map-pair"; + + /// Rowmaps + // Primal dofmap + std::vector stridingInfoPrimal; + stridingInfoPrimal.push_back(numPrimalDofPerNode); + RCP StridedDofRowMapPrimal = StridedMapFactory::Build(lib, numGlobalDofPrimal, + Teuchos::ScalarTraits::zero(), + stridingInfoPrimal, comm, -1); + + // Dual dofmap + std::vector stridingInfoDual; + stridingInfoDual.push_back(numDualDofPerNode); + RCP StridedDofRowMapDual = StridedMapFactory::Build(lib, numGlobalDofDual, + Teuchos::ScalarTraits::zero(), + stridingInfoDual, comm, -1, numGlobalDofPrimal); + + // Construct the blocked map of the global system + std::vector> rowmaps; + rowmaps.push_back(StridedDofRowMapPrimal); + rowmaps.push_back(StridedDofRowMapDual); + RCP fullRowMap = MapUtils::concatenateMaps(rowmaps); + RCP blockedMap = rcp(new BlockedMap(fullRowMap, rowmaps)); + + /// Matrix A + // Read the matrix from file and transform it into a block matrix + RCP mat = Xpetra::IO::Read(matrixFileName, fullRowMap); + RCP rangeMapExtractor = Xpetra::MapExtractorFactory::Build(fullRowMap, rowmaps); + RCP blockedMatrix = Xpetra::MatrixUtils::SplitMatrix(*mat, rangeMapExtractor, + rangeMapExtractor); + + blockedMatrix->fillComplete(); + + /// Nullspaces + // Read the nullspace vector of the (0,0)-block from file + RCP nullspace1 = Xpetra::IO::ReadMultiVector(nullspace1FileName, StridedDofRowMapPrimal); + + // Create the default nullspace vector of the (1,1)-block + RCP nullspace2 = MultiVectorFactory::Build(StridedDofRowMapDual, 2, true); + const int dimNS = 2; + for (int dim = 0; dim < dimNS; ++dim) { + ArrayRCP nsValues = nullspace2->getDataNonConst(dim); + const int numBlocks = nsValues.size() / dimNS; + for (int j = 0; j < numBlocks; ++j) + nsValues[j * dimNS + dim] = Teuchos::ScalarTraits::one(); + } + + // Read the interface integration side dof row map from file + TEUCHOS_ASSERT(!primalInterfaceMapFileName.empty()); + RCP primalInterfaceDofMap = Xpetra::IO::ReadMap(primalInterfaceMapFileName, lib, comm); + // Create the interface projection side dof row map (for map-pair for matrix filtering in segregatedAFactory) + std::vector projection_side_map_entries{0, 1, 6, 7, 22, 23}; + RCP projection_side_map = Xpetra::MapFactory::Build(lib, projection_side_map_entries.size(), projection_side_map_entries, 0, + comm); + + ///////////// Factories Definitions ///////////// + /// Factories: level 0 + /// Block (0,0) + // define SubBlockAFactory for block (0,0) that provides Matrix A to SegregatedAFactory + RCP subBlockAFact00LevelZero = rcp(new SubBlockAFactory()); + subBlockAFact00LevelZero->SetFactory("A", MueLu::NoFactory::getRCP()); + subBlockAFact00LevelZero->SetParameter("block row", Teuchos::ParameterEntry(0)); + subBlockAFact00LevelZero->SetParameter("block col", Teuchos::ParameterEntry(0)); + + // define segregatedAFactory that provides Matrix A to CoalesceDropFactory + RCP segregatedAFactLevelZero = rcp(new SegregatedAFactory()); + segregatedAFactLevelZero->SetFactory("A", subBlockAFact00LevelZero); + segregatedAFactLevelZero->SetParameter("droppingScheme", Teuchos::ParameterEntry(droppingScheme)); + segregatedAFactLevelZero->SetFactory("dropMap1", MueLu::NoFactory::getRCP()); + segregatedAFactLevelZero->SetFactory("dropMap2", MueLu::NoFactory::getRCP()); + + // define coarse Map factory + RCP coarseMapFact00LevelZero = rcp(new CoarseMapFactory()); + + // define amalgamation factory + RCP amalgFact00LevelZero = rcp(new AmalgamationFactory()); + amalgFact00LevelZero->SetFactory("A", subBlockAFact00LevelZero); + + // define CoalesceDropFactory that provides Graph + RCP dropFact00LevelZero = rcp(new CoalesceDropFactory()); + dropFact00LevelZero->SetFactory("UnAmalgamationInfo", amalgFact00LevelZero); + dropFact00LevelZero->SetFactory("A", segregatedAFactLevelZero); + + // Setup aggregation factory + RCP uncoupledAggFactLevelZero = rcp(new UncoupledAggregationFactory()); + uncoupledAggFactLevelZero->SetFactory("Graph", dropFact00LevelZero); + uncoupledAggFactLevelZero->SetFactory("DofsPerNode", dropFact00LevelZero); + uncoupledAggFactLevelZero->SetOrdering("graph"); + uncoupledAggFactLevelZero->SetParameter("aggregation: min agg size", Teuchos::ParameterEntry(2)); + uncoupledAggFactLevelZero->SetParameter("aggregation: max agg size", Teuchos::ParameterEntry(3)); + + // Setup TentativePFactory + RCP tentativePFact00LevelZero = rcp(new TentativePFactory()); + tentativePFact00LevelZero->SetFactory("A", segregatedAFactLevelZero); + tentativePFact00LevelZero->SetFactory("Aggregates", uncoupledAggFactLevelZero); + tentativePFact00LevelZero->SetFactory("CoarseMap", coarseMapFact00LevelZero); + tentativePFact00LevelZero->SetParameter("tentative: calculate qr", Teuchos::ParameterEntry(true)); + tentativePFact00LevelZero->SetParameter("tentative: build coarse coordinates", Teuchos::ParameterEntry(false)); + + // Setup nullspace Factory + RCP nullspace1FactLevelZero = rcp(new NullspaceFactory()); + nullspace1FactLevelZero->SetParameter("Fine level nullspace", Teuchos::ParameterEntry(std::string("Nullspace1"))); + nullspace1FactLevelZero->SetFactory("Nullspace1", tentativePFact00LevelZero); + + /// Block (1,1) + // SubBlockAFact for block (1,1) + RCP subBlockAFact11LevelZero = rcp(new SubBlockAFactory()); + subBlockAFact11LevelZero->SetFactory("A", MueLu::NoFactory::getRCP()); + subBlockAFact11LevelZero->SetParameter("block row", Teuchos::ParameterEntry(1)); + subBlockAFact11LevelZero->SetParameter("block col", Teuchos::ParameterEntry(1)); + + /// Block (0,1) (off-diagonal) for InterfaceAggregationFactory + // SubBlockAFact for block (0,1) + RCP subBlockAFact01LevelZero = rcp(new SubBlockAFactory); + subBlockAFact01LevelZero->SetFactory("A", MueLu::NoFactory::getRCP()); + subBlockAFact01LevelZero->SetParameter("block row", Teuchos::ParameterEntry(0)); + subBlockAFact01LevelZero->SetParameter("block col", Teuchos::ParameterEntry(1)); + + // define BlockedCoarseMapFactory + RCP coarseMapFact01LevelZero = rcp(new BlockedCoarseMapFactory()); + + // define factory for interface aggregates + RCP interfaceAggFactLevelZero = rcp(new InterfaceAggregationFactory()); + interfaceAggFactLevelZero->SetFactory("A", subBlockAFact01LevelZero); + interfaceAggFactLevelZero->SetFactory("Aggregates", uncoupledAggFactLevelZero); + interfaceAggFactLevelZero->SetParameter("Dual/primal mapping strategy", + Teuchos::ParameterEntry(std::string("dof-based"))); + interfaceAggFactLevelZero->SetFactory("Primal interface DOF map", MueLu::NoFactory::getRCP()); + + // define tentativeP Factory + RCP tentativePFact01LevelZero = rcp(new TentativePFactory()); + tentativePFact01LevelZero->SetFactory("A", subBlockAFact11LevelZero); + tentativePFact01LevelZero->SetFactory("Aggregates", interfaceAggFactLevelZero); + tentativePFact01LevelZero->SetFactory("CoarseMap", coarseMapFact01LevelZero); + tentativePFact01LevelZero->SetFactory("UnAmalgamationInfo", interfaceAggFactLevelZero); + tentativePFact01LevelZero->SetParameter("tentative: calculate qr", Teuchos::ParameterEntry(true)); + tentativePFact01LevelZero->SetParameter("tentative: build coarse coordinates", Teuchos::ParameterEntry(false)); + + // define Factory for nullspace2 + RCP nullspace2FactLevelZero = rcp(new NullspaceFactory()); + nullspace2FactLevelZero->SetParameter("Fine level nullspace", Teuchos::ParameterEntry(std::string("Nullspace2"))); + nullspace2FactLevelZero->SetFactory("Nullspace2", tentativePFact01LevelZero); + + // define CoarseMapFact01 dependencies + coarseMapFact01LevelZero->SetFactory("Aggregates", interfaceAggFactLevelZero); + coarseMapFact01LevelZero->SetFactory("CoarseMap", coarseMapFact00LevelZero); + + /// Factory Managers + // First group + RCP M1LevelZero = rcp(new FactoryManager()); + M1LevelZero->SetFactory("A", subBlockAFact00LevelZero); + M1LevelZero->SetFactory("P", tentativePFact00LevelZero); + M1LevelZero->SetFactory("Aggregates", uncoupledAggFactLevelZero); + M1LevelZero->SetFactory("Nullspace", nullspace1FactLevelZero); + M1LevelZero->SetFactory("CoarseMap", coarseMapFact00LevelZero); + M1LevelZero->SetFactory("UnAmalgamationInfo", amalgFact00LevelZero); + + // Second group + RCP M2LevelZero = rcp(new FactoryManager()); + M2LevelZero->SetFactory("A", subBlockAFact11LevelZero); + M2LevelZero->SetFactory("P", tentativePFact01LevelZero); + M2LevelZero->SetFactory("Aggregates", interfaceAggFactLevelZero); + M2LevelZero->SetFactory("Nullspace", nullspace2FactLevelZero); + M2LevelZero->SetFactory("CoarseMap", coarseMapFact01LevelZero); + + /// Blocked Transfer Operators + RCP blockedPFactLevelZero = rcp(new BlockedPFactory); + blockedPFactLevelZero->AddFactoryManager(M1LevelZero); + blockedPFactLevelZero->AddFactoryManager(M2LevelZero); + + RCP blockedRFactLevelZero = rcp(new GenericRFactory()); + blockedRFactLevelZero->SetFactory("P", blockedPFactLevelZero); + + RCP blockedRAPFactLevelZero = rcp(new BlockedRAPFactory()); + blockedRAPFactLevelZero->SetFactory("P", blockedPFactLevelZero); + blockedRAPFactLevelZero->SetFactory("R", blockedRFactLevelZero); + + /// Main Factory Manager + RCP managerLevelZero = rcp(new FactoryManager()); + managerLevelZero->SetFactory("P", blockedPFactLevelZero); + managerLevelZero->SetFactory("R", blockedRFactLevelZero); + managerLevelZero->SetFactory("A", blockedRAPFactLevelZero); + managerLevelZero->SetFactory(dropMap1Name, MueLu::NoFactory::getRCP()); + managerLevelZero->SetFactory(dropMap2Name, MueLu::NoFactory::getRCP()); + managerLevelZero->SetKokkosRefactor(false); + + ///////////// Level Definition ///////////// + RCP levelZero = rcp(new Level()); + RCP levelOne = rcp(new Level()); + + levelZero->SetLevelID(0); + levelOne->SetLevelID(1); + levelOne->SetPreviousLevel(levelZero); + + TEUCHOS_ASSERT_EQUALITY(levelZero->GetLevelID(), 0); + TEUCHOS_ASSERT_EQUALITY(levelOne->GetLevelID(), 1); + + levelZero->Set("A", Teuchos::rcp_dynamic_cast(blockedMatrix)); + levelZero->Set("Nullspace1", nullspace1); + levelZero->Set("Nullspace2", nullspace2); + levelZero->Set("Primal interface DOF map", primalInterfaceDofMap); + levelZero->Set(dropMap1Name, primalInterfaceDofMap); + levelZero->Set(dropMap2Name, projection_side_map); + + TEUCHOS_ASSERT(levelZero->IsAvailable("A", MueLu::NoFactory::get())); + TEUCHOS_ASSERT(levelZero->IsAvailable("Nullspace1", MueLu::NoFactory::get())); + TEUCHOS_ASSERT(levelZero->IsAvailable("Nullspace2", MueLu::NoFactory::get())); + TEUCHOS_ASSERT(levelZero->IsAvailable("Primal interface DOF map", MueLu::NoFactory::get())); + TEUCHOS_ASSERT(levelZero->IsAvailable(dropMap1Name, MueLu::NoFactory::get())); + TEUCHOS_ASSERT(levelZero->IsAvailable(dropMap2Name, MueLu::NoFactory::get())); + + levelZero->SetFactoryManager(managerLevelZero); + + ///////////// Request and build level info ///////////// + // Check level 0 + levelZero->Request("Aggregates", uncoupledAggFactLevelZero.get()); + levelOne->Request("A", blockedRAPFactLevelZero.get()); + levelOne->Request("P", blockedPFactLevelZero.get()); + TEUCHOS_ASSERT(levelZero->IsRequested("Aggregates", uncoupledAggFactLevelZero.get())); + TEUCHOS_ASSERT(levelOne->IsRequested("A", blockedRAPFactLevelZero.get())); + TEUCHOS_ASSERT(levelOne->IsRequested("P", blockedPFactLevelZero.get())); + blockedRAPFactLevelZero->Build(*levelZero, *levelOne); + + TEUCHOS_ASSERT(levelZero->IsAvailable("Aggregates", uncoupledAggFactLevelZero.get())); + RCP primalAggsLevelZero = levelZero->Get>("Aggregates", uncoupledAggFactLevelZero.get()); + MueLuTests::checkAggregatesMapPair(primalAggsLevelZero, stridingInfoPrimal, + levelZero->Get>(dropMap1Name, MueLu::NoFactory::get()), + levelZero->Get>(dropMap2Name, MueLu::NoFactory::get())); + + return EXIT_SUCCESS; +} + +//----------------------------------------------------------- +#define MUELU_AUTOMATIC_TEST_ETI_NAME main_ +#include "MueLu_Test_ETI.hpp" + +int main(int argc, char *argv[]) { + return Automatic_Test_ETI(argc, argv); +} \ No newline at end of file diff --git a/packages/muelu/test/contact/SegregatedAggFromFile.cpp b/packages/muelu/test/contact/SegregatedAggFromFile.cpp new file mode 100644 index 000000000000..86af3488c782 --- /dev/null +++ b/packages/muelu/test/contact/SegregatedAggFromFile.cpp @@ -0,0 +1,162 @@ +// @HEADER +// +// *********************************************************************** +// +// MueLu: A package for multigrid based preconditioning +// Copyright 2012 Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact +// Jonathan Hu (jhu@sandia.gov) +// Ray Tuminaro (rstumin@sandia.gov) +// +// *********************************************************************** +// +// @HEADER + +// Test +#include "contact_Helpers.hpp" + +// MueLu +#include "MueLu_Aggregates.hpp" +#include "MueLu_AmalgamationFactory.hpp" +#include "MueLu_CoalesceDropFactory.hpp" +#include "MueLu_CreateXpetraPreconditioner.hpp" +#include "MueLu_Hierarchy.hpp" +#include "MueLu_ParameterListInterpreter.hpp" +#include "MueLu_TestHelpers.hpp" +#include "MueLu_UncoupledAggregationFactory.hpp" + +// Teuchos +#include + +// Xpetra +#include +#include + +template +int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int argc, char *argv[]) { +#include "MueLu_UseShortNames.hpp" + + // The SegregatedAFactory tests only work with real Scalar types, + if (Teuchos::ScalarTraits::isComplex) return EXIT_SUCCESS; + + using GST = Teuchos::ScalarTraits; + + using Teuchos::RCP; + using Teuchos::rcp; + + RCP> comm = Teuchos::DefaultComm::getComm(); + + std::string probName = ""; + clp.setOption("probName", &probName, "Short name of the problem. Used to read-in the problem from files."); + GO numTotalDofs = -GST::one(); + clp.setOption("nDof", &numTotalDofs, "Total number of DOFs"); + int nDofPerNode = -1; + clp.setOption("nDofPerNode", &nDofPerNode, "Number of DOFS per Node"); + + switch (clp.parse(argc, argv)) { + case Teuchos::CommandLineProcessor::PARSE_HELP_PRINTED: return EXIT_SUCCESS; + case Teuchos::CommandLineProcessor::PARSE_ERROR: + case Teuchos::CommandLineProcessor::PARSE_UNRECOGNIZED_OPTION: return EXIT_FAILURE; + case Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL: break; + } + + TEUCHOS_TEST_FOR_EXCEPTION(probName == "", MueLu::Exceptions::InvalidArgument, "Please specify a valid problem name."); + TEUCHOS_TEST_FOR_EXCEPTION(numTotalDofs == -GST::one(), MueLu::Exceptions::InvalidArgument, + "Please specify the global number of DOFs on the command line."); + + std::vector stridingInfo; + stridingInfo.push_back(nDofPerNode); + + // Create the solid block dof row map + std::string map1Name = "blockmap"; + std::vector blockmapEntries{30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53}; + RCP blockmap = Xpetra::MapFactory::Build(lib, blockmapEntries.size(), blockmapEntries, 30, comm); + + // Create the interface dof row maps + std::vector integration_side_map_entries{42, 43, 44, 45, 52, 53}; + RCP integration_side_map = Xpetra::MapFactory::Build(lib, integration_side_map_entries.size(), integration_side_map_entries, 0, + comm); + std::vector projection_side_map_entries{0, 1, 6, 7, 22, 23}; + RCP projection_side_map = Xpetra::MapFactory::Build(lib, projection_side_map_entries.size(), projection_side_map_entries, 0, + comm); + + // Read the matrix from file + const std::string matrixFileName = probName + "_matrix.mm"; + TEUCHOS_ASSERT(!matrixFileName.empty()); + RCP mat = Xpetra::IO::Read(matrixFileName, lib, comm); + Xpetra::MatrixUtils::convertMatrixToStridedMaps(mat, stridingInfo, stridingInfo); + + // define amalgamation factory + RCP amalgFact = RCP(new AmalgamationFactory()); + + // define CoalesceDropFactory that provides Graph + RCP dropFact = RCP(new CoalesceDropFactory()); + dropFact->SetFactory("UnAmalgamationInfo", amalgFact); + + // Setup aggregation factory + RCP uncoupledAggFact = rcp(new UncoupledAggregationFactory()); + uncoupledAggFact->SetFactory("Graph", dropFact); + uncoupledAggFact->SetOrdering("graph"); + + RCP M = rcp(new FactoryManager()); + RCP level = rcp(new MueLu::Level()); + level->SetLevelID(0); + TEUCHOS_ASSERT_EQUALITY(level->GetLevelID(), 0); + level->Set("A", mat); + TEUCHOS_ASSERT(level->IsAvailable("A", MueLu::NoFactory::get())); + level->SetFactoryManager(M); + + level->Request("Aggregates", uncoupledAggFact.get()); + level->Request(*uncoupledAggFact); + uncoupledAggFact->Build(*level); + RCP aggregates = level->Get>("Aggregates", uncoupledAggFact.get()); + + typename Aggregates::LO_view aggPtr; + typename Aggregates::LO_view aggNodes; + typename Aggregates::LO_view unaggregated; + + aggregates->ComputeNodesInAggregate(aggPtr, aggNodes, unaggregated); + + MueLuTests::checkAggregatesBlockmap(aggregates, stridingInfo, blockmap); + MueLuTests::checkAggregatesMapPair(aggregates, stridingInfo, integration_side_map, projection_side_map); + return EXIT_SUCCESS; +} + +//----------------------------------------------------------- +#define MUELU_AUTOMATIC_TEST_ETI_NAME main_ +#include "MueLu_Test_ETI.hpp" + +int main(int argc, char *argv[]) { + return Automatic_Test_ETI(argc, argv); +} diff --git a/packages/muelu/test/contact/contact_Helpers.cpp b/packages/muelu/test/contact/contact_Helpers.cpp new file mode 100644 index 000000000000..6d11315f767d --- /dev/null +++ b/packages/muelu/test/contact/contact_Helpers.cpp @@ -0,0 +1,48 @@ +// @HEADER +// +// *********************************************************************** +// +// MueLu: A package for multigrid based preconditioning +// Copyright 2014 Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact +// Jonathan Hu (jhu@sandia.gov) +// Andrey Prokopenko (aprokop@sandia.gov) +// Ray Tuminaro (rstumin@sandia.gov) +// +// *********************************************************************** +// +// @HEADER + +// the concrete implementation is in the .h file +#include "contact_Helpers.hpp" \ No newline at end of file diff --git a/packages/muelu/test/contact/contact_Helpers.hpp b/packages/muelu/test/contact/contact_Helpers.hpp new file mode 100644 index 000000000000..b19dfd0d27c2 --- /dev/null +++ b/packages/muelu/test/contact/contact_Helpers.hpp @@ -0,0 +1,192 @@ +// @HEADER +// +// *********************************************************************** +// +// MueLu: A package for multigrid based preconditioning +// Copyright 2014 Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact +// Jonathan Hu (jhu@sandia.gov) +// Andrey Prokopenko (aprokop@sandia.gov) +// Ray Tuminaro (rstumin@sandia.gov) +// +// *********************************************************************** +// +// @HEADER + +#ifndef MUELUTESTS_CONTACT_HELPERS_HPP_ +#define MUELUTESTS_CONTACT_HELPERS_HPP_ + +// MueLu +#include "MueLu_UncoupledAggregationFactory.hpp" +#include "MueLu_SegregatedAFactory.hpp" + +// Xpetra +#include +#include +#include + +namespace MueLuTests { + +template +Teuchos::RCP> createRedundantMaps( + Teuchos::RCP> localDropMap) { +#include "MueLu_UseShortNames.hpp" + + Teuchos::RCP> comm = localDropMap->getComm(); + + Teuchos::Array 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 + Teuchos::Array partialDropMapGIDList(GIDListSize, -Teuchos::ScalarTraits::one()); + Teuchos::Array redundantDropMapGIDList(GIDListSize, -Teuchos::ScalarTraits::one()); + + for (GO gid : localDropMapGIDList) { + partialDropMapGIDList[gid] = gid; + } + + Teuchos::reduceAll(*comm, Teuchos::REDUCE_MAX, GIDListSize, &partialDropMapGIDList[0], + &redundantDropMapGIDList[0]); + redundantDropMapGIDList.erase(std::remove(redundantDropMapGIDList.begin(), redundantDropMapGIDList.end(), -1), + redundantDropMapGIDList.end()); + Teuchos::RCP redundantDropMap = MapFactory::Build( + localDropMap->lib(), Teuchos::OrdinalTraits::invalid(), redundantDropMapGIDList, 0, comm); + + return redundantDropMap; +} + +template +void checkAggregatesBlockmap(Teuchos::RCP> aggregates, + std::vector &stridingInfo, + Teuchos::RCP> blockmap) { +#include "MueLu_UseShortNames.hpp" + + // Lists of nodes in each aggregate + struct { + // GH: For now, copy everything to host until we properly set this factory to run device code + // Instead, we'll copy data into HostMirrors and run the algorithms on host, saving optimization for later. + typename Aggregates::LO_view ptr, nodes, unaggregated; + typename Aggregates::LO_view::HostMirror ptr_h, nodes_h, unaggregated_h; + } nodesInAgg; + aggregates->ComputeNodesInAggregate(nodesInAgg.ptr, nodesInAgg.nodes, nodesInAgg.unaggregated); + nodesInAgg.ptr_h = Kokkos::create_mirror_view(nodesInAgg.ptr); + nodesInAgg.nodes_h = Kokkos::create_mirror_view(nodesInAgg.nodes); + nodesInAgg.unaggregated_h = Kokkos::create_mirror_view(nodesInAgg.unaggregated); + Kokkos::deep_copy(nodesInAgg.ptr_h, nodesInAgg.ptr); + Kokkos::deep_copy(nodesInAgg.nodes_h, nodesInAgg.nodes); + Kokkos::deep_copy(nodesInAgg.unaggregated_h, nodesInAgg.unaggregated); + + // Create redundant maps to be absolutely sure no entry is missed during the check + Teuchos::RCP> blockmap_final; + blockmap_final = MueLuTests::createRedundantMaps(blockmap); + + // Loop over all aggregates + for (LO aggregate = 0; aggregate < (LO)nodesInAgg.ptr_h.extent(0) - 1; aggregate++) { + bool aggContainsNodesInBlockmap = false; + bool aggContainsNodesNotInBlockmap = false; + // Loop over all nodes contained in the aggregate + for (LO nodeIter = nodesInAgg.ptr_h[aggregate]; nodeIter < (LO)nodesInAgg.ptr_h[aggregate + 1]; nodeIter++) { + LO node = nodesInAgg.nodes_h[nodeIter]; + // Loop over all node dofs + for (LO i = 0; i < (LO)stridingInfo[0]; i++) { + // Check if dof is contained in rowmap (inner + interface dofs) of one of the bodies in contact + if (blockmap_final->isNodeGlobalElement(node * stridingInfo[0] + i)) { + aggContainsNodesInBlockmap = true; + } else { + aggContainsNodesNotInBlockmap = true; + } + } + } + // Aggregates must not cross from one solid body to next and respect contact interface + TEUCHOS_TEST_FOR_EXCEPTION(aggContainsNodesInBlockmap == aggContainsNodesNotInBlockmap, + MueLu::Exceptions::RuntimeError, + "Aggregate " << aggregate << " crosses contact interface! Not allowed. Error in segregated aggregation procedure. \n") + } +} + +template +void checkAggregatesMapPair(Teuchos::RCP> aggregates, + std::vector &stridingInfo, + Teuchos::RCP> integration_side_map, + Teuchos::RCP> projection_side_map) { +#include "MueLu_UseShortNames.hpp" + + // Lists of nodes in each aggregate + struct { + // GH: For now, copy everything to host until we properly set this factory to run device code + // Instead, we'll copy data into HostMirrors and run the algorithms on host, saving optimization for later. + typename Aggregates::LO_view ptr, nodes, unaggregated; + typename Aggregates::LO_view::HostMirror ptr_h, nodes_h, unaggregated_h; + } nodesInAgg; + aggregates->ComputeNodesInAggregate(nodesInAgg.ptr, nodesInAgg.nodes, nodesInAgg.unaggregated); + nodesInAgg.ptr_h = Kokkos::create_mirror_view(nodesInAgg.ptr); + nodesInAgg.nodes_h = Kokkos::create_mirror_view(nodesInAgg.nodes); + nodesInAgg.unaggregated_h = Kokkos::create_mirror_view(nodesInAgg.unaggregated); + Kokkos::deep_copy(nodesInAgg.ptr_h, nodesInAgg.ptr); + Kokkos::deep_copy(nodesInAgg.nodes_h, nodesInAgg.nodes); + Kokkos::deep_copy(nodesInAgg.unaggregated_h, nodesInAgg.unaggregated); + + // Create redundant maps to be absolutely sure no entry is missed during the check + Teuchos::RCP> integration_side_map_final; + Teuchos::RCP> projection_side_map_final; + integration_side_map_final = MueLuTests::createRedundantMaps(integration_side_map); + projection_side_map_final = MueLuTests::createRedundantMaps(projection_side_map); + + // Loop over all aggregates + for (LO aggregate = 0; aggregate < (LO)nodesInAgg.ptr_h.extent(0) - 1; aggregate++) { + bool aggContainsNodesInIntegrationSideMap = false; + bool aggContainsNodesInProjectionSideMap = false; + // Loop over all nodes contained in the aggregate + for (LO nodeIter = nodesInAgg.ptr_h[aggregate]; nodeIter < (LO)nodesInAgg.ptr_h[aggregate + 1]; nodeIter++) { + LO node = nodesInAgg.nodes_h[nodeIter]; + // Loop over all node dofs + for (LO i = 0; i < (LO)stridingInfo[0]; i++) { + // Check if dof is contained in interface mapping of one of the bodies in contact + if (integration_side_map_final->isNodeGlobalElement(node * stridingInfo[0] + i)) { + aggContainsNodesInIntegrationSideMap = true; + } + if (projection_side_map_final->isNodeGlobalElement(node * stridingInfo[0] + i)) { + aggContainsNodesInProjectionSideMap = true; + } + } + } + // Aggregates must not cross from one solid body to next and respect contact interface + TEUCHOS_TEST_FOR_EXCEPTION((aggContainsNodesInIntegrationSideMap == true) && (aggContainsNodesInProjectionSideMap == true), + MueLu::Exceptions::RuntimeError, + "Aggregate " << aggregate << " crosses contact interface! Not allowed. Error in segregated aggregation procedure. \n") + } +} +} // namespace MueLuTests + +#endif \ No newline at end of file diff --git a/packages/muelu/test/contact/segregatedAgg_block_matrix.mm b/packages/muelu/test/contact/segregatedAgg_block_matrix.mm new file mode 100644 index 000000000000..d01b38245804 --- /dev/null +++ b/packages/muelu/test/contact/segregatedAgg_block_matrix.mm @@ -0,0 +1,788 @@ +%%MatrixMarket matrix coordinate real general +60 60 786 +1 1 3.9355998445760335e-02 +1 2 -6.6217411268370231e-03 +1 3 -1.2113700654891170e-03 +1 4 1.3145547034061459e-02 +1 5 -2.5077235601440571e-02 +1 6 6.4846996643310477e-03 +1 7 -1.3519866114223152e-02 +1 8 -1.3267352601446115e-02 +1 43 5.4060479659357244e-04 +1 44 3.0305931202838918e-04 +1 45 -8.3131460008999101e-05 +1 46 -4.4212284133935919e-05 +1 53 -7.3107450914960117e-13 +1 54 1.9961659852712512e-12 +2 1 -6.2370412231028231e-03 +2 2 1.8989972915320119e-02 +2 3 8.2229716707665906e-03 +2 4 -1.3867109382451961e-02 +2 5 6.4486511360615515e-03 +2 6 -4.0936982837841539e-03 +2 7 -7.6209190947193308e-03 +2 8 -5.6381162870946665e-04 +2 43 -9.6479752027229832e-04 +2 44 -5.4084981093573982e-04 +2 45 1.5113502917368731e-04 +2 46 8.0496194065388782e-05 +2 53 2.0926174161857102e-12 +2 54 -3.5041816724506636e-12 +3 1 -1.2113700654891161e-03 +3 2 8.2229716707665889e-03 +3 3 5.8022580586178589e-02 +3 4 -5.9143872533751803e-04 +3 5 -2.6278988860522788e-02 +3 6 -2.1103190351755834e-02 +3 7 -3.9343984368285859e-03 +3 8 -6.1472964761675039e-03 +3 9 -1.4126605061381338e-03 +3 10 1.3241319059742648e-02 +3 11 -2.5175162717200005e-02 +3 12 6.3776348227516117e-03 +4 1 1.3145547034061457e-02 +4 2 -1.3867109382451960e-02 +4 3 -5.9143872533751803e-04 +4 4 5.8914367804639989e-02 +4 5 -2.1108234822120476e-02 +4 6 -1.5333219378710261e-03 +4 7 -6.1304858998971279e-03 +4 8 -2.5539066709480768e-02 +4 9 8.3097636011386679e-03 +4 10 -1.3898168607537587e-02 +4 11 6.3748488121549958e-03 +4 12 -4.0667011672986574e-03 +5 1 -2.5077235601440571e-02 +5 2 6.4486511360615549e-03 +5 3 -2.6278988860522788e-02 +5 4 -2.1108234822120476e-02 +5 5 1.1613450414430548e-01 +5 6 -2.0091177468485157e-03 +5 7 -3.0072603842100716e-03 +5 8 2.1745474651479475e-02 +5 9 -3.8439049157624147e-03 +5 10 -5.9708659069212791e-03 +5 11 -2.9256030833808813e-03 +5 12 2.1617335898069717e-02 +5 21 -2.5997839841640738e-02 +5 22 -2.1265513186428345e-02 +5 23 -3.7392828588409636e-03 +5 24 -5.8347877161910771e-03 +5 25 -2.5244388598507139e-02 +5 26 6.3770576928989563e-03 +6 1 6.4846996643310459e-03 +6 2 -4.0936982837841539e-03 +6 3 -2.1103190351755827e-02 +6 4 -1.5333219378710237e-03 +6 5 -2.0091177468485174e-03 +6 6 1.1845443614756376e-01 +6 7 2.1745474894287235e-02 +6 8 -2.8116802528474184e-02 +6 9 -5.9785284114964362e-03 +6 10 -2.5478901038565337e-02 +6 11 2.1617335645529548e-02 +6 12 -2.7887173242600104e-02 +6 21 -2.1270557660439914e-02 +6 22 -1.8144668581272945e-03 +6 23 -5.8708358924890675e-03 +6 24 -2.5431653024667416e-02 +6 25 6.3847198588819227e-03 +6 26 -4.0784192334742519e-03 +7 1 -1.3062392778830643e-02 +7 2 -8.0498816799911260e-03 +7 3 -3.9343984368285850e-03 +7 4 -6.1304858998971271e-03 +7 5 -3.0072603842100699e-03 +7 6 2.1745474894287235e-02 +7 7 5.8773579274077184e-02 +7 8 -6.1591084575692229e-04 +7 21 -2.5454330521381803e-02 +7 22 6.2772580638053715e-03 +7 23 -1.3318862672996677e-02 +7 24 -1.3245134996352145e-02 +7 43 2.1580102000878969e-04 +7 44 1.1890730893478004e-04 +7 45 1.4429369138620977e-05 +7 46 3.0665655522862641e-05 +7 53 -2.1656486943780298e-04 +7 54 -1.3089250055292460e-04 +8 1 -1.3393205475289698e-02 +8 2 -1.0241652490840004e-03 +8 3 -6.1472964761675039e-03 +8 4 -2.5539066709480765e-02 +8 5 2.1745474651479472e-02 +8 6 -2.8116802528474184e-02 +8 7 -6.1591420420523536e-04 +8 8 5.9484769356968024e-02 +8 21 6.2940682949179580e-03 +8 22 -4.0191366811148585e-03 +8 23 -7.9018070420933013e-03 +8 24 -7.6769322131670591e-04 +8 43 -3.8052409400212410e-04 +8 44 -2.0964787571395012e-04 +8 45 3.0674729370199719e-05 +8 46 -2.0975082675441425e-05 +8 53 3.6852961599022506e-04 +8 54 2.2271799089190026e-04 +9 3 -1.4126605061381334e-03 +9 4 8.3097636011386714e-03 +9 5 -3.8439049157624151e-03 +9 6 -5.9785284114964379e-03 +9 9 5.8137778283792178e-02 +9 10 -7.7711297573056573e-04 +9 11 -2.6177577793749299e-02 +9 12 -2.1199122535524764e-02 +9 13 -1.4384231730872579e-03 +9 14 1.3272673868735011e-02 +9 15 -2.5255211895055089e-02 +9 16 6.3723264528780877e-03 +10 3 1.3241319059742648e-02 +10 4 -1.3898168607537587e-02 +10 5 -5.9708659069212782e-03 +10 6 -2.5478901038565337e-02 +10 9 -7.7711297573056486e-04 +10 10 5.9039350220667697e-02 +10 11 -2.1197285070010653e-02 +10 12 -1.7123418581105748e-03 +10 13 8.3347572430902891e-03 +10 14 -1.3875121720367943e-02 +10 15 6.3691876498295653e-03 +10 16 -4.0648169960862532e-03 +11 3 -2.5175162717200005e-02 +11 4 6.3748488121549993e-03 +11 5 -2.9256030833808787e-03 +11 6 2.1617335645529548e-02 +11 9 -2.6177577793749296e-02 +11 10 -2.1197285070010657e-02 +11 11 1.1622668039616646e-01 +11 12 -1.6960097516001103e-03 +11 13 -3.8230122373485781e-03 +11 14 -5.9585041693776038e-03 +11 15 -2.8913243517555156e-03 +11 16 2.1621026432065017e-02 +11 21 -3.8218327197703421e-03 +11 22 -5.9507259249215226e-03 +11 25 -2.6186844693891841e-02 +11 26 -2.1193773398157957e-02 +11 27 -2.5205322799070003e-02 +11 28 6.3830874243182966e-03 +12 3 6.3776348227516108e-03 +12 4 -4.0667011672986565e-03 +12 5 2.1617335898069717e-02 +12 6 -2.7887173242600101e-02 +12 9 -2.1199122535524771e-02 +12 10 -1.7123418581105735e-03 +12 11 -1.6960097516001112e-03 +12 12 1.1818506612838978e-01 +12 13 -5.9620018455725345e-03 +12 14 -2.5450453939206620e-02 +12 15 2.1621026218552376e-02 +12 16 -2.7857146642271520e-02 +12 21 -5.9535115867432120e-03 +12 22 -2.5420033377781558e-02 +12 25 -2.1191935989308207e-02 +12 26 -1.7030710656887719e-03 +12 27 6.3865847693751450e-03 +12 28 -4.0681448354319485e-03 +13 9 -1.4384231730872579e-03 +13 10 8.3347572430902891e-03 +13 11 -3.8230122373485798e-03 +13 12 -5.9620018455725345e-03 +13 13 5.8165113095047224e-02 +13 14 -7.1461463051570532e-04 +13 15 -2.6181165558134992e-02 +13 16 -2.1293419222697212e-02 +13 17 -1.3772383364941219e-03 +13 18 1.3344598015393750e-02 +13 19 -2.5335273789982269e-02 +13 20 6.2906804403014150e-03 +14 9 1.3272673868735010e-02 +14 10 -1.3875121720367938e-02 +14 11 -5.9585041693776056e-03 +14 12 -2.5450453939206627e-02 +14 13 -7.1461463051570879e-04 +14 14 5.8970001487552090e-02 +14 15 -2.1281035623679681e-02 +14 16 -1.7616328558158220e-03 +14 17 8.3692538615121135e-03 +14 18 -1.3899792192516072e-02 +14 19 6.3122266933258661e-03 +14 20 -3.9730007796456119e-03 +15 9 -2.5255211895055089e-02 +15 10 6.3691876498295618e-03 +15 11 -2.8913243517555138e-03 +15 12 2.1621026218552379e-02 +15 13 -2.6181165558134992e-02 +15 14 -2.1281035623679681e-02 +15 15 1.1642454467404274e-01 +15 16 -1.5991094477781163e-03 +15 17 -3.8294068542793925e-03 +15 18 -6.0068214586022160e-03 +15 19 -2.6950306264191836e-03 +15 20 2.1673238425948586e-02 +15 25 -3.8451800015850382e-03 +15 26 -5.9887665668930832e-03 +15 27 -2.6301800047903088e-02 +15 28 -2.1223771866734329e-02 +15 29 -2.5405425338910447e-02 +15 30 6.4360526693569061e-03 +16 9 6.3723264528780877e-03 +16 10 -4.0648169960862540e-03 +16 11 2.1621026432065010e-02 +16 12 -2.7857146642271527e-02 +16 13 -2.1293419222697216e-02 +16 14 -1.7616328558158235e-03 +16 15 -1.5991094477781145e-03 +16 16 1.1827103906193916e-01 +16 17 -6.0208694509802192e-03 +16 18 -2.5653239868529062e-02 +16 19 2.1673238106943864e-02 +16 20 -2.7721134266473824e-02 +16 25 -5.9919050495750650e-03 +16 26 -2.5474851135560375e-02 +16 27 -2.1211388288066353e-02 +16 28 -1.6409944746474385e-03 +16 29 6.4501004672100149e-03 +16 30 -4.0772228225549037e-03 +17 13 0.0000000000000000e+00 +17 14 0.0000000000000000e+00 +17 15 0.0000000000000000e+00 +17 16 0.0000000000000000e+00 +17 17 1.0000000000000000e+00 +17 18 0.0000000000000000e+00 +17 19 0.0000000000000000e+00 +17 20 0.0000000000000000e+00 +18 13 0.0000000000000000e+00 +18 14 0.0000000000000000e+00 +18 15 0.0000000000000000e+00 +18 16 0.0000000000000000e+00 +18 17 0.0000000000000000e+00 +18 18 1.0000000000000000e+00 +18 19 0.0000000000000000e+00 +18 20 0.0000000000000000e+00 +19 13 0.0000000000000000e+00 +19 14 0.0000000000000000e+00 +19 15 0.0000000000000000e+00 +19 16 0.0000000000000000e+00 +19 17 0.0000000000000000e+00 +19 18 0.0000000000000000e+00 +19 19 1.0000000000000000e+00 +19 20 0.0000000000000000e+00 +19 27 0.0000000000000000e+00 +19 28 0.0000000000000000e+00 +19 29 0.0000000000000000e+00 +19 30 0.0000000000000000e+00 +20 13 0.0000000000000000e+00 +20 14 0.0000000000000000e+00 +20 15 0.0000000000000000e+00 +20 16 0.0000000000000000e+00 +20 17 0.0000000000000000e+00 +20 18 0.0000000000000000e+00 +20 19 0.0000000000000000e+00 +20 20 1.0000000000000000e+00 +20 27 0.0000000000000000e+00 +20 28 0.0000000000000000e+00 +20 29 0.0000000000000000e+00 +20 30 0.0000000000000000e+00 +21 5 -2.5997839841640745e-02 +21 6 -2.1270557660439920e-02 +21 7 -2.5454330521381803e-02 +21 8 6.2940682949179563e-03 +21 11 -3.8218327197703417e-03 +21 12 -5.9535115867432138e-03 +21 21 5.8179221735473116e-02 +21 22 -6.8188299544651772e-04 +21 23 -1.4503252814462070e-03 +21 24 1.3283509826310262e-02 +21 25 -1.4448933712340221e-03 +21 26 8.3283741214014422e-03 +22 5 -2.1265513186428345e-02 +22 6 -1.8144668581272947e-03 +22 7 6.2772580638053707e-03 +22 8 -4.0191366811148585e-03 +22 11 -5.9507259249215218e-03 +22 12 -2.5420033377781554e-02 +22 21 -6.8188299544651772e-04 +22 22 5.8757741279628357e-02 +22 23 8.3609335230783333e-03 +22 24 -1.3628161435034539e-02 +22 25 1.3259930519912684e-02 +22 26 -1.3865942927570100e-02 +23 5 -3.7392828588409645e-03 +23 6 -5.8708358924890666e-03 +23 7 -1.2847723817438801e-02 +23 8 -8.0089830230299121e-03 +23 21 -1.4503252814462065e-03 +23 22 8.3609335230783333e-03 +23 23 1.8513470813283851e-02 +23 24 5.7964128862329619e-03 +23 43 1.2354251508632754e-12 +23 44 -2.2145893254727973e-12 +23 45 8.5889634883301182e-05 +23 46 5.3552331326622176e-05 +23 53 -5.5702849167660155e-04 +23 54 -3.3107982290435004e-04 +24 5 -5.8347877161910779e-03 +24 6 -2.5431653024667423e-02 +24 7 -1.3655413759261529e-02 +24 8 -1.2359518091833140e-03 +24 21 1.3283509826310262e-02 +24 22 -1.3628161435034543e-02 +24 23 5.4117094115040312e-03 +24 24 3.9832507681018689e-02 +24 43 -2.1097424978699106e-12 +24 44 3.7818666811741314e-12 +24 45 -1.4179834261133546e-04 +24 46 -8.8524925394847104e-05 +24 53 9.3678058235939347e-04 +24 54 5.5678350947959050e-04 +25 5 -2.5244388598507139e-02 +25 6 6.3847198588819244e-03 +25 11 -2.6186844693891841e-02 +25 12 -2.1191935989308207e-02 +25 15 -3.8451800015850378e-03 +25 16 -5.9919050495750633e-03 +25 21 -1.4448933712340221e-03 +25 22 1.3259930519912682e-02 +25 25 5.8140959313937340e-02 +25 26 -7.7895665715595284e-04 +25 27 -1.4096526487193278e-03 +25 28 8.3181473172446192e-03 +26 5 6.3770576928989554e-03 +26 6 -4.0784192334742519e-03 +26 11 -2.1193773398157950e-02 +26 12 -1.7030710656887713e-03 +26 15 -5.9887665668930824e-03 +26 16 -2.5474851135560382e-02 +26 21 8.3283741214014405e-03 +26 22 -1.3865942927570096e-02 +26 25 -7.7895665715595110e-04 +26 26 5.9036183418702190e-02 +26 27 1.3256064807906592e-02 +26 28 -1.3903899056408675e-02 +27 11 -2.5205322799070000e-02 +27 12 6.3865847693751476e-03 +27 15 -2.6301800047903084e-02 +27 16 -2.1211388288066346e-02 +27 19 -3.8563502818067664e-03 +27 20 -6.0886368313633815e-03 +27 25 -1.4096526487193284e-03 +27 26 1.3256064807906592e-02 +27 27 5.8149906314400944e-02 +27 28 -7.0584141545410560e-04 +27 29 -1.3667805369017327e-03 +27 30 8.3632169576020893e-03 +28 11 6.3830874243182966e-03 +28 12 -4.0681448354319494e-03 +28 15 -2.1223771866734333e-02 +28 16 -1.6409944746474416e-03 +28 19 -6.1101834370624443e-03 +28 20 -2.5451926858709995e-02 +28 25 8.3181473172446192e-03 +28 26 -1.3903899056408677e-02 +28 27 -7.0584141545410560e-04 +28 28 5.8985220878708930e-02 +28 29 1.3338561977687971e-02 +28 30 -1.3910255653510900e-02 +29 15 0.0000000000000000e+00 +29 16 0.0000000000000000e+00 +29 19 0.0000000000000000e+00 +29 20 0.0000000000000000e+00 +29 27 0.0000000000000000e+00 +29 28 0.0000000000000000e+00 +29 29 1.0000000000000000e+00 +29 30 0.0000000000000000e+00 +30 15 0.0000000000000000e+00 +30 16 0.0000000000000000e+00 +30 19 0.0000000000000000e+00 +30 20 0.0000000000000000e+00 +30 27 0.0000000000000000e+00 +30 28 0.0000000000000000e+00 +30 29 0.0000000000000000e+00 +30 30 1.0000000000000000e+00 +31 31 1.0000000000000000e+00 +31 32 0.0000000000000000e+00 +31 33 0.0000000000000000e+00 +31 34 0.0000000000000000e+00 +31 35 0.0000000000000000e+00 +31 36 0.0000000000000000e+00 +31 37 0.0000000000000000e+00 +31 38 0.0000000000000000e+00 +32 31 0.0000000000000000e+00 +32 32 1.0000000000000000e+00 +32 33 0.0000000000000000e+00 +32 34 0.0000000000000000e+00 +32 35 0.0000000000000000e+00 +32 36 0.0000000000000000e+00 +32 37 0.0000000000000000e+00 +32 38 0.0000000000000000e+00 +33 31 6.3106321192587568e-04 +33 32 8.2363020221615946e-03 +33 33 6.0384079190552366e-02 +33 34 1.8702291774033526e-03 +33 35 -3.1379768089664029e-02 +33 36 -2.2264983430248061e-02 +33 37 -4.2521604532144300e-03 +33 38 -6.9001745398068947e-03 +33 39 5.6005796986079832e-04 +33 40 1.3200112102408162e-02 +33 41 -2.5939271829460563e-02 +33 42 5.8585146680818576e-03 +34 31 1.3321058276254400e-02 +34 32 -1.1827147158682081e-02 +34 33 1.8702291774033526e-03 +34 34 5.8249384915218680e-02 +34 35 -2.2282255342637954e-02 +34 36 -5.3965068495070486e-03 +34 37 -6.9360877702878306e-03 +34 38 -2.5472561239628870e-02 +34 39 8.1661249041274191e-03 +34 40 -1.1859204625944125e-02 +34 41 5.8609307551406170e-03 +34 42 -3.6899650414565130e-03 +35 31 -2.6283120325306861e-02 +35 32 5.9457094257069441e-03 +35 33 -3.1379768089664022e-02 +35 34 -2.2282255342637954e-02 +35 35 1.2100225325782096e-01 +35 36 3.4530048628855234e-03 +35 37 1.3207052536786392e-03 +35 38 2.1520994458972702e-02 +35 39 -4.2267019670699487e-03 +35 40 -6.7528848284528513e-03 +35 41 1.0335397553458857e-03 +35 42 2.1416836503768764e-02 +35 47 -3.1181847382227530e-02 +35 48 -2.2379252154496432e-02 +35 49 -4.2000942892210635e-03 +35 50 -6.7783875784515916e-03 +35 51 -2.6076966213356076e-02 +35 52 5.8562346527049162e-03 +36 31 5.9712547428834176e-03 +36 32 -3.7193465604125468e-03 +36 33 -2.2264983430248061e-02 +36 34 -5.3965068495070451e-03 +36 35 3.4530048628855226e-03 +36 36 1.1701506949652926e-01 +36 37 2.1520994230659327e-02 +36 38 -2.3529600872888655e-02 +36 39 -6.7590257543615716e-03 +36 40 -2.5559288011397552e-02 +36 41 2.1416836716295101e-02 +36 42 -2.3696502854692936e-02 +36 47 -2.2396524224888713e-02 +36 48 -5.5944306360835826e-03 +36 49 -6.8039330378971887e-03 +36 50 -2.5802372487800727e-02 +36 51 5.8623758946721510e-03 +36 52 -3.7090212237462306e-03 +37 31 0.0000000000000000e+00 +37 32 0.0000000000000000e+00 +37 33 0.0000000000000000e+00 +37 34 0.0000000000000000e+00 +37 35 0.0000000000000000e+00 +37 36 0.0000000000000000e+00 +37 37 1.0000000000000000e+00 +37 38 0.0000000000000000e+00 +37 47 0.0000000000000000e+00 +37 48 0.0000000000000000e+00 +37 49 0.0000000000000000e+00 +37 50 0.0000000000000000e+00 +38 31 0.0000000000000000e+00 +38 32 0.0000000000000000e+00 +38 33 0.0000000000000000e+00 +38 34 0.0000000000000000e+00 +38 35 0.0000000000000000e+00 +38 36 0.0000000000000000e+00 +38 37 0.0000000000000000e+00 +38 38 1.0000000000000000e+00 +38 47 0.0000000000000000e+00 +38 48 0.0000000000000000e+00 +38 49 0.0000000000000000e+00 +38 50 0.0000000000000000e+00 +39 33 5.6005796986079832e-04 +39 34 8.1661249041274225e-03 +39 35 -4.2267019670699487e-03 +39 36 -6.7590257543615716e-03 +39 39 6.0372034703682631e-02 +39 40 1.6471673108368117e-03 +39 41 -3.1438523764656286e-02 +39 42 -2.2203898348451111e-02 +39 43 5.2819207700803713e-04 +39 44 1.3209281299953076e-02 +39 45 -2.5791059018825259e-02 +39 46 5.9403505878953735e-03 +40 33 1.3200112102408158e-02 +40 34 -1.1859204625944123e-02 +40 35 -6.7528848284528521e-03 +40 36 -2.5559288011397542e-02 +40 39 1.6471673108368135e-03 +40 40 5.8666160764644044e-02 +40 41 -2.2206143902118711e-02 +40 42 -5.4096181825235776e-03 +40 43 8.1541195282564139e-03 +40 44 -1.2098649859305047e-02 +40 45 5.9576297890701858e-03 +40 46 -3.7354000854736944e-03 +41 33 -2.5939271829460563e-02 +41 34 5.8609307551406144e-03 +41 35 1.0335397553458883e-03 +41 36 2.1416836716295105e-02 +41 39 -3.1438523764656286e-02 +41 40 -2.2206143902118718e-02 +41 41 1.2096554896775691e-01 +41 42 3.7855918404935372e-03 +41 43 -4.2995579689284798e-03 +41 44 -6.8618609037766959e-03 +41 45 1.1706869514608478e-03 +41 46 2.1288912089205973e-02 +41 47 -4.1776261690413758e-03 +41 48 -6.7055827544752295e-03 +41 51 -3.1146969261124480e-02 +41 52 -2.2372226444798651e-02 +41 53 -2.6159826681352517e-02 +41 54 5.7935426040340758e-03 +42 33 5.8585146680818594e-03 +42 34 -3.6899650414565130e-03 +42 35 2.1416836503768764e-02 +42 36 -2.3696502854692936e-02 +42 39 -2.2203898348451115e-02 +42 40 -5.4096181825235758e-03 +42 41 3.7855918404935372e-03 +42 42 1.1659432370596412e-01 +42 43 -6.8274989051715024e-03 +42 44 -2.5543035586606876e-02 +42 45 2.1288912358535445e-02 +42 46 -2.3411651257994867e-02 +42 47 -6.7031669701221631e-03 +42 48 -2.5451609966984031e-02 +42 51 -2.2374472120504675e-02 +42 52 -5.7011762881191202e-03 +42 53 5.7591809733698388e-03 +42 54 -3.6827645275862211e-03 +43 39 5.2819207700803572e-04 +43 40 8.1541195282564139e-03 +43 41 -4.2995579689284790e-03 +43 42 -6.8274989051715024e-03 +43 43 1.8895495143158528e-02 +43 44 6.9958302589911165e-03 +43 45 -1.5122129251238094e-02 +43 46 -8.3224508820760237e-03 +44 39 1.3209281299953076e-02 +44 40 -1.2098649859305047e-02 +44 41 -6.8618609037766950e-03 +44 42 -2.5543035586606859e-02 +44 43 8.0404503195872622e-03 +44 44 4.0779545386639172e-02 +44 45 -1.4387870715763640e-02 +44 46 -3.1358599407271979e-03 +45 39 -2.5791059018825259e-02 +45 40 5.9576297890701858e-03 +45 41 1.1706869514608461e-03 +45 42 2.1288912358535445e-02 +45 43 -1.5878535069075883e-02 +45 44 -1.3765217273916075e-02 +45 45 5.9792947844526829e-02 +45 46 1.5209265961628820e-03 +45 51 -4.0973436637971256e-03 +45 52 -6.5845322971170590e-03 +45 53 -1.5192697044289407e-02 +45 54 -8.4177191727353821e-03 +46 39 5.9403505878953735e-03 +46 40 -3.7354000854736961e-03 +46 41 2.1288912089205966e-02 +46 42 -2.3411651257994860e-02 +46 43 -8.0217493262880087e-03 +46 44 -2.3853622578593739e-03 +46 45 1.5209246917529799e-03 +46 46 5.8036729613604482e-02 +46 51 -6.5672534514713684e-03 +46 52 -2.5429113811235634e-02 +46 53 -1.4161184591094949e-02 +46 54 -3.0712022010408887e-03 +47 35 -3.1181847382227533e-02 +47 36 -2.2396524224888709e-02 +47 37 -2.6158735642215165e-02 +47 38 5.7116804606971612e-03 +47 41 -4.1776261690413766e-03 +47 42 -6.7031669701221649e-03 +47 47 6.0402722641835931e-02 +47 48 1.8594710006628158e-03 +47 49 6.2201798974902687e-04 +47 50 1.3326279345988026e-02 +47 51 4.9746856189910899e-04 +47 52 8.2022603876628717e-03 +48 35 -2.2379252154496439e-02 +48 36 -5.5944306360835826e-03 +48 37 5.7475934129357243e-03 +48 38 -3.5659833908716723e-03 +48 41 -6.7055827544752304e-03 +48 42 -2.5451609966984038e-02 +48 47 1.8594710006628176e-03 +48 48 5.8230731094245460e-02 +48 49 8.2415237407200762e-03 +48 50 -1.1818097916688296e-02 +48 51 1.3236246754653040e-02 +48 52 -1.1796609183617881e-02 +49 35 0.0000000000000000e+00 +49 36 0.0000000000000000e+00 +49 37 0.0000000000000000e+00 +49 38 0.0000000000000000e+00 +49 47 0.0000000000000000e+00 +49 48 0.0000000000000000e+00 +49 49 1.0000000000000000e+00 +49 50 0.0000000000000000e+00 +50 35 0.0000000000000000e+00 +50 36 0.0000000000000000e+00 +50 37 0.0000000000000000e+00 +50 38 0.0000000000000000e+00 +50 47 0.0000000000000000e+00 +50 48 0.0000000000000000e+00 +50 49 0.0000000000000000e+00 +50 50 1.0000000000000000e+00 +51 35 -2.6076966213356076e-02 +51 36 5.8623758946721527e-03 +51 41 -3.1146969261124480e-02 +51 42 -2.2374472120504675e-02 +51 45 -4.0973436637971247e-03 +51 46 -6.5672534514713693e-03 +51 47 4.9746856189910845e-04 +51 48 1.3236246754653038e-02 +51 51 6.0519116355420330e-02 +51 52 1.5622568342870125e-03 +51 53 3.0869422095827049e-04 +51 54 8.2808460883638264e-03 +52 35 5.8562346527049162e-03 +52 36 -3.7090212237462302e-03 +52 41 -2.2372226444798655e-02 +52 42 -5.7011762881191176e-03 +52 45 -6.5845322971170598e-03 +52 46 -2.5429113811235634e-02 +52 47 8.2022603876628717e-03 +52 48 -1.1796609183617883e-02 +52 51 1.5622568342870107e-03 +52 52 5.8519065449965782e-02 +52 53 1.3336006867260917e-02 +52 54 -1.1879144943246911e-02 +53 41 -2.6159826681352517e-02 +53 42 5.7591809733698431e-03 +53 45 -1.5966290406134884e-02 +53 46 -1.3900490642429359e-02 +53 51 3.0869422095827179e-04 +53 52 1.3336006867260910e-02 +53 53 4.1819422866529156e-02 +53 54 -5.1946971982014039e-03 +54 41 5.7935426040340750e-03 +54 42 -3.6827645275862206e-03 +54 45 -7.8350752424198485e-03 +54 46 -2.2917007041735812e-03 +54 51 8.2808460883638246e-03 +54 52 -1.1879144943246912e-02 +54 53 -6.2393134499780477e-03 +54 54 1.7855610175006718e-02 +1 55 -3.0850794229982346e-02 +1 57 -1.5425307658319516e-02 +2 56 -3.0850794229982346e-02 +2 58 -1.5425307658319516e-02 +7 55 -4.5406232147377816e-02 +7 57 -1.2166307848535801e-01 +7 59 -4.5405874971934018e-02 +8 56 -4.5406232147377816e-02 +8 58 -1.2166307848535801e-01 +8 60 -4.5405874971934018e-02 +23 55 -8.9159788430833818e-19 +23 57 -1.5425663710889491e-02 +23 59 -3.0851148505272839e-02 +24 56 -8.9159788430833818e-19 +24 58 -1.5425663710889491e-02 +24 60 -3.0851148505272839e-02 +43 55 5.0838017584906782e-02 +43 57 2.5419008792453388e-02 +44 56 5.0838017584906782e-02 +44 58 2.5419008792453388e-02 +45 55 2.5419008792453388e-02 +45 57 1.0167603323637801e-01 +45 59 2.5419007825735619e-02 +46 56 2.5419008792453388e-02 +46 58 1.0167603323637801e-01 +46 60 2.5419007825735619e-02 +53 57 2.5419007825735619e-02 +53 59 5.0838015651471231e-02 +54 58 2.5419007825735619e-02 +54 60 5.0838015651471231e-02 +55 1 1.4644579070546889e-02 +55 2 -2.6251477224226275e-02 +55 7 2.1554169511166427e-02 +55 8 -3.8637422576829492e-02 +55 43 -3.1756717519839071e-02 +55 44 5.6926232176544862e-02 +55 45 -4.4420310608407343e-03 +55 46 7.9626676227802437e-03 +55 53 -1.0335123682784885e-12 +55 54 1.7306627915643188e-12 +56 1 -2.6251471838219763e-02 +56 2 4.7057679960869521e-02 +56 7 -3.8637414649670097e-02 +56 8 6.9260386781411123e-02 +56 43 3.9005619449878660e-02 +56 44 -6.9920422661201034e-02 +56 45 2.5883267036158553e-02 +56 46 -4.6397644077977272e-02 +56 53 1.8526459995617586e-12 +56 54 -3.1023387777378349e-12 +57 1 7.5151163426769073e-03 +57 2 -1.3471394743189849e-02 +57 7 6.0828523902595799e-02 +57 8 -1.0535814439732287e-01 +57 23 7.9091863278542788e-03 +57 24 -1.3244289581466258e-02 +57 43 -1.3492634964624226e-02 +57 44 2.4186528532776041e-02 +57 45 -5.0893878592527253e-02 +57 46 8.8016627272693840e-02 +57 53 -1.1866313015975511e-02 +57 54 1.9870672916509038e-02 +58 1 -1.3016569981693692e-02 +58 2 2.3333152067116305e-02 +58 7 -1.0535814778607029e-01 +58 8 1.8248575233642289e-01 +58 23 -1.3699119566537396e-02 +58 24 2.2939794187346471e-02 +58 43 2.0809631871777992e-02 +58 44 -3.7302777168618913e-02 +58 45 8.8016635812338762e-02 +58 46 -1.5252682419704686e-01 +58 53 2.3247569650184631e-02 +58 54 -3.8929097225219769e-02 +59 7 2.3872616380262755e-02 +59 8 -3.9975773904068777e-02 +59 23 1.6220118477011547e-02 +59 24 -2.7161320678294465e-02 +59 43 1.1007451145349551e-12 +59 44 -1.9731655813439119e-12 +59 45 -2.1252960608132497e-02 +59 46 3.5589039715980028e-02 +59 53 -1.8839774250242546e-02 +59 54 3.1548054868356365e-02 +60 7 -3.9975766304020083e-02 +60 8 6.6941225459168072e-02 +60 23 -2.7161315514483000e-02 +60 24 4.5482849078987163e-02 +60 43 -1.8432470391189211e-12 +60 44 3.3041542201530555e-12 +60 45 1.7668505848700423e-02 +60 46 -2.9586712528833374e-02 +60 53 4.9468575971645889e-02 +60 54 -8.2837362012625981e-02 +55 55 7.6265729015547534e-01 +55 56 4.2545404913830881e-01 +56 55 4.2545404913830881e-01 +56 56 2.3734270984452471e-01 +57 57 7.5000019162266141e-01 +57 58 4.3301259125876762e-01 +58 57 4.3301259125876762e-01 +58 58 2.4999980837733857e-01 +59 59 7.3712575922100709e-01 +59 60 4.4019470046089937e-01 +60 59 4.4019470046089937e-01 +60 60 2.6287424077899285e-01 \ No newline at end of file diff --git a/packages/muelu/test/contact/segregatedAgg_filtered_matrix.mm b/packages/muelu/test/contact/segregatedAgg_filtered_matrix.mm new file mode 100644 index 000000000000..fc35c9f25548 --- /dev/null +++ b/packages/muelu/test/contact/segregatedAgg_filtered_matrix.mm @@ -0,0 +1,646 @@ +%%MatrixMarket matrix coordinate real general +54 54 644 +1 1 3.9355998445760321e-02 +1 2 -6.6217411268370240e-03 +1 3 -1.2113700654891191e-03 +1 4 1.3145547034061466e-02 +1 5 -2.5077235601440557e-02 +1 6 6.4846996643310381e-03 +1 7 -1.3519866114223136e-02 +1 8 -1.3267352601446104e-02 +2 1 -6.2370412231028249e-03 +2 2 1.8989972915320102e-02 +2 3 8.2229716707665941e-03 +2 4 -1.3867109382451961e-02 +2 5 6.4486511360615454e-03 +2 6 -4.0936982837841505e-03 +2 7 -7.6209190947193212e-03 +2 8 -5.6381162870946665e-04 +3 1 -1.2113700654891196e-03 +3 2 8.2229716707665924e-03 +3 3 5.8022580586178575e-02 +3 4 -5.9143872533752844e-04 +3 5 -2.6278988860522750e-02 +3 6 -2.1103190351755830e-02 +3 7 -3.9343984368285824e-03 +3 8 -6.1472964761674917e-03 +3 9 -1.4126605061381325e-03 +3 10 1.3241319059742643e-02 +3 11 -2.5175162717199995e-02 +3 12 6.3776348227516030e-03 +4 1 1.3145547034061466e-02 +4 2 -1.3867109382451960e-02 +4 3 -5.9143872533752757e-04 +4 4 5.8914367804640010e-02 +4 5 -2.1108234822120479e-02 +4 6 -1.5333219378710274e-03 +4 7 -6.1304858998971158e-03 +4 8 -2.5539066709480772e-02 +4 9 8.3097636011386627e-03 +4 10 -1.3898168607537589e-02 +4 11 6.3748488121549889e-03 +4 12 -4.0667011672986574e-03 +5 1 -2.5077235601440557e-02 +5 2 6.4486511360615454e-03 +5 3 -2.6278988860522753e-02 +5 4 -2.1108234822120479e-02 +5 5 1.1613450414430546e-01 +5 6 -2.0091177468485122e-03 +5 7 -3.0072603842100972e-03 +5 8 2.1745474651479468e-02 +5 9 -3.8439049157624142e-03 +5 10 -5.9708659069212730e-03 +5 11 -2.9256030833808839e-03 +5 12 2.1617335898069689e-02 +5 21 -2.5997839841640707e-02 +5 22 -2.1265513186428331e-02 +5 23 -3.7392828588409584e-03 +5 24 -5.8347877161910641e-03 +5 25 -2.5244388598507125e-02 +5 26 6.3770576928989485e-03 +6 1 6.4846996643310364e-03 +6 2 -4.0936982837841522e-03 +6 3 -2.1103190351755834e-02 +6 4 -1.5333219378710261e-03 +6 5 -2.0091177468485148e-03 +6 6 1.1845443614756374e-01 +6 7 2.1745474894287246e-02 +6 8 -2.8116802528474170e-02 +6 9 -5.9785284114964353e-03 +6 10 -2.5478901038565330e-02 +6 11 2.1617335645529534e-02 +6 12 -2.7887173242600073e-02 +6 21 -2.1270557660439920e-02 +6 22 -1.8144668581273112e-03 +6 23 -5.8708358924890501e-03 +6 24 -2.5431653024667419e-02 +6 25 6.3847198588819149e-03 +6 26 -4.0784192334742519e-03 +7 1 -1.3062392778830629e-02 +7 2 -8.0498816799911208e-03 +7 3 -3.9343984368285815e-03 +7 4 -6.1304858998971158e-03 +7 5 -3.0072603842100950e-03 +7 6 2.1745474894287242e-02 +7 7 5.8773579274077177e-02 +7 8 -6.1591084575692489e-04 +7 21 -2.5454330521381793e-02 +7 22 6.2772580638053594e-03 +7 23 -1.3318862672996664e-02 +7 24 -1.3245134996352147e-02 +8 1 -1.3393205475289684e-02 +8 2 -1.0241652490840009e-03 +8 3 -6.1472964761674917e-03 +8 4 -2.5539066709480768e-02 +8 5 2.1745474651479468e-02 +8 6 -2.8116802528474164e-02 +8 7 -6.1591420420523992e-04 +8 8 5.9484769356967997e-02 +8 21 6.2940682949179476e-03 +8 22 -4.0191366811148550e-03 +8 23 -7.9018070420933013e-03 +8 24 -7.6769322131671448e-04 +9 3 -1.4126605061381328e-03 +9 4 8.3097636011386644e-03 +9 5 -3.8439049157624151e-03 +9 6 -5.9785284114964362e-03 +9 9 5.8137778283792192e-02 +9 10 -7.7711297573057701e-04 +9 11 -2.6177577793749317e-02 +9 12 -2.1199122535524768e-02 +9 13 -1.4384231730872577e-03 +9 14 1.3272673868735020e-02 +9 15 -2.5255211895055089e-02 +9 16 6.3723264528780911e-03 +10 3 1.3241319059742646e-02 +10 4 -1.3898168607537589e-02 +10 5 -5.9708659069212747e-03 +10 6 -2.5478901038565330e-02 +10 9 -7.7711297573057354e-04 +10 10 5.9039350220667697e-02 +10 11 -2.1197285070010653e-02 +10 12 -1.7123418581105839e-03 +10 13 8.3347572430902909e-03 +10 14 -1.3875121720367947e-02 +10 15 6.3691876498295696e-03 +10 16 -4.0648169960862558e-03 +11 3 -2.5175162717199995e-02 +11 4 6.3748488121549915e-03 +11 5 -2.9256030833808848e-03 +11 6 2.1617335645529541e-02 +11 9 -2.6177577793749313e-02 +11 10 -2.1197285070010657e-02 +11 11 1.1622668039616645e-01 +11 12 -1.6960097516001008e-03 +11 13 -3.8230122373485789e-03 +11 14 -5.9585041693776142e-03 +11 15 -2.8913243517555052e-03 +11 16 2.1621026432065010e-02 +11 21 -3.8218327197703447e-03 +11 22 -5.9507259249215114e-03 +11 25 -2.6186844693891820e-02 +11 26 -2.1193773398157950e-02 +11 27 -2.5205322799070000e-02 +11 28 6.3830874243182949e-03 +12 3 6.3776348227516030e-03 +12 4 -4.0667011672986574e-03 +12 5 2.1617335898069689e-02 +12 6 -2.7887173242600059e-02 +12 9 -2.1199122535524771e-02 +12 10 -1.7123418581105815e-03 +12 11 -1.6960097516000939e-03 +12 12 1.1818506612838972e-01 +12 13 -5.9620018455725371e-03 +12 14 -2.5450453939206637e-02 +12 15 2.1621026218552372e-02 +12 16 -2.7857146642271523e-02 +12 21 -5.9535115867432025e-03 +12 22 -2.5420033377781513e-02 +12 25 -2.1191935989308196e-02 +12 26 -1.7030710656887789e-03 +12 27 6.3865847693751476e-03 +12 28 -4.0681448354319477e-03 +13 9 -1.4384231730872560e-03 +13 10 8.3347572430902909e-03 +13 11 -3.8230122373485785e-03 +13 12 -5.9620018455725371e-03 +13 13 5.8165113095047224e-02 +13 14 -7.1461463051570445e-04 +13 15 -2.6181165558134989e-02 +13 16 -2.1293419222697223e-02 +13 17 -1.3772383364941156e-03 +13 18 1.3344598015393753e-02 +13 19 -2.5335273789982276e-02 +13 20 6.2906804403014185e-03 +14 9 1.3272673868735020e-02 +14 10 -1.3875121720367948e-02 +14 11 -5.9585041693776151e-03 +14 12 -2.5450453939206641e-02 +14 13 -7.1461463051570619e-04 +14 14 5.8970001487552104e-02 +14 15 -2.1281035623679685e-02 +14 16 -1.7616328558158168e-03 +14 17 8.3692538615121170e-03 +14 18 -1.3899792192516079e-02 +14 19 6.3122266933258661e-03 +14 20 -3.9730007796456111e-03 +15 9 -2.5255211895055096e-02 +15 10 6.3691876498295687e-03 +15 11 -2.8913243517555043e-03 +15 12 2.1621026218552376e-02 +15 13 -2.6181165558134989e-02 +15 14 -2.1281035623679688e-02 +15 15 1.1642454467404278e-01 +15 16 -1.5991094477781223e-03 +15 17 -3.8294068542793916e-03 +15 18 -6.0068214586022212e-03 +15 19 -2.6950306264191901e-03 +15 20 2.1673238425948593e-02 +15 25 -3.8451800015850378e-03 +15 26 -5.9887665668930806e-03 +15 27 -2.6301800047903091e-02 +15 28 -2.1223771866734333e-02 +15 29 -2.5405425338910451e-02 +15 30 6.4360526693569078e-03 +16 9 6.3723264528780920e-03 +16 10 -4.0648169960862540e-03 +16 11 2.1621026432065003e-02 +16 12 -2.7857146642271530e-02 +16 13 -2.1293419222697223e-02 +16 14 -1.7616328558158175e-03 +16 15 -1.5991094477781241e-03 +16 16 1.1827103906193917e-01 +16 17 -6.0208694509802218e-03 +16 18 -2.5653239868529080e-02 +16 19 2.1673238106943875e-02 +16 20 -2.7721134266473831e-02 +16 25 -5.9919050495750590e-03 +16 26 -2.5474851135560372e-02 +16 27 -2.1211388288066353e-02 +16 28 -1.6409944746474353e-03 +16 29 6.4501004672100201e-03 +16 30 -4.0772228225549037e-03 +17 13 0.0000000000000000e+00 +17 14 0.0000000000000000e+00 +17 15 0.0000000000000000e+00 +17 16 0.0000000000000000e+00 +17 17 1.0000000000000000e+00 +17 18 0.0000000000000000e+00 +17 19 0.0000000000000000e+00 +17 20 0.0000000000000000e+00 +18 13 0.0000000000000000e+00 +18 14 0.0000000000000000e+00 +18 15 0.0000000000000000e+00 +18 16 0.0000000000000000e+00 +18 17 0.0000000000000000e+00 +18 18 1.0000000000000000e+00 +18 19 0.0000000000000000e+00 +18 20 0.0000000000000000e+00 +19 13 0.0000000000000000e+00 +19 14 0.0000000000000000e+00 +19 15 0.0000000000000000e+00 +19 16 0.0000000000000000e+00 +19 17 0.0000000000000000e+00 +19 18 0.0000000000000000e+00 +19 19 1.0000000000000000e+00 +19 20 0.0000000000000000e+00 +19 27 0.0000000000000000e+00 +19 28 0.0000000000000000e+00 +19 29 0.0000000000000000e+00 +19 30 0.0000000000000000e+00 +20 13 0.0000000000000000e+00 +20 14 0.0000000000000000e+00 +20 15 0.0000000000000000e+00 +20 16 0.0000000000000000e+00 +20 17 0.0000000000000000e+00 +20 18 0.0000000000000000e+00 +20 19 0.0000000000000000e+00 +20 20 1.0000000000000000e+00 +20 27 0.0000000000000000e+00 +20 28 0.0000000000000000e+00 +20 29 0.0000000000000000e+00 +20 30 0.0000000000000000e+00 +21 5 -2.5997839841640703e-02 +21 6 -2.1270557660439924e-02 +21 7 -2.5454330521381793e-02 +21 8 6.2940682949179485e-03 +21 11 -3.8218327197703439e-03 +21 12 -5.9535115867432034e-03 +21 21 5.8179221735473116e-02 +21 22 -6.8188299544652033e-04 +21 23 -1.4503252814462165e-03 +21 24 1.3283509826310266e-02 +21 25 -1.4448933712340190e-03 +21 26 8.3283741214014249e-03 +22 5 -2.1265513186428327e-02 +22 6 -1.8144668581273082e-03 +22 7 6.2772580638053594e-03 +22 8 -4.0191366811148559e-03 +22 11 -5.9507259249215122e-03 +22 12 -2.5420033377781513e-02 +22 21 -6.8188299544652033e-04 +22 22 5.8757741279628302e-02 +22 23 8.3609335230783351e-03 +22 24 -1.3628161435034532e-02 +22 25 1.3259930519912666e-02 +22 26 -1.3865942927570081e-02 +23 5 -3.7392828588409580e-03 +23 6 -5.8708358924890484e-03 +23 7 -1.2847723817438790e-02 +23 8 -8.0089830230299103e-03 +23 21 -1.4503252814462156e-03 +23 22 8.3609335230783351e-03 +23 23 1.8513470813283830e-02 +23 24 5.7964128862329446e-03 +24 5 -5.8347877161910649e-03 +24 6 -2.5431653024667419e-02 +24 7 -1.3655413759261530e-02 +24 8 -1.2359518091833240e-03 +24 21 1.3283509826310266e-02 +24 22 -1.3628161435034536e-02 +24 23 5.4117094115040182e-03 +24 24 3.9832507681018689e-02 +25 5 -2.5244388598507125e-02 +25 6 6.3847198588819157e-03 +25 11 -2.6186844693891823e-02 +25 12 -2.1191935989308193e-02 +25 15 -3.8451800015850386e-03 +25 16 -5.9919050495750598e-03 +25 21 -1.4448933712340199e-03 +25 22 1.3259930519912665e-02 +25 25 5.8140959313937327e-02 +25 26 -7.7895665715594503e-04 +25 27 -1.4096526487193310e-03 +25 28 8.3181473172446192e-03 +26 5 6.3770576928989468e-03 +26 6 -4.0784192334742536e-03 +26 11 -2.1193773398157947e-02 +26 12 -1.7030710656887799e-03 +26 15 -5.9887665668930824e-03 +26 16 -2.5474851135560386e-02 +26 21 8.3283741214014231e-03 +26 22 -1.3865942927570077e-02 +26 25 -7.7895665715594590e-04 +26 26 5.9036183418702176e-02 +26 27 1.3256064807906599e-02 +26 28 -1.3903899056408677e-02 +27 11 -2.5205322799070003e-02 +27 12 6.3865847693751476e-03 +27 15 -2.6301800047903091e-02 +27 16 -2.1211388288066346e-02 +27 19 -3.8563502818067643e-03 +27 20 -6.0886368313633806e-03 +27 25 -1.4096526487193315e-03 +27 26 1.3256064807906599e-02 +27 27 5.8149906314400937e-02 +27 28 -7.0584141545410647e-04 +27 29 -1.3667805369017322e-03 +27 30 8.3632169576020928e-03 +28 11 6.3830874243182957e-03 +28 12 -4.0681448354319494e-03 +28 15 -2.1223771866734333e-02 +28 16 -1.6409944746474372e-03 +28 19 -6.1101834370624443e-03 +28 20 -2.5451926858709995e-02 +28 25 8.3181473172446209e-03 +28 26 -1.3903899056408679e-02 +28 27 -7.0584141545410387e-04 +28 28 5.8985220878708937e-02 +28 29 1.3338561977687974e-02 +28 30 -1.3910255653510895e-02 +29 15 0.0000000000000000e+00 +29 16 0.0000000000000000e+00 +29 19 0.0000000000000000e+00 +29 20 0.0000000000000000e+00 +29 27 0.0000000000000000e+00 +29 28 0.0000000000000000e+00 +29 29 1.0000000000000000e+00 +29 30 0.0000000000000000e+00 +30 15 0.0000000000000000e+00 +30 16 0.0000000000000000e+00 +30 19 0.0000000000000000e+00 +30 20 0.0000000000000000e+00 +30 27 0.0000000000000000e+00 +30 28 0.0000000000000000e+00 +30 29 0.0000000000000000e+00 +30 30 1.0000000000000000e+00 +31 31 1.0000000000000000e+00 +31 32 0.0000000000000000e+00 +31 33 0.0000000000000000e+00 +31 34 0.0000000000000000e+00 +31 35 0.0000000000000000e+00 +31 36 0.0000000000000000e+00 +31 37 0.0000000000000000e+00 +31 38 0.0000000000000000e+00 +32 31 0.0000000000000000e+00 +32 32 1.0000000000000000e+00 +32 33 0.0000000000000000e+00 +32 34 0.0000000000000000e+00 +32 35 0.0000000000000000e+00 +32 36 0.0000000000000000e+00 +32 37 0.0000000000000000e+00 +32 38 0.0000000000000000e+00 +33 31 6.3106321192588544e-04 +33 32 8.2363020221615790e-03 +33 33 6.0384079190552317e-02 +33 34 1.8702291774033751e-03 +33 35 -3.1379768089663994e-02 +33 36 -2.2264983430248034e-02 +33 37 -4.2521604532144413e-03 +33 38 -6.9001745398069060e-03 +33 39 5.6005796986077696e-04 +33 40 1.3200112102408144e-02 +33 41 -2.5939271829460497e-02 +33 42 5.8585146680818429e-03 +34 31 1.3321058276254372e-02 +34 32 -1.1827147158682091e-02 +34 33 1.8702291774033786e-03 +34 34 5.8249384915218569e-02 +34 35 -2.2282255342637912e-02 +34 36 -5.3965068495070486e-03 +34 37 -6.9360877702878453e-03 +34 38 -2.5472561239628811e-02 +34 39 8.1661249041274121e-03 +34 40 -1.1859204625944099e-02 +34 41 5.8609307551405971e-03 +34 42 -3.6899650414565074e-03 +35 31 -2.6283120325306848e-02 +35 32 5.9457094257069597e-03 +35 33 -3.1379768089663994e-02 +35 34 -2.2282255342637908e-02 +35 35 1.2100225325782091e-01 +35 36 3.4530048628855078e-03 +35 37 1.3207052536786709e-03 +35 38 2.1520994458972632e-02 +35 39 -4.2267019670699547e-03 +35 40 -6.7528848284528356e-03 +35 41 1.0335397553458646e-03 +35 42 2.1416836503768757e-02 +35 47 -3.1181847382227512e-02 +35 48 -2.2379252154496418e-02 +35 49 -4.2000942892210635e-03 +35 50 -6.7783875784515864e-03 +35 51 -2.6076966213356107e-02 +35 52 5.8562346527049006e-03 +36 31 5.9712547428834263e-03 +36 32 -3.7193465604125646e-03 +36 33 -2.2264983430248034e-02 +36 34 -5.3965068495070477e-03 +36 35 3.4530048628855113e-03 +36 36 1.1701506949652921e-01 +36 37 2.1520994230659278e-02 +36 38 -2.3529600872888606e-02 +36 39 -6.7590257543615508e-03 +36 40 -2.5559288011397549e-02 +36 41 2.1416836716295098e-02 +36 42 -2.3696502854692957e-02 +36 47 -2.2396524224888685e-02 +36 48 -5.5944306360835713e-03 +36 49 -6.8039330378971844e-03 +36 50 -2.5802372487800672e-02 +36 51 5.8623758946721415e-03 +36 52 -3.7090212237462158e-03 +37 31 0.0000000000000000e+00 +37 32 0.0000000000000000e+00 +37 33 0.0000000000000000e+00 +37 34 0.0000000000000000e+00 +37 35 0.0000000000000000e+00 +37 36 0.0000000000000000e+00 +37 37 1.0000000000000000e+00 +37 38 0.0000000000000000e+00 +37 47 0.0000000000000000e+00 +37 48 0.0000000000000000e+00 +37 49 0.0000000000000000e+00 +37 50 0.0000000000000000e+00 +38 31 0.0000000000000000e+00 +38 32 0.0000000000000000e+00 +38 33 0.0000000000000000e+00 +38 34 0.0000000000000000e+00 +38 35 0.0000000000000000e+00 +38 36 0.0000000000000000e+00 +38 37 0.0000000000000000e+00 +38 38 1.0000000000000000e+00 +38 47 0.0000000000000000e+00 +38 48 0.0000000000000000e+00 +38 49 0.0000000000000000e+00 +38 50 0.0000000000000000e+00 +39 33 5.6005796986077837e-04 +39 34 8.1661249041274139e-03 +39 35 -4.2267019670699547e-03 +39 36 -6.7590257543615525e-03 +39 39 6.0372034703682513e-02 +39 40 1.6471673108367788e-03 +39 41 -3.1438523764656161e-02 +39 42 -2.2203898348451066e-02 +39 43 5.2819207700803041e-04 +39 44 1.3209281299953054e-02 +39 45 -2.5791059018825228e-02 +39 46 5.9403505878953657e-03 +40 33 1.3200112102408137e-02 +40 34 -1.1859204625944097e-02 +40 35 -6.7528848284528374e-03 +40 36 -2.5559288011397549e-02 +40 39 1.6471673108367840e-03 +40 40 5.8666160764643996e-02 +40 41 -2.2206143902118669e-02 +40 42 -5.4096181825235611e-03 +40 43 8.1541195282564018e-03 +40 44 -1.2098649859305049e-02 +40 45 5.9576297890701849e-03 +40 46 -3.7354000854736987e-03 +41 33 -2.5939271829460497e-02 +41 34 5.8609307551405962e-03 +41 35 1.0335397553458659e-03 +41 36 2.1416836716295098e-02 +41 39 -3.1438523764656154e-02 +41 40 -2.2206143902118676e-02 +41 41 1.2096554896775694e-01 +41 42 3.7855918404935286e-03 +41 43 -4.2995579689284824e-03 +41 44 -6.8618609037766828e-03 +41 45 1.1706869514608376e-03 +41 46 2.1288912089205993e-02 +41 47 -4.1776261690413706e-03 +41 48 -6.7055827544752287e-03 +41 51 -3.1146969261124542e-02 +41 52 -2.2372226444798728e-02 +41 53 -2.6159826681352593e-02 +41 54 5.7935426040340967e-03 +42 33 5.8585146680818446e-03 +42 34 -3.6899650414565074e-03 +42 35 2.1416836503768761e-02 +42 36 -2.3696502854692957e-02 +42 39 -2.2203898348451066e-02 +42 40 -5.4096181825235594e-03 +42 41 3.7855918404935320e-03 +42 42 1.1659432370596419e-01 +42 43 -6.8274989051714920e-03 +42 44 -2.5543035586606838e-02 +42 45 2.1288912358535458e-02 +42 46 -2.3411651257994857e-02 +42 47 -6.7031669701221579e-03 +42 48 -2.5451609966984055e-02 +42 51 -2.2374472120504731e-02 +42 52 -5.7011762881191471e-03 +42 53 5.7591809733698561e-03 +42 54 -3.6827645275862141e-03 +43 39 5.2819207700802997e-04 +43 40 8.1541195282564018e-03 +43 41 -4.2995579689284807e-03 +43 42 -6.8274989051714929e-03 +43 43 1.8895495143158528e-02 +43 44 6.9958302589911130e-03 +43 45 -1.5122129251238086e-02 +43 46 -8.3224508820760219e-03 +44 39 1.3209281299953047e-02 +44 40 -1.2098649859305049e-02 +44 41 -6.8618609037766828e-03 +44 42 -2.5543035586606838e-02 +44 43 8.0404503195872553e-03 +44 44 4.0779545386639131e-02 +44 45 -1.4387870715763626e-02 +44 46 -3.1358599407272057e-03 +45 39 -2.5791059018825228e-02 +45 40 5.9576297890701849e-03 +45 41 1.1706869514608389e-03 +45 42 2.1288912358535458e-02 +45 43 -1.5878535069075880e-02 +45 44 -1.3765217273916063e-02 +45 45 5.9792947844526809e-02 +45 46 1.5209265961628931e-03 +45 51 -4.0973436637971143e-03 +45 52 -6.5845322971170720e-03 +45 53 -1.5192697044289428e-02 +45 54 -8.4177191727353960e-03 +46 39 5.9403505878953657e-03 +46 40 -3.7354000854736978e-03 +46 41 2.1288912089205993e-02 +46 42 -2.3411651257994853e-02 +46 43 -8.0217493262879930e-03 +46 44 -2.3853622578593808e-03 +46 45 1.5209246917529970e-03 +46 46 5.8036729613604475e-02 +46 51 -6.5672534514713858e-03 +46 52 -2.5429113811235679e-02 +46 53 -1.4161184591094977e-02 +46 54 -3.0712022010408752e-03 +47 35 -3.1181847382227505e-02 +47 36 -2.2396524224888685e-02 +47 37 -2.6158735642215155e-02 +47 38 5.7116804606971569e-03 +47 41 -4.1776261690413706e-03 +47 42 -6.7031669701221579e-03 +47 47 6.0402722641835896e-02 +47 48 1.8594710006627985e-03 +47 49 6.2201798974902437e-04 +47 50 1.3326279345988002e-02 +47 51 4.9746856189909717e-04 +47 52 8.2022603876628890e-03 +48 35 -2.2379252154496418e-02 +48 36 -5.5944306360835722e-03 +48 37 5.7475934129357252e-03 +48 38 -3.5659833908716931e-03 +48 41 -6.7055827544752287e-03 +48 42 -2.5451609966984059e-02 +48 47 1.8594710006627968e-03 +48 48 5.8230731094245466e-02 +48 49 8.2415237407200623e-03 +48 50 -1.1818097916688282e-02 +48 51 1.3236246754653057e-02 +48 52 -1.1796609183617869e-02 +49 35 0.0000000000000000e+00 +49 36 0.0000000000000000e+00 +49 37 0.0000000000000000e+00 +49 38 0.0000000000000000e+00 +49 47 0.0000000000000000e+00 +49 48 0.0000000000000000e+00 +49 49 1.0000000000000000e+00 +49 50 0.0000000000000000e+00 +50 35 0.0000000000000000e+00 +50 36 0.0000000000000000e+00 +50 37 0.0000000000000000e+00 +50 38 0.0000000000000000e+00 +50 47 0.0000000000000000e+00 +50 48 0.0000000000000000e+00 +50 49 0.0000000000000000e+00 +50 50 1.0000000000000000e+00 +51 35 -2.6076966213356100e-02 +51 36 5.8623758946721432e-03 +51 41 -3.1146969261124542e-02 +51 42 -2.2374472120504731e-02 +51 45 -4.0973436637971143e-03 +51 46 -6.5672534514713823e-03 +51 47 4.9746856189909652e-04 +51 48 1.3236246754653057e-02 +51 51 6.0519116355420385e-02 +51 52 1.5622568342870567e-03 +51 53 3.0869422095827851e-04 +51 54 8.2808460883638454e-03 +52 35 5.8562346527049024e-03 +52 36 -3.7090212237462154e-03 +52 41 -2.2372226444798728e-02 +52 42 -5.7011762881191445e-03 +52 45 -6.5845322971170720e-03 +52 46 -2.5429113811235679e-02 +52 47 8.2022603876628890e-03 +52 48 -1.1796609183617870e-02 +52 51 1.5622568342870550e-03 +52 52 5.8519065449965851e-02 +52 53 1.3336006867260953e-02 +52 54 -1.1879144943246950e-02 +53 41 -2.6159826681352596e-02 +53 42 5.7591809733698596e-03 +53 45 -1.5966290406134908e-02 +53 46 -1.3900490642429380e-02 +53 51 3.0869422095827548e-04 +53 52 1.3336006867260953e-02 +53 53 4.1819422866529211e-02 +53 54 -5.1946971982014360e-03 +54 41 5.7935426040340958e-03 +54 42 -3.6827645275862137e-03 +54 45 -7.8350752424198693e-03 +54 46 -2.2917007041735648e-03 +54 51 8.2808460883638437e-03 +54 52 -1.1879144943246950e-02 +54 53 -6.2393134499780728e-03 +54 54 1.7855610175006725e-02 diff --git a/packages/muelu/test/contact/segregatedAgg_interface_dof_map_MPI1.mm b/packages/muelu/test/contact/segregatedAgg_interface_dof_map_MPI1.mm new file mode 100644 index 000000000000..8b45210c6204 --- /dev/null +++ b/packages/muelu/test/contact/segregatedAgg_interface_dof_map_MPI1.mm @@ -0,0 +1,21 @@ +%%MatrixMarket matrix array integer general +% Format: Version 2.0 +% +% This file encodes a Tpetra::Map. +% It is stored as a dense vector, with twice as many +% entries as the global number of GIDs (global indices). +% (GID, PID) pairs are stored contiguously, where the PID +% is the rank of the process owning that GID. +12 1 +42 +0 +43 +0 +44 +0 +45 +0 +52 +0 +53 +0 \ No newline at end of file diff --git a/packages/muelu/test/contact/segregatedAgg_interface_dof_map_MPI3.mm b/packages/muelu/test/contact/segregatedAgg_interface_dof_map_MPI3.mm new file mode 100644 index 000000000000..52550e553e76 --- /dev/null +++ b/packages/muelu/test/contact/segregatedAgg_interface_dof_map_MPI3.mm @@ -0,0 +1,21 @@ +%%MatrixMarket matrix array integer general +% Format: Version 2.0 +% +% This file encodes a Tpetra::Map. +% It is stored as a dense vector, with twice as many +% entries as the global number of GIDs (global indices). +% (GID, PID) pairs are stored contiguously, where the PID +% is the rank of the process owning that GID. +12 1 +42 +2 +43 +2 +44 +0 +45 +0 +52 +1 +53 +1 \ No newline at end of file diff --git a/packages/muelu/test/contact/segregatedAgg_matrix.mm b/packages/muelu/test/contact/segregatedAgg_matrix.mm new file mode 100644 index 000000000000..4e3a98a6cb76 --- /dev/null +++ b/packages/muelu/test/contact/segregatedAgg_matrix.mm @@ -0,0 +1,682 @@ +%%MatrixMarket matrix coordinate real general +54 54 680 +1 1 3.9355998445760321e-02 +1 2 -6.6217411268370240e-03 +1 3 -1.2113700654891191e-03 +1 4 1.3145547034061466e-02 +1 5 -2.5077235601440557e-02 +1 6 6.4846996643310381e-03 +1 7 -1.3519866114223136e-02 +1 8 -1.3267352601446104e-02 +1 43 5.4060479659357016e-04 +1 44 3.0305931202838767e-04 +1 45 -8.3131460008995943e-05 +1 46 -4.4212284133933886e-05 +1 53 -7.3107451587717136e-13 +1 54 1.9961660187259091e-12 +2 1 -6.2370412231028249e-03 +2 2 1.8989972915320102e-02 +2 3 8.2229716707665941e-03 +2 4 -1.3867109382451961e-02 +2 5 6.4486511360615454e-03 +2 6 -4.0936982837841505e-03 +2 7 -7.6209190947193212e-03 +2 8 -5.6381162870946665e-04 +2 43 -9.6479752027229366e-04 +2 44 -5.4084981093573679e-04 +2 45 1.5113502917368172e-04 +2 46 8.0496194065385204e-05 +2 53 2.0926174515912109e-12 +2 54 -3.5041817317387580e-12 +3 1 -1.2113700654891196e-03 +3 2 8.2229716707665924e-03 +3 3 5.8022580586178575e-02 +3 4 -5.9143872533752844e-04 +3 5 -2.6278988860522750e-02 +3 6 -2.1103190351755830e-02 +3 7 -3.9343984368285824e-03 +3 8 -6.1472964761674917e-03 +3 9 -1.4126605061381325e-03 +3 10 1.3241319059742643e-02 +3 11 -2.5175162717199995e-02 +3 12 6.3776348227516030e-03 +4 1 1.3145547034061466e-02 +4 2 -1.3867109382451960e-02 +4 3 -5.9143872533752757e-04 +4 4 5.8914367804640010e-02 +4 5 -2.1108234822120479e-02 +4 6 -1.5333219378710274e-03 +4 7 -6.1304858998971158e-03 +4 8 -2.5539066709480772e-02 +4 9 8.3097636011386627e-03 +4 10 -1.3898168607537589e-02 +4 11 6.3748488121549889e-03 +4 12 -4.0667011672986574e-03 +5 1 -2.5077235601440557e-02 +5 2 6.4486511360615454e-03 +5 3 -2.6278988860522753e-02 +5 4 -2.1108234822120479e-02 +5 5 1.1613450414430546e-01 +5 6 -2.0091177468485122e-03 +5 7 -3.0072603842100972e-03 +5 8 2.1745474651479468e-02 +5 9 -3.8439049157624142e-03 +5 10 -5.9708659069212730e-03 +5 11 -2.9256030833808839e-03 +5 12 2.1617335898069689e-02 +5 21 -2.5997839841640707e-02 +5 22 -2.1265513186428331e-02 +5 23 -3.7392828588409584e-03 +5 24 -5.8347877161910641e-03 +5 25 -2.5244388598507125e-02 +5 26 6.3770576928989485e-03 +6 1 6.4846996643310364e-03 +6 2 -4.0936982837841522e-03 +6 3 -2.1103190351755834e-02 +6 4 -1.5333219378710261e-03 +6 5 -2.0091177468485148e-03 +6 6 1.1845443614756374e-01 +6 7 2.1745474894287246e-02 +6 8 -2.8116802528474170e-02 +6 9 -5.9785284114964353e-03 +6 10 -2.5478901038565330e-02 +6 11 2.1617335645529534e-02 +6 12 -2.7887173242600073e-02 +6 21 -2.1270557660439920e-02 +6 22 -1.8144668581273112e-03 +6 23 -5.8708358924890501e-03 +6 24 -2.5431653024667419e-02 +6 25 6.3847198588819149e-03 +6 26 -4.0784192334742519e-03 +7 1 -1.3062392778830629e-02 +7 2 -8.0498816799911208e-03 +7 3 -3.9343984368285815e-03 +7 4 -6.1304858998971158e-03 +7 5 -3.0072603842100950e-03 +7 6 2.1745474894287242e-02 +7 7 5.8773579274077177e-02 +7 8 -6.1591084575692489e-04 +7 21 -2.5454330521381793e-02 +7 22 6.2772580638053594e-03 +7 23 -1.3318862672996664e-02 +7 24 -1.3245134996352147e-02 +7 43 2.1580102000879391e-04 +7 44 1.1890730893478238e-04 +7 45 1.4429369138619838e-05 +7 46 3.0665655522862695e-05 +7 53 -2.1656486943780645e-04 +7 54 -1.3089250055292685e-04 +8 1 -1.3393205475289684e-02 +8 2 -1.0241652490840009e-03 +8 3 -6.1472964761674917e-03 +8 4 -2.5539066709480768e-02 +8 5 2.1745474651479468e-02 +8 6 -2.8116802528474164e-02 +8 7 -6.1591420420523992e-04 +8 8 5.9484769356967997e-02 +8 21 6.2940682949179476e-03 +8 22 -4.0191366811148550e-03 +8 23 -7.9018070420933013e-03 +8 24 -7.6769322131671448e-04 +8 43 -3.8052409400213120e-04 +8 44 -2.0964787571395405e-04 +8 45 3.0674729370201888e-05 +8 46 -2.0975082675441263e-05 +8 53 3.6852961599023070e-04 +8 54 2.2271799089190400e-04 +9 3 -1.4126605061381328e-03 +9 4 8.3097636011386644e-03 +9 5 -3.8439049157624151e-03 +9 6 -5.9785284114964362e-03 +9 9 5.8137778283792192e-02 +9 10 -7.7711297573057701e-04 +9 11 -2.6177577793749317e-02 +9 12 -2.1199122535524768e-02 +9 13 -1.4384231730872577e-03 +9 14 1.3272673868735020e-02 +9 15 -2.5255211895055089e-02 +9 16 6.3723264528780911e-03 +10 3 1.3241319059742646e-02 +10 4 -1.3898168607537589e-02 +10 5 -5.9708659069212747e-03 +10 6 -2.5478901038565330e-02 +10 9 -7.7711297573057354e-04 +10 10 5.9039350220667697e-02 +10 11 -2.1197285070010653e-02 +10 12 -1.7123418581105839e-03 +10 13 8.3347572430902909e-03 +10 14 -1.3875121720367947e-02 +10 15 6.3691876498295696e-03 +10 16 -4.0648169960862558e-03 +11 3 -2.5175162717199995e-02 +11 4 6.3748488121549915e-03 +11 5 -2.9256030833808848e-03 +11 6 2.1617335645529541e-02 +11 9 -2.6177577793749313e-02 +11 10 -2.1197285070010657e-02 +11 11 1.1622668039616645e-01 +11 12 -1.6960097516001008e-03 +11 13 -3.8230122373485789e-03 +11 14 -5.9585041693776142e-03 +11 15 -2.8913243517555052e-03 +11 16 2.1621026432065010e-02 +11 21 -3.8218327197703447e-03 +11 22 -5.9507259249215114e-03 +11 25 -2.6186844693891820e-02 +11 26 -2.1193773398157950e-02 +11 27 -2.5205322799070000e-02 +11 28 6.3830874243182949e-03 +12 3 6.3776348227516030e-03 +12 4 -4.0667011672986574e-03 +12 5 2.1617335898069689e-02 +12 6 -2.7887173242600059e-02 +12 9 -2.1199122535524771e-02 +12 10 -1.7123418581105815e-03 +12 11 -1.6960097516000939e-03 +12 12 1.1818506612838972e-01 +12 13 -5.9620018455725371e-03 +12 14 -2.5450453939206637e-02 +12 15 2.1621026218552372e-02 +12 16 -2.7857146642271523e-02 +12 21 -5.9535115867432025e-03 +12 22 -2.5420033377781513e-02 +12 25 -2.1191935989308196e-02 +12 26 -1.7030710656887789e-03 +12 27 6.3865847693751476e-03 +12 28 -4.0681448354319477e-03 +13 9 -1.4384231730872560e-03 +13 10 8.3347572430902909e-03 +13 11 -3.8230122373485785e-03 +13 12 -5.9620018455725371e-03 +13 13 5.8165113095047224e-02 +13 14 -7.1461463051570445e-04 +13 15 -2.6181165558134989e-02 +13 16 -2.1293419222697223e-02 +13 17 -1.3772383364941156e-03 +13 18 1.3344598015393753e-02 +13 19 -2.5335273789982276e-02 +13 20 6.2906804403014185e-03 +14 9 1.3272673868735020e-02 +14 10 -1.3875121720367948e-02 +14 11 -5.9585041693776151e-03 +14 12 -2.5450453939206641e-02 +14 13 -7.1461463051570619e-04 +14 14 5.8970001487552104e-02 +14 15 -2.1281035623679685e-02 +14 16 -1.7616328558158168e-03 +14 17 8.3692538615121170e-03 +14 18 -1.3899792192516079e-02 +14 19 6.3122266933258661e-03 +14 20 -3.9730007796456111e-03 +15 9 -2.5255211895055096e-02 +15 10 6.3691876498295687e-03 +15 11 -2.8913243517555043e-03 +15 12 2.1621026218552376e-02 +15 13 -2.6181165558134989e-02 +15 14 -2.1281035623679688e-02 +15 15 1.1642454467404278e-01 +15 16 -1.5991094477781223e-03 +15 17 -3.8294068542793916e-03 +15 18 -6.0068214586022212e-03 +15 19 -2.6950306264191901e-03 +15 20 2.1673238425948593e-02 +15 25 -3.8451800015850378e-03 +15 26 -5.9887665668930806e-03 +15 27 -2.6301800047903091e-02 +15 28 -2.1223771866734333e-02 +15 29 -2.5405425338910451e-02 +15 30 6.4360526693569078e-03 +16 9 6.3723264528780920e-03 +16 10 -4.0648169960862540e-03 +16 11 2.1621026432065003e-02 +16 12 -2.7857146642271530e-02 +16 13 -2.1293419222697223e-02 +16 14 -1.7616328558158175e-03 +16 15 -1.5991094477781241e-03 +16 16 1.1827103906193917e-01 +16 17 -6.0208694509802218e-03 +16 18 -2.5653239868529080e-02 +16 19 2.1673238106943875e-02 +16 20 -2.7721134266473831e-02 +16 25 -5.9919050495750590e-03 +16 26 -2.5474851135560372e-02 +16 27 -2.1211388288066353e-02 +16 28 -1.6409944746474353e-03 +16 29 6.4501004672100201e-03 +16 30 -4.0772228225549037e-03 +17 13 0.0000000000000000e+00 +17 14 0.0000000000000000e+00 +17 15 0.0000000000000000e+00 +17 16 0.0000000000000000e+00 +17 17 1.0000000000000000e+00 +17 18 0.0000000000000000e+00 +17 19 0.0000000000000000e+00 +17 20 0.0000000000000000e+00 +18 13 0.0000000000000000e+00 +18 14 0.0000000000000000e+00 +18 15 0.0000000000000000e+00 +18 16 0.0000000000000000e+00 +18 17 0.0000000000000000e+00 +18 18 1.0000000000000000e+00 +18 19 0.0000000000000000e+00 +18 20 0.0000000000000000e+00 +19 13 0.0000000000000000e+00 +19 14 0.0000000000000000e+00 +19 15 0.0000000000000000e+00 +19 16 0.0000000000000000e+00 +19 17 0.0000000000000000e+00 +19 18 0.0000000000000000e+00 +19 19 1.0000000000000000e+00 +19 20 0.0000000000000000e+00 +19 27 0.0000000000000000e+00 +19 28 0.0000000000000000e+00 +19 29 0.0000000000000000e+00 +19 30 0.0000000000000000e+00 +20 13 0.0000000000000000e+00 +20 14 0.0000000000000000e+00 +20 15 0.0000000000000000e+00 +20 16 0.0000000000000000e+00 +20 17 0.0000000000000000e+00 +20 18 0.0000000000000000e+00 +20 19 0.0000000000000000e+00 +20 20 1.0000000000000000e+00 +20 27 0.0000000000000000e+00 +20 28 0.0000000000000000e+00 +20 29 0.0000000000000000e+00 +20 30 0.0000000000000000e+00 +21 5 -2.5997839841640703e-02 +21 6 -2.1270557660439924e-02 +21 7 -2.5454330521381793e-02 +21 8 6.2940682949179485e-03 +21 11 -3.8218327197703439e-03 +21 12 -5.9535115867432034e-03 +21 21 5.8179221735473116e-02 +21 22 -6.8188299544652033e-04 +21 23 -1.4503252814462165e-03 +21 24 1.3283509826310266e-02 +21 25 -1.4448933712340190e-03 +21 26 8.3283741214014249e-03 +22 5 -2.1265513186428327e-02 +22 6 -1.8144668581273082e-03 +22 7 6.2772580638053594e-03 +22 8 -4.0191366811148559e-03 +22 11 -5.9507259249215122e-03 +22 12 -2.5420033377781513e-02 +22 21 -6.8188299544652033e-04 +22 22 5.8757741279628302e-02 +22 23 8.3609335230783351e-03 +22 24 -1.3628161435034532e-02 +22 25 1.3259930519912666e-02 +22 26 -1.3865942927570081e-02 +23 5 -3.7392828588409580e-03 +23 6 -5.8708358924890484e-03 +23 7 -1.2847723817438790e-02 +23 8 -8.0089830230299103e-03 +23 21 -1.4503252814462156e-03 +23 22 8.3609335230783351e-03 +23 23 1.8513470813283830e-02 +23 24 5.7964128862329446e-03 +23 43 1.2354251423768024e-12 +23 44 -2.2145893102601485e-12 +23 45 8.5889634883297699e-05 +23 46 5.3552331326620469e-05 +23 53 -5.5702849167659852e-04 +23 54 -3.3107982290434896e-04 +24 5 -5.8347877161910649e-03 +24 6 -2.5431653024667419e-02 +24 7 -1.3655413759261530e-02 +24 8 -1.2359518091833240e-03 +24 21 1.3283509826310266e-02 +24 22 -1.3628161435034536e-02 +24 23 5.4117094115040182e-03 +24 24 3.9832507681018689e-02 +24 43 -2.1097424836083576e-12 +24 44 3.7818666556092107e-12 +24 45 -1.4179834261132934e-04 +24 46 -8.8524925394844041e-05 +24 53 9.3678058235938751e-04 +24 54 5.5678350947958801e-04 +25 5 -2.5244388598507125e-02 +25 6 6.3847198588819157e-03 +25 11 -2.6186844693891823e-02 +25 12 -2.1191935989308193e-02 +25 15 -3.8451800015850386e-03 +25 16 -5.9919050495750598e-03 +25 21 -1.4448933712340199e-03 +25 22 1.3259930519912665e-02 +25 25 5.8140959313937327e-02 +25 26 -7.7895665715594503e-04 +25 27 -1.4096526487193310e-03 +25 28 8.3181473172446192e-03 +26 5 6.3770576928989468e-03 +26 6 -4.0784192334742536e-03 +26 11 -2.1193773398157947e-02 +26 12 -1.7030710656887799e-03 +26 15 -5.9887665668930824e-03 +26 16 -2.5474851135560386e-02 +26 21 8.3283741214014231e-03 +26 22 -1.3865942927570077e-02 +26 25 -7.7895665715594590e-04 +26 26 5.9036183418702176e-02 +26 27 1.3256064807906599e-02 +26 28 -1.3903899056408677e-02 +27 11 -2.5205322799070003e-02 +27 12 6.3865847693751476e-03 +27 15 -2.6301800047903091e-02 +27 16 -2.1211388288066346e-02 +27 19 -3.8563502818067643e-03 +27 20 -6.0886368313633806e-03 +27 25 -1.4096526487193315e-03 +27 26 1.3256064807906599e-02 +27 27 5.8149906314400937e-02 +27 28 -7.0584141545410647e-04 +27 29 -1.3667805369017322e-03 +27 30 8.3632169576020928e-03 +28 11 6.3830874243182957e-03 +28 12 -4.0681448354319494e-03 +28 15 -2.1223771866734333e-02 +28 16 -1.6409944746474372e-03 +28 19 -6.1101834370624443e-03 +28 20 -2.5451926858709995e-02 +28 25 8.3181473172446209e-03 +28 26 -1.3903899056408679e-02 +28 27 -7.0584141545410387e-04 +28 28 5.8985220878708937e-02 +28 29 1.3338561977687974e-02 +28 30 -1.3910255653510895e-02 +29 15 0.0000000000000000e+00 +29 16 0.0000000000000000e+00 +29 19 0.0000000000000000e+00 +29 20 0.0000000000000000e+00 +29 27 0.0000000000000000e+00 +29 28 0.0000000000000000e+00 +29 29 1.0000000000000000e+00 +29 30 0.0000000000000000e+00 +30 15 0.0000000000000000e+00 +30 16 0.0000000000000000e+00 +30 19 0.0000000000000000e+00 +30 20 0.0000000000000000e+00 +30 27 0.0000000000000000e+00 +30 28 0.0000000000000000e+00 +30 29 0.0000000000000000e+00 +30 30 1.0000000000000000e+00 +31 31 1.0000000000000000e+00 +31 32 0.0000000000000000e+00 +31 33 0.0000000000000000e+00 +31 34 0.0000000000000000e+00 +31 35 0.0000000000000000e+00 +31 36 0.0000000000000000e+00 +31 37 0.0000000000000000e+00 +31 38 0.0000000000000000e+00 +32 31 0.0000000000000000e+00 +32 32 1.0000000000000000e+00 +32 33 0.0000000000000000e+00 +32 34 0.0000000000000000e+00 +32 35 0.0000000000000000e+00 +32 36 0.0000000000000000e+00 +32 37 0.0000000000000000e+00 +32 38 0.0000000000000000e+00 +33 31 6.3106321192588544e-04 +33 32 8.2363020221615790e-03 +33 33 6.0384079190552317e-02 +33 34 1.8702291774033751e-03 +33 35 -3.1379768089663994e-02 +33 36 -2.2264983430248034e-02 +33 37 -4.2521604532144413e-03 +33 38 -6.9001745398069060e-03 +33 39 5.6005796986077696e-04 +33 40 1.3200112102408144e-02 +33 41 -2.5939271829460497e-02 +33 42 5.8585146680818429e-03 +34 31 1.3321058276254372e-02 +34 32 -1.1827147158682091e-02 +34 33 1.8702291774033786e-03 +34 34 5.8249384915218569e-02 +34 35 -2.2282255342637912e-02 +34 36 -5.3965068495070486e-03 +34 37 -6.9360877702878453e-03 +34 38 -2.5472561239628811e-02 +34 39 8.1661249041274121e-03 +34 40 -1.1859204625944099e-02 +34 41 5.8609307551405971e-03 +34 42 -3.6899650414565074e-03 +35 31 -2.6283120325306848e-02 +35 32 5.9457094257069597e-03 +35 33 -3.1379768089663994e-02 +35 34 -2.2282255342637908e-02 +35 35 1.2100225325782091e-01 +35 36 3.4530048628855078e-03 +35 37 1.3207052536786709e-03 +35 38 2.1520994458972632e-02 +35 39 -4.2267019670699547e-03 +35 40 -6.7528848284528356e-03 +35 41 1.0335397553458646e-03 +35 42 2.1416836503768757e-02 +35 47 -3.1181847382227512e-02 +35 48 -2.2379252154496418e-02 +35 49 -4.2000942892210635e-03 +35 50 -6.7783875784515864e-03 +35 51 -2.6076966213356107e-02 +35 52 5.8562346527049006e-03 +36 31 5.9712547428834263e-03 +36 32 -3.7193465604125646e-03 +36 33 -2.2264983430248034e-02 +36 34 -5.3965068495070477e-03 +36 35 3.4530048628855113e-03 +36 36 1.1701506949652921e-01 +36 37 2.1520994230659278e-02 +36 38 -2.3529600872888606e-02 +36 39 -6.7590257543615508e-03 +36 40 -2.5559288011397549e-02 +36 41 2.1416836716295098e-02 +36 42 -2.3696502854692957e-02 +36 47 -2.2396524224888685e-02 +36 48 -5.5944306360835713e-03 +36 49 -6.8039330378971844e-03 +36 50 -2.5802372487800672e-02 +36 51 5.8623758946721415e-03 +36 52 -3.7090212237462158e-03 +37 31 0.0000000000000000e+00 +37 32 0.0000000000000000e+00 +37 33 0.0000000000000000e+00 +37 34 0.0000000000000000e+00 +37 35 0.0000000000000000e+00 +37 36 0.0000000000000000e+00 +37 37 1.0000000000000000e+00 +37 38 0.0000000000000000e+00 +37 47 0.0000000000000000e+00 +37 48 0.0000000000000000e+00 +37 49 0.0000000000000000e+00 +37 50 0.0000000000000000e+00 +38 31 0.0000000000000000e+00 +38 32 0.0000000000000000e+00 +38 33 0.0000000000000000e+00 +38 34 0.0000000000000000e+00 +38 35 0.0000000000000000e+00 +38 36 0.0000000000000000e+00 +38 37 0.0000000000000000e+00 +38 38 1.0000000000000000e+00 +38 47 0.0000000000000000e+00 +38 48 0.0000000000000000e+00 +38 49 0.0000000000000000e+00 +38 50 0.0000000000000000e+00 +39 33 5.6005796986077837e-04 +39 34 8.1661249041274139e-03 +39 35 -4.2267019670699547e-03 +39 36 -6.7590257543615525e-03 +39 39 6.0372034703682513e-02 +39 40 1.6471673108367788e-03 +39 41 -3.1438523764656161e-02 +39 42 -2.2203898348451066e-02 +39 43 5.2819207700803041e-04 +39 44 1.3209281299953054e-02 +39 45 -2.5791059018825228e-02 +39 46 5.9403505878953657e-03 +40 33 1.3200112102408137e-02 +40 34 -1.1859204625944097e-02 +40 35 -6.7528848284528374e-03 +40 36 -2.5559288011397549e-02 +40 39 1.6471673108367840e-03 +40 40 5.8666160764643996e-02 +40 41 -2.2206143902118669e-02 +40 42 -5.4096181825235611e-03 +40 43 8.1541195282564018e-03 +40 44 -1.2098649859305049e-02 +40 45 5.9576297890701849e-03 +40 46 -3.7354000854736987e-03 +41 33 -2.5939271829460497e-02 +41 34 5.8609307551405962e-03 +41 35 1.0335397553458659e-03 +41 36 2.1416836716295098e-02 +41 39 -3.1438523764656154e-02 +41 40 -2.2206143902118676e-02 +41 41 1.2096554896775694e-01 +41 42 3.7855918404935286e-03 +41 43 -4.2995579689284824e-03 +41 44 -6.8618609037766828e-03 +41 45 1.1706869514608376e-03 +41 46 2.1288912089205993e-02 +41 47 -4.1776261690413706e-03 +41 48 -6.7055827544752287e-03 +41 51 -3.1146969261124542e-02 +41 52 -2.2372226444798728e-02 +41 53 -2.6159826681352593e-02 +41 54 5.7935426040340967e-03 +42 33 5.8585146680818446e-03 +42 34 -3.6899650414565074e-03 +42 35 2.1416836503768761e-02 +42 36 -2.3696502854692957e-02 +42 39 -2.2203898348451066e-02 +42 40 -5.4096181825235594e-03 +42 41 3.7855918404935320e-03 +42 42 1.1659432370596419e-01 +42 43 -6.8274989051714920e-03 +42 44 -2.5543035586606838e-02 +42 45 2.1288912358535458e-02 +42 46 -2.3411651257994857e-02 +42 47 -6.7031669701221579e-03 +42 48 -2.5451609966984055e-02 +42 51 -2.2374472120504731e-02 +42 52 -5.7011762881191471e-03 +42 53 5.7591809733698561e-03 +42 54 -3.6827645275862141e-03 +43 39 5.2819207700802997e-04 +43 40 8.1541195282564018e-03 +43 41 -4.2995579689284807e-03 +43 42 -6.8274989051714929e-03 +43 43 1.8895495143158528e-02 +43 44 6.9958302589911130e-03 +43 45 -1.5122129251238086e-02 +43 46 -8.3224508820760219e-03 +44 39 1.3209281299953047e-02 +44 40 -1.2098649859305049e-02 +44 41 -6.8618609037766828e-03 +44 42 -2.5543035586606838e-02 +44 43 8.0404503195872553e-03 +44 44 4.0779545386639131e-02 +44 45 -1.4387870715763626e-02 +44 46 -3.1358599407272057e-03 +45 39 -2.5791059018825228e-02 +45 40 5.9576297890701849e-03 +45 41 1.1706869514608389e-03 +45 42 2.1288912358535458e-02 +45 43 -1.5878535069075880e-02 +45 44 -1.3765217273916063e-02 +45 45 5.9792947844526809e-02 +45 46 1.5209265961628931e-03 +45 51 -4.0973436637971143e-03 +45 52 -6.5845322971170720e-03 +45 53 -1.5192697044289428e-02 +45 54 -8.4177191727353960e-03 +46 39 5.9403505878953657e-03 +46 40 -3.7354000854736978e-03 +46 41 2.1288912089205993e-02 +46 42 -2.3411651257994853e-02 +46 43 -8.0217493262879930e-03 +46 44 -2.3853622578593808e-03 +46 45 1.5209246917529970e-03 +46 46 5.8036729613604475e-02 +46 51 -6.5672534514713858e-03 +46 52 -2.5429113811235679e-02 +46 53 -1.4161184591094977e-02 +46 54 -3.0712022010408752e-03 +47 35 -3.1181847382227505e-02 +47 36 -2.2396524224888685e-02 +47 37 -2.6158735642215155e-02 +47 38 5.7116804606971569e-03 +47 41 -4.1776261690413706e-03 +47 42 -6.7031669701221579e-03 +47 47 6.0402722641835896e-02 +47 48 1.8594710006627985e-03 +47 49 6.2201798974902437e-04 +47 50 1.3326279345988002e-02 +47 51 4.9746856189909717e-04 +47 52 8.2022603876628890e-03 +48 35 -2.2379252154496418e-02 +48 36 -5.5944306360835722e-03 +48 37 5.7475934129357252e-03 +48 38 -3.5659833908716931e-03 +48 41 -6.7055827544752287e-03 +48 42 -2.5451609966984059e-02 +48 47 1.8594710006627968e-03 +48 48 5.8230731094245466e-02 +48 49 8.2415237407200623e-03 +48 50 -1.1818097916688282e-02 +48 51 1.3236246754653057e-02 +48 52 -1.1796609183617869e-02 +49 35 0.0000000000000000e+00 +49 36 0.0000000000000000e+00 +49 37 0.0000000000000000e+00 +49 38 0.0000000000000000e+00 +49 47 0.0000000000000000e+00 +49 48 0.0000000000000000e+00 +49 49 1.0000000000000000e+00 +49 50 0.0000000000000000e+00 +50 35 0.0000000000000000e+00 +50 36 0.0000000000000000e+00 +50 37 0.0000000000000000e+00 +50 38 0.0000000000000000e+00 +50 47 0.0000000000000000e+00 +50 48 0.0000000000000000e+00 +50 49 0.0000000000000000e+00 +50 50 1.0000000000000000e+00 +51 35 -2.6076966213356100e-02 +51 36 5.8623758946721432e-03 +51 41 -3.1146969261124542e-02 +51 42 -2.2374472120504731e-02 +51 45 -4.0973436637971143e-03 +51 46 -6.5672534514713823e-03 +51 47 4.9746856189909652e-04 +51 48 1.3236246754653057e-02 +51 51 6.0519116355420385e-02 +51 52 1.5622568342870567e-03 +51 53 3.0869422095827851e-04 +51 54 8.2808460883638454e-03 +52 35 5.8562346527049024e-03 +52 36 -3.7090212237462154e-03 +52 41 -2.2372226444798728e-02 +52 42 -5.7011762881191445e-03 +52 45 -6.5845322971170720e-03 +52 46 -2.5429113811235679e-02 +52 47 8.2022603876628890e-03 +52 48 -1.1796609183617870e-02 +52 51 1.5622568342870550e-03 +52 52 5.8519065449965851e-02 +52 53 1.3336006867260953e-02 +52 54 -1.1879144943246950e-02 +53 41 -2.6159826681352596e-02 +53 42 5.7591809733698596e-03 +53 45 -1.5966290406134908e-02 +53 46 -1.3900490642429380e-02 +53 51 3.0869422095827548e-04 +53 52 1.3336006867260953e-02 +53 53 4.1819422866529211e-02 +53 54 -5.1946971982014360e-03 +54 41 5.7935426040340958e-03 +54 42 -3.6827645275862137e-03 +54 45 -7.8350752424198693e-03 +54 46 -2.2917007041735648e-03 +54 51 8.2808460883638437e-03 +54 52 -1.1879144943246950e-02 +54 53 -6.2393134499780728e-03 +54 54 1.7855610175006725e-02 diff --git a/packages/muelu/test/contact/segregatedAgg_nullspace.mm b/packages/muelu/test/contact/segregatedAgg_nullspace.mm new file mode 100644 index 000000000000..650954c311c5 --- /dev/null +++ b/packages/muelu/test/contact/segregatedAgg_nullspace.mm @@ -0,0 +1,164 @@ +%%MatrixMarket matrix array real general +54 3 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +0.0000000000000000e+00 +1.0000000000000000e+00 +-1.9430125621825556e-02 +-5.8856825744777486e-01 +4.1358257627039363e-01 +-3.3856825744777491e-01 +1.6358257627039396e-01 +9.4444444444444609e-02 +-2.6943012562182544e-01 +-1.5555555555555539e-01 +8.4659527816261282e-01 +-8.8568257447775134e-02 +5.9659527816261315e-01 +3.4444444444444428e-01 +1.2796079800548319e+00 +1.6143174255222464e-01 +1.0296079800548323e+00 +5.9444444444444389e-01 +1.7126206819470515e+00 +4.1143174255222476e-01 +1.4626206819470517e+00 +8.4444444444444389e-01 +-8.6417423729605702e-02 +5.2745714633666396e-01 +-5.1943012562182522e-01 +2.7745714633666380e-01 +3.4659527816261348e-01 +7.7745714633666374e-01 +7.7960798005483267e-01 +1.0274571463366635e+00 +1.2126206819470520e+00 +1.2774571463366633e+00 +-1.0287567995954858e+00 +-9.4036317669088665e-01 +-7.4008166500067296e-01 +-7.7369651002422013e-01 +-8.9008166500067309e-01 +-5.1388888888888862e-01 +-1.1787567995954857e+00 +-6.8055555555555514e-01 +-4.5140653040586010e-01 +-6.0702984335755361e-01 +-6.0140653040586023e-01 +-3.4722222222222227e-01 +-1.6273139581104745e-01 +-4.4036317669088715e-01 +-3.1273139581104736e-01 +-1.8055555555555564e-01 +-1.0400816650006730e+00 +-2.5408126775355705e-01 +-1.3287567995954856e+00 +-4.2074793442022368e-01 +-7.5140653040586014e-01 +-8.7414601086890531e-02 +-4.6273139581104727e-01 +7.9252065579776043e-02 \ No newline at end of file diff --git a/packages/muelu/test/meshtying/CMakeLists.txt b/packages/muelu/test/meshtying/CMakeLists.txt index 7bd87581a4a3..3fa183320822 100644 --- a/packages/muelu/test/meshtying/CMakeLists.txt +++ b/packages/muelu/test/meshtying/CMakeLists.txt @@ -25,7 +25,8 @@ IF(${PACKAGE_NAME}_ENABLE_Ifpack2 AND meshtying2D_small_matrix.mm meshtying2D_small_rhs.mm meshtying2D_small_nullspace1.mm - meshtying2D_small_interface_dof_map.mm + meshtying2D_small_interface_dof_map_MPI1.mm + meshtying2D_small_interface_dof_map_MPI4.mm meshtying2D_small_simple.xml ) @@ -34,14 +35,15 @@ IF(${PACKAGE_NAME}_ENABLE_Ifpack2 AND meshtying2D_medium_matrix.mm meshtying2D_medium_rhs.mm meshtying2D_medium_nullspace1.mm - meshtying2D_medium_interface_dof_map.mm + meshtying2D_medium_interface_dof_map_MPI1.mm + meshtying2D_medium_interface_dof_map_MPI4.mm meshtying2D_medium_simple.xml meshtying2D_medium_simple_spai.xml ) - TRIBITS_ADD_EXECUTABLE_AND_TEST( - MeshTyingBlocked_SimpleSmoother - SOURCES MeshTyingBlocked_SimpleSmoother.cpp + TRIBITS_ADD_EXECUTABLE( + MeshTyingBlocked_NodeBased + SOURCES MeshTyingBlocked_NodeBased.cpp COMM serial mpi ) @@ -51,52 +53,44 @@ IF(${PACKAGE_NAME}_ENABLE_Ifpack2 AND COMM serial mpi ) - # The MortarSurfaceCoupling tests only work with real Scalar types, - # so choose an instantiation with real scalars (if any is available) - SET(MortarSurfaceCoupling_Instatiation "") - IF(HAVE_MUELU_INST_DOUBLE_INT_LONGLONGINT) - SET(MortarSurfaceCoupling_Instatiation "DOUBLE_INT_LONGLONGINT") - ELSEIF(HAVE_MUELU_INST_DOUBLE_INT_LONGINT) - SET(MortarSurfaceCoupling_Instatiation "DOUBLE_INT_LONGINT") - ELSEIF(HAVE_MUELU_INST_DOUBLE_INT_INT) - SET(MortarSurfaceCoupling_Instatiation "DOUBLE_INT_INT") - ELSEIF(HAVE_MUELU_INST_FLOAT_INT_INT) - SET(MortarSurfaceCoupling_Instatiation "FLOAT_INT_INT") - ENDIF() - - IF(MortarSurfaceCoupling_Instatiation) - TRIBITS_ADD_TEST( - MortarSurfaceCoupling_DofBased - NAME "MeshTyingBlocked_SimpleSmoother_2dof_small" - ARGS "--linAlgebra=Tpetra --xml=meshtying2D_small_simple.xml --nPrimalDofs=78 --nDualDofs=14 --numPrimalDofsPerNode=2 --numDualDofsPerNode=2 --probName=meshtying2D_small --expectedNumIts=16 --instantiation=${MortarSurfaceCoupling_Instatiation}" - COMM serial mpi - NUM_MPI_PROCS 1 - ) - - TRIBITS_ADD_TEST( - MortarSurfaceCoupling_DofBased - NAME "MeshTyingBlocked_SimpleSmoother_2dof_medium" - ARGS "--linAlgebra=Tpetra --xml=meshtying2D_medium_simple.xml --nPrimalDofs=530 --nDualDofs=54 --numPrimalDofsPerNode=2 --numDualDofsPerNode=2 --probName=meshtying2D_medium --expectedNumIts=6 --instantiation=${MortarSurfaceCoupling_Instatiation}" - COMM serial mpi - NUM_MPI_PROCS 1 - ) + TRIBITS_ADD_TEST( + MortarSurfaceCoupling_DofBased + NAME "MortarSurfaceCoupling_DofBased_Blocked_SimpleSmoother_2dof_small" + ARGS "--linAlgebra=Tpetra --xml=meshtying2D_small_simple.xml --nPrimalDofs=78 --nDualDofs=14 --numPrimalDofsPerNode=2 --numDualDofsPerNode=2 --probName=meshtying2D_small --expectedNumIts=16" + COMM serial mpi + NUM_MPI_PROCS 1 + ) - TRIBITS_ADD_TEST( - MortarSurfaceCoupling_DofBased - NAME "MeshTyingBlocked_SimpleSmoother_2dof_medium" - ARGS "--linAlgebra=Tpetra --xml=meshtying2D_medium_simple.xml --nPrimalDofs=530 --nDualDofs=54 --numPrimalDofsPerNode=2 --numDualDofsPerNode=2 --probName=meshtying2D_medium --expectedNumIts=11 --instantiation=${MortarSurfaceCoupling_Instatiation}" - COMM serial mpi - NUM_MPI_PROCS 4 - ) + TRIBITS_ADD_TEST( + MortarSurfaceCoupling_DofBased + NAME "MortarSurfaceCoupling_DofBased_Blocked_SimpleSmoother_2dof_medium" + ARGS "--linAlgebra=Tpetra --xml=meshtying2D_medium_simple.xml --nPrimalDofs=530 --nDualDofs=54 --numPrimalDofsPerNode=2 --numDualDofsPerNode=2 --probName=meshtying2D_medium --expectedNumIts=6" + COMM serial mpi + NUM_MPI_PROCS 1 + ) - TRIBITS_ADD_TEST( - MortarSurfaceCoupling_DofBased - NAME "MeshTyingBlocked_SimpleSmoother_2dof_medium_spai" - ARGS "--linAlgebra=Tpetra --xml=meshtying2D_medium_simple_spai.xml --nPrimalDofs=530 --nDualDofs=54 --numPrimalDofsPerNode=2 --numDualDofsPerNode=2 --probName=meshtying2D_medium --expectedNumIts=7 --instantiation=${MortarSurfaceCoupling_Instatiation}" - COMM serial mpi - NUM_MPI_PROCS 1 + TRIBITS_ADD_TEST( + MortarSurfaceCoupling_DofBased + NAME "MortarSurfaceCoupling_DofBased_Blocked_SimpleSmoother_2dof_medium" + ARGS "--linAlgebra=Tpetra --xml=meshtying2D_medium_simple.xml --nPrimalDofs=530 --nDualDofs=54 --numPrimalDofsPerNode=2 --numDualDofsPerNode=2 --probName=meshtying2D_medium --expectedNumIts=12" + COMM serial mpi + NUM_MPI_PROCS 4 ) - ENDIF() + TRIBITS_ADD_TEST( + MortarSurfaceCoupling_DofBased + NAME "MortarSurfaceCoupling_DofBased_Blocked_SimpleSmoother_2dof_medium_spai" + ARGS "--linAlgebra=Tpetra --xml=meshtying2D_medium_simple_spai.xml --nPrimalDofs=530 --nDualDofs=54 --numPrimalDofsPerNode=2 --numDualDofsPerNode=2 --probName=meshtying2D_medium --expectedNumIts=7" + COMM serial mpi + NUM_MPI_PROCS 1 + ) + + TRIBITS_ADD_TEST( + MeshTyingBlocked_NodeBased + NAME "MeshTyingBlocked_NodeBased_simpleSmoother" + ARGS "-linAlgebra=Tpetra" + COMM serial mpi + NUM_MPI_PROCS 1 + ) -ENDIF() +ENDIF() \ No newline at end of file diff --git a/packages/muelu/test/meshtying/MeshTyingBlocked_SimpleSmoother.cpp b/packages/muelu/test/meshtying/MeshTyingBlocked_NodeBased.cpp similarity index 98% rename from packages/muelu/test/meshtying/MeshTyingBlocked_SimpleSmoother.cpp rename to packages/muelu/test/meshtying/MeshTyingBlocked_NodeBased.cpp index 5366a0516e56..8fc232060b10 100644 --- a/packages/muelu/test/meshtying/MeshTyingBlocked_SimpleSmoother.cpp +++ b/packages/muelu/test/meshtying/MeshTyingBlocked_NodeBased.cpp @@ -76,6 +76,10 @@ void read_Lagr2Dof(std::string filemane, std::map template int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int argc, char *argv[]) { #include + + // The MeshTyingBlocked_NodeBased tests only work with real Scalar types, + if (Teuchos::ScalarTraits::isComplex) return EXIT_SUCCESS; + using SparseMatrixType = Tpetra::CrsMatrix; using tpetra_mvector_type = Tpetra::MultiVector; using tpetra_map_type = Tpetra::Map; diff --git a/packages/muelu/test/meshtying/MortarSurfaceCoupling_DofBased.cpp b/packages/muelu/test/meshtying/MortarSurfaceCoupling_DofBased.cpp index 5cb1c01ba73f..2e42a20d285a 100644 --- a/packages/muelu/test/meshtying/MortarSurfaceCoupling_DofBased.cpp +++ b/packages/muelu/test/meshtying/MortarSurfaceCoupling_DofBased.cpp @@ -54,6 +54,7 @@ #include #include #include +#include // Teuchos #include @@ -69,6 +70,10 @@ template int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int argc, char *argv[]) { #include + + // The MMortarSurfaceCoupline_DofBased tests only work with real Scalar types, + if (Teuchos::ScalarTraits::isComplex) return EXIT_SUCCESS; + using Teuchos::Array; using Teuchos::ArrayRCP; using Teuchos::ParameterList; @@ -81,6 +86,7 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int ar RCP> comm = Teuchos::DefaultComm::getComm(); RCP out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout)); out->setOutputToRootOnly(0); + auto numRanks = comm->getSize(); GO numGlobalDofsPrimal = -GST::one(); clp.setOption("nPrimalDofs", &numGlobalDofsPrimal, "total number of primal DOFs"); @@ -115,7 +121,7 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int ar const std::string matrixFileName = probName + "_matrix.mm"; const std::string rhsFileName = probName + "_rhs.mm"; const std::string nullspace1FileName = probName + "_nullspace1.mm"; - const std::string dualInterfaceMapFileName = probName + "_interface_dof_map.mm"; + const std::string dualInterfaceMapFileName = probName + "_interface_dof_map_MPI" + std::to_string(numRanks) + ".mm"; // Create maps for primal DOFs std::vector stridingInfoPrimal; @@ -149,30 +155,9 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib &lib, int ar // Read the nullspace vector of the (0,0)-block from file RCP nullspace1 = Xpetra::IO::ReadMultiVector(nullspace1FileName, dofRowMapPrimal); - // Read the interface slave dof row map from file + // Read the primal interface dof row map from file TEUCHOS_ASSERT(!dualInterfaceMapFileName.empty()); - RCP primalInterfaceDofMapDofs = Xpetra::IO::ReadMap(dualInterfaceMapFileName, lib, comm); - - // Distribute interface slave dof row map across all procs - RCP primalInterfaceDofMap = Teuchos::null; - { - std::vector interfaceGlobalDofsOnCurrentProc = std::vector(primalInterfaceDofMapDofs->getGlobalNumElements()); - std::vector interfaceGlobalDofs = std::vector(primalInterfaceDofMapDofs->getGlobalNumElements()); - if (comm->getRank() == 0) { - for (size_t i = 0; i < primalInterfaceDofMapDofs->getGlobalNumElements(); ++i) { - interfaceGlobalDofsOnCurrentProc[i] = primalInterfaceDofMapDofs->getLocalElementList()[i]; - } - } - Teuchos::reduceAll(*comm, Teuchos::REDUCE_MAX, interfaceGlobalDofs.size(), - &interfaceGlobalDofsOnCurrentProc[0], &interfaceGlobalDofs[0]); - - Array primalInterfaceDofMapDofsOnCurProc; - for (size_t i = 0; i < interfaceGlobalDofs.size(); ++i) { - if (dofRowMapPrimal->isNodeGlobalElement((GlobalOrdinal)interfaceGlobalDofs[i])) - primalInterfaceDofMapDofsOnCurProc.push_back((GlobalOrdinal)interfaceGlobalDofs[i]); - } - primalInterfaceDofMap = MapFactory::Build(lib, primalInterfaceDofMapDofs->getGlobalNumElements(), primalInterfaceDofMapDofsOnCurProc, Teuchos::ScalarTraits::zero(), comm); - } + RCP primalInterfaceDofMap = Xpetra::IO::ReadMap(dualInterfaceMapFileName, lib, comm); // Create the default nullspace vector of the (1,1)-block RCP nullspace2 = MultiVectorFactory::Build(dofRowMapDual, 2, true); diff --git a/packages/muelu/test/meshtying/meshtying2D_medium_interface_dof_map.mm b/packages/muelu/test/meshtying/meshtying2D_medium_interface_dof_map_MPI1.mm similarity index 100% rename from packages/muelu/test/meshtying/meshtying2D_medium_interface_dof_map.mm rename to packages/muelu/test/meshtying/meshtying2D_medium_interface_dof_map_MPI1.mm diff --git a/packages/muelu/test/meshtying/meshtying2D_medium_interface_dof_map_MPI4.mm b/packages/muelu/test/meshtying/meshtying2D_medium_interface_dof_map_MPI4.mm new file mode 100644 index 000000000000..1bafd4e204ad --- /dev/null +++ b/packages/muelu/test/meshtying/meshtying2D_medium_interface_dof_map_MPI4.mm @@ -0,0 +1,117 @@ +%%MatrixMarket matrix array integer general +% Format: Version 2.0 +% +% This file encodes a Tpetra::Map. +% It is stored as a dense vector, with twice as many +% entries as the global number of GIDs (global indices). +% (GID, PID) pairs are stored contiguously, where the PID +% is the rank of the process owning that GID. +108 1 +0 +0 +1 +0 +2 +0 +3 +0 +8 +0 +9 +0 +12 +0 +13 +0 +16 +0 +17 +0 +20 +0 +21 +0 +24 +0 +25 +0 +28 +1 +29 +1 +32 +1 +33 +1 +36 +1 +37 +1 +40 +1 +41 +1 +44 +1 +45 +1 +48 +1 +49 +1 +52 +1 +53 +1 +56 +2 +57 +2 +60 +2 +61 +2 +64 +2 +65 +2 +68 +2 +69 +2 +72 +2 +73 +2 +76 +2 +77 +2 +80 +2 +81 +2 +84 +3 +85 +3 +88 +3 +89 +3 +92 +3 +93 +3 +96 +3 +97 +3 +100 +3 +101 +3 +104 +3 +105 +3 diff --git a/packages/muelu/test/meshtying/meshtying2D_small_interface_dof_map.mm b/packages/muelu/test/meshtying/meshtying2D_small_interface_dof_map_MPI1.mm similarity index 100% rename from packages/muelu/test/meshtying/meshtying2D_small_interface_dof_map.mm rename to packages/muelu/test/meshtying/meshtying2D_small_interface_dof_map_MPI1.mm diff --git a/packages/muelu/test/meshtying/meshtying2D_small_interface_dof_map_MPI4.mm b/packages/muelu/test/meshtying/meshtying2D_small_interface_dof_map_MPI4.mm new file mode 100644 index 000000000000..1081a4dc540e --- /dev/null +++ b/packages/muelu/test/meshtying/meshtying2D_small_interface_dof_map_MPI4.mm @@ -0,0 +1,37 @@ +%%MatrixMarket matrix array integer general +% Format: Version 2.0 +% +% This file encodes a Tpetra::Map. +% It is stored as a dense vector, with twice as many +% entries as the global number of GIDs (global indices). +% (GID, PID) pairs are stored contiguously, where the PID +% is the rank of the process owning that GID. +28 1 +0 +0 +1 +0 +2 +0 +3 +0 +8 +1 +9 +1 +12 +1 +13 +1 +16 +2 +17 +2 +20 +2 +21 +2 +24 +3 +25 +3 diff --git a/packages/muelu/test/unit_tests/SegregatedAFactory.cpp b/packages/muelu/test/unit_tests/SegregatedAFactory.cpp index 1539f5f9caac..0cada90ede88 100644 --- a/packages/muelu/test/unit_tests/SegregatedAFactory.cpp +++ b/packages/muelu/test/unit_tests/SegregatedAFactory.cpp @@ -50,32 +50,28 @@ #include "MueLu_TestHelpers.hpp" #include "MueLu_Version.hpp" +#include "MueLu_SegregatedAFactory.hpp" +#include "MueLu_Utilities.hpp" #include -#include #include -#include -#include -#include #include #include -#include - namespace MueLuTests { -TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(SegregatedAFactory, Basic, Scalar, LocalOrdinal, GlobalOrdinal, Node) { +TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(SegregatedAFactory, Blockmap, Scalar, LocalOrdinal, GlobalOrdinal, Node) { #include "MueLu_UseShortNames.hpp" MUELU_TESTING_SET_OSTREAM; - MUELU_TESTING_LIMIT_SCOPE(Scalar, GlobalOrdinal, NO); + MUELU_TESTING_LIMIT_SCOPE(SC, GO, NO); out << "version: " << MueLu::Version() << std::endl; using TST = Teuchos::ScalarTraits; using magnitude_type = typename TST::magnitudeType; using TMT = Teuchos::ScalarTraits; - RCP > comm = Parameters::getDefaultComm(); - Xpetra::UnderlyingLib lib = MueLuTests::TestHelpers::Parameters::getLib(); + RCP> comm = Parameters::getDefaultComm(); + Xpetra::UnderlyingLib lib = MueLuTests::TestHelpers::Parameters::getLib(); // test with simple example matrix and segregate first 4 rows from rest // x x x x x x x x @@ -106,13 +102,13 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(SegregatedAFactory, Basic, Scalar, LocalOrdina TEST_EQUALITY(A->getGlobalNumEntries(), 33); TEST_FLOATING_EQUALITY(A->getFrobeniusNorm(), 5.744562646538029, 2e1 * TMT::eps()); - RCP map = MapFactory::Build(lib, 4, 0, comm); + RCP map = MapFactory::Build(lib, 4, 0, comm); Level level; TestHelpers::TestFactory::createSingleLevelHierarchy(level); level.Set("A", A); - const std::string mapName = "Segregate Map"; + std::string mapName = "dropMap1"; level.Set(mapName, map); TEST_ASSERT(level.IsAvailable("A", MueLu::NoFactory::get())); @@ -120,13 +116,104 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(SegregatedAFactory, Basic, Scalar, LocalOrdina RCP segregateFact = rcp(new SegregatedAFactory()); segregateFact->SetFactory("A", MueLu::NoFactory::getRCP()); - segregateFact->SetParameter("map: name", Teuchos::ParameterEntry(mapName)); + segregateFact->SetParameter("droppingScheme", Teuchos::ParameterEntry(std::string("blockmap"))); + segregateFact->SetFactory("dropMap1", MueLu::NoFactory::getRCP()); + + // request segregated operator + level.Request("A", segregateFact.get()); + segregateFact->Build(level); + + RCP Aout = level.Get>("A", segregateFact.get()); + + // Output (segregated Operator) + // Node ID Global Row Num Entries(Index,Value) + // 0 0 4 (0, 1) (1, 1) (2, 1) (3, 1) + // 0 1 4 (0, 1) (1, 1) (2, 1) (3, 1) + // 0 2 4 (0, 1) (1, 1) (2, 1) (3, 1) + // 0 3 4 (0, 1) (1, 1) (2, 1) (3, 1) + // 0 4 3 (4, 1) (5, 1) (6, 1) + // 0 5 3 (4, 1) (5, 1) (6, 1) + // 0 6 3 (4, 1) (5, 1) (6, 1) + + TEST_EQUALITY(Aout.is_null(), false); + TEST_EQUALITY(Aout->getGlobalNumEntries(), 25); + TEST_FLOATING_EQUALITY(Aout->getFrobeniusNorm(), 5.0, 2e1 * TMT::eps()); + } +} + +TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(SegregatedAFactory, MapPair, Scalar, LocalOrdinal, GlobalOrdinal, Node) { +#include "MueLu_UseShortNames.hpp" + MUELU_TESTING_SET_OSTREAM; + MUELU_TESTING_LIMIT_SCOPE(SC, GO, NO); + out << "version: " << MueLu::Version() << std::endl; + + using TST = Teuchos::ScalarTraits; + using magnitude_type = typename TST::magnitudeType; + using TMT = Teuchos::ScalarTraits; + + RCP> comm = Parameters::getDefaultComm(); + Xpetra::UnderlyingLib lib = MueLuTests::TestHelpers::Parameters::getLib(); + + // test with simple example matrix and segregate first 4 rows from rest + // x x x x x x x x + // x x x x x x x x + // x x x x x x x x x x + // x x x x x x ==> x x x x + // x x x x x x x x + // x x x x x x x x + // x x x x x x + + { + RCP rowMap = MapFactory::Build(lib, 7, 0, comm); + RCP graph = CrsGraphFactory::Build(rowMap, 6); + + graph->insertGlobalIndices(0, Teuchos::tuple(0, 1, 2, 3)); + graph->insertGlobalIndices(1, Teuchos::tuple(0, 1, 2, 3)); + graph->insertGlobalIndices(2, Teuchos::tuple(0, 1, 2, 3, 4, 5)); + graph->insertGlobalIndices(3, Teuchos::tuple(0, 1, 2, 3, 4, 5)); + graph->insertGlobalIndices(4, Teuchos::tuple(2, 3, 4, 5, 6)); + graph->insertGlobalIndices(5, Teuchos::tuple(2, 3, 4, 5, 6)); + graph->insertGlobalIndices(6, Teuchos::tuple(4, 5, 6)); + graph->fillComplete(); + + RCP A = MatrixFactory::Build(graph.getConst()); + A->setAllToScalar(TST::one()); + A->fillComplete(); + + TEST_EQUALITY(A.is_null(), false); + TEST_EQUALITY(A->getGlobalNumEntries(), 33); + TEST_FLOATING_EQUALITY(A->getFrobeniusNorm(), 5.744562646538029, 2e1 * TMT::eps()); + + std::vector dropMap1Entries{2, 3}; + RCP dropMap1 = Xpetra::MapFactory::Build(lib, dropMap1Entries.size(), dropMap1Entries, 0, comm); + std::vector dropMap2Entries{4, 5}; + RCP dropMap2 = Xpetra::MapFactory::Build(lib, dropMap2Entries.size(), dropMap2Entries, 0, comm); + + Level level; + TestHelpers::TestFactory::createSingleLevelHierarchy(level); + level.Set("A", A); + + std::string map1Name = "dropMap1"; + std::string map2Name = "dropMap2"; + + level.Set(map1Name, dropMap1); + level.Set(map2Name, dropMap2); + + TEST_ASSERT(level.IsAvailable("A", MueLu::NoFactory::get())); + TEST_ASSERT(level.IsAvailable(map1Name, MueLu::NoFactory::get())); + TEST_ASSERT(level.IsAvailable(map2Name, MueLu::NoFactory::get())); + + RCP segregateFact = rcp(new SegregatedAFactory()); + segregateFact->SetFactory("A", MueLu::NoFactory::getRCP()); + segregateFact->SetParameter("droppingScheme", Teuchos::ParameterEntry(std::string("map-pair"))); + segregateFact->SetFactory("dropMap1", MueLu::NoFactory::getRCP()); + segregateFact->SetFactory("dropMap2", MueLu::NoFactory::getRCP()); // request segregated operator level.Request("A", segregateFact.get()); segregateFact->Build(level); - RCP Aout = level.Get >("A", segregateFact.get()); + RCP Aout = level.Get>("A", segregateFact.get()); // Output (segregated Operator) // Node ID Global Row Num Entries(Index,Value) @@ -144,8 +231,108 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(SegregatedAFactory, Basic, Scalar, LocalOrdina } } -#define MUELU_ETI_GROUP(SC, LO, GO, Node) \ - TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(SegregatedAFactory, Basic, SC, LO, GO, Node) +TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(SegregatedAFactory, importOffRankDroppingInfo, Scalar, LocalOrdinal, GlobalOrdinal, Node) { +#include "MueLu_UseShortNames.hpp" + MUELU_TESTING_SET_OSTREAM; + MUELU_TESTING_LIMIT_SCOPE(Scalar, GlobalOrdinal, NO); + out << "version: " << MueLu::Version() << std::endl; + + RCP> comm = Parameters::getDefaultComm(); + int numProcs = comm->getSize(); + int myRank = comm->getRank(); + Xpetra::UnderlyingLib lib = MueLuTests::TestHelpers::Parameters::getLib(); + + { + // Create different map entries on each processor + size_t globalDropMapSize = 3; + std::vector dropMapEntries = {}; + if (numProcs == 1) { + dropMapEntries = {1, 7, 8}; + } else if (numProcs == 4) { + if (myRank == 0) { + dropMapEntries = {7, 8}; + } else if (myRank == 1) { + dropMapEntries = {}; + } else if (myRank == 2) { + dropMapEntries = {1}; + } else if (myRank == 3) { + dropMapEntries = {}; + } + } else { + std::cout << "\nThis test was designed to run on exactly 1 or 4 ranks!\n" + << std::endl; + return; + } + RCP dropMap = Xpetra::MapFactory::Build(lib, globalDropMapSize, dropMapEntries, 0, comm); + + int graphSize = 13; + RCP rowMap = MapFactory::Build(lib, graphSize, 0, comm); + RCP graph = CrsGraphFactory::Build(rowMap, graphSize); + + // Create graph for symmetric matrix with off-Rank entries + // + // x x x x x x + // x x x x x x x x + // x x x x x x x x + // x x x x x x x + // x x x x x x + // x x x x x x x x x + // x x x x x x x + // x x x x x x x x + // x x x x x x x x + // x x x x x x x + // x x x x x x x + // x x x x x x x + // x + + graph->insertGlobalIndices(0, Teuchos::tuple(0, 1, 2, 3, 4, 5)); + graph->insertGlobalIndices(1, Teuchos::tuple(0, 1, 2, 3, 4, 5, 7, 8)); + graph->insertGlobalIndices(2, Teuchos::tuple(0, 1, 2, 3, 4, 5, 9, 10)); + graph->insertGlobalIndices(3, Teuchos::tuple(0, 1, 2, 3, 4, 5, 7)); + graph->insertGlobalIndices(4, Teuchos::tuple(0, 1, 2, 3, 4, 5)); + graph->insertGlobalIndices(5, Teuchos::tuple(0, 1, 2, 3, 4, 5, 6, 8, 11)); + graph->insertGlobalIndices(6, Teuchos::tuple(5, 6, 7, 8, 9, 10, 11)); + graph->insertGlobalIndices(7, Teuchos::tuple(1, 3, 6, 7, 8, 9, 10, 11)); + graph->insertGlobalIndices(8, Teuchos::tuple(1, 5, 6, 7, 8, 9, 10, 11)); + graph->insertGlobalIndices(9, Teuchos::tuple(2, 6, 7, 8, 9, 10, 11)); + graph->insertGlobalIndices(10, Teuchos::tuple(2, 6, 7, 8, 9, 10, 11)); + graph->insertGlobalIndices(11, Teuchos::tuple(5, 6, 7, 8, 9, 10, 11)); + graph->insertGlobalIndices(12, Teuchos::tuple(12)); + graph->fillComplete(); + + RCP A = MatrixFactory::Build(graph.getConst()); + A->setAllToScalar(Teuchos::ScalarTraits::one()); + A->fillComplete(); + + Teuchos::RCP> finalDropMap = MueLu::importOffRankDroppingInfo(dropMap, A); + + size_t globalExpectedMapSize = 0; + std::vector expectedMapEntries = {}; + + if (numProcs == 1) { + globalExpectedMapSize = 3; + expectedMapEntries = {1, 7, 8}; + } else if (numProcs == 4) { + globalExpectedMapSize = 11; + if (myRank == 0) { + expectedMapEntries = {1, 7, 8}; + } else if (myRank == 1) { + expectedMapEntries = {1, 7, 8}; + } else if (myRank == 2) { + expectedMapEntries = {7, 8, 1}; + } else if (myRank == 3) { + expectedMapEntries = {7, 8}; + } + } + RCP expectedMap = Xpetra::MapFactory::Build(lib, globalExpectedMapSize, expectedMapEntries, 0, comm); + TEUCHOS_ASSERT(expectedMap->isSameAs(*finalDropMap)); + } +} + +#define MUELU_ETI_GROUP(SC, LO, GO, NO) \ + TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(SegregatedAFactory, Blockmap, SC, LO, GO, NO) \ + TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(SegregatedAFactory, MapPair, SC, LO, GO, NO) \ + TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(SegregatedAFactory, importOffRankDroppingInfo, SC, LO, GO, NO) #include } // namespace MueLuTests