diff --git a/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp b/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp index 207791bf5b5b..cc39c32e146d 100644 --- a/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp +++ b/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp @@ -1332,6 +1332,8 @@ void ParameterListInterpreter:: MUELU_TEST_AND_SET_PARAM_2LIST(paramList, defaultList, "aggregation: output file: build colormap", bool, aggExportParams); aggExport->SetParameterList(aggExportParams); aggExport->SetFactory("DofsPerNode", manager.GetFactory("DofsPerNode")); + aggExport->SetFactory("Aggregates", manager.GetFactory("Aggregates")); + aggExport->SetFactory("Graph", manager.GetFactory("Graph")); if (!RAP.is_null()) RAP->AddTransferFactory(aggExport); diff --git a/packages/muelu/src/Utils/MueLu_AggregationExportFactory_decl.hpp b/packages/muelu/src/Utils/MueLu_AggregationExportFactory_decl.hpp index 58d2936e32ed..e5cbcb5693e9 100644 --- a/packages/muelu/src/Utils/MueLu_AggregationExportFactory_decl.hpp +++ b/packages/muelu/src/Utils/MueLu_AggregationExportFactory_decl.hpp @@ -123,7 +123,7 @@ class AggregationExportFactory : public TwoLevelFactoryBase, public Visualizatio // Data that the different styles need to have available when building geometry mutable Teuchos::RCP coords_; // fine local coordinates mutable Teuchos::RCP coordsCoarse_; // coarse local coordinates - mutable Teuchos::ArrayRCP vertex2AggId_; + mutable Teuchos::RCP vertex2AggId_; mutable Teuchos::ArrayRCP aggSizes_; mutable std::vector isRoot_; mutable bool doFineGraphEdges_; diff --git a/packages/muelu/src/Utils/MueLu_AggregationExportFactory_def.hpp b/packages/muelu/src/Utils/MueLu_AggregationExportFactory_def.hpp index 823349a58b34..2e2ae7ba9acc 100644 --- a/packages/muelu/src/Utils/MueLu_AggregationExportFactory_def.hpp +++ b/packages/muelu/src/Utils/MueLu_AggregationExportFactory_def.hpp @@ -167,12 +167,9 @@ void AggregationExportFactory::Build( } } GetOStream(Runtime0) << "AggregationExportFactory: DofsPerNode: " << DofsPerNode << std::endl; - Teuchos::RCP vertex2AggId_vector = aggregates->GetVertex2AggId(); - Teuchos::RCP procWinner_vector = aggregates->GetProcWinner(); - Teuchos::ArrayRCP vertex2AggId = aggregates->GetVertex2AggId()->getDataNonConst(0); - Teuchos::ArrayRCP procWinner = aggregates->GetProcWinner()->getDataNonConst(0); - vertex2AggId_ = vertex2AggId; + Teuchos::RCP vertex2AggId = aggregates->GetVertex2AggId(); + vertex2AggId_ = vertex2AggId; // prepare for calculating global aggregate ids std::vector numAggsGlobal(numProcs, 0); @@ -263,9 +260,10 @@ void AggregationExportFactory::Build( } if (aggStyle == "Point Cloud") this->doPointCloud(vertices, geomSizes, numAggs_, numNodes_); - else if (aggStyle == "Jacks") - this->doJacks(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggId_); - else if (aggStyle == "Jacks++") // Not actually implemented + else if (aggStyle == "Jacks") { + auto vertex2AggIds = vertex2AggId_->getDataNonConst(0); + this->doJacks(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggIds); + } else if (aggStyle == "Jacks++") // Not actually implemented doJacksPlus_(vertices, geomSizes); else if (aggStyle == "Convex Hulls") doConvexHulls(vertices, geomSizes); @@ -305,11 +303,13 @@ void AggregationExportFactory::doConv Teuchos::ArrayRCP::coordinateType> yCoords = coords_->getData(1); Teuchos::ArrayRCP::coordinateType> zCoords = Teuchos::null; + auto vertex2AggIds = vertex2AggId_->getDataNonConst(0); + if (dims_ == 2) { - this->doConvexHulls2D(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggId_, xCoords, yCoords); + this->doConvexHulls2D(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggIds, xCoords, yCoords); } else { zCoords = coords_->getData(2); - this->doConvexHulls3D(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggId_, xCoords, yCoords, zCoords); + this->doConvexHulls3D(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggIds, xCoords, yCoords, zCoords); } } @@ -571,6 +571,8 @@ void AggregationExportFactory::writeF if (dims_ == 3) zCoords = coords_->getData(2); + auto vertex2AggIds = vertex2AggId_->getDataNonConst(0); + vector uniqueFine = this->makeUnique(vertices); string indent = " "; fout << "" << endl; @@ -596,10 +598,10 @@ void AggregationExportFactory::writeF fout << " " << endl; fout << indent; for (size_t i = 0; i < uniqueFine.size(); i++) { - if (vertex2AggId_[uniqueFine[i]] == -1) - fout << vertex2AggId_[uniqueFine[i]] << " "; + if (vertex2AggIds[uniqueFine[i]] == -1) + fout << vertex2AggIds[uniqueFine[i]] << " "; else - fout << aggsOffset_ + vertex2AggId_[uniqueFine[i]] << " "; + fout << aggsOffset_ + vertex2AggIds[uniqueFine[i]] << " "; if (i % 10 == 9) fout << endl << indent;