48 #include "ml_aggregate.h"
49 #include "ml_epetra_utils.h"
60 ML_Matrix *Amatrix, ML_Matrix **Pmatrix, ML_Comm *comm) {
64 if (graph->eGraph->Comm().MyPID() == 0 && mlAggregates->printFlag < MueLu_PrintLevel())
65 printf(
"ML_Aggregate_CoarsenUncoupled : \n");
67 MueLu_AggOptions aggregateOptions;
69 aggregateOptions.printFlag = mlAggregates->print_flag;
70 aggregateOptions.minNodesPerAggregate = mlAggregates->min_nodes_per_aggregate;
71 aggregateOptions.maxNeighAlreadySelected = mlAggregates->max_neigh_already_selected;
72 aggregateOptions.ordering = mlAggregates->ordering;
73 aggregateOptions.phase3AggCreation = mlAggregates->phase3_agg_creation;
75 Aggregates *aggregates = NULL;
77 aggregates = MueLu_Aggregate_CoarsenUncoupled(&aggregateOptions, graph);
79 MueLu_AggregateLeftOvers(&aggregateOptions, aggregates,
"UC_CleanUp", graph);
83 for (
int i = 0; i < aggregates->vertex2AggId->Map().NumMyElements(); i++)
84 Final[i] = (*(aggregates->vertex2AggId))[i] + (*(aggregates->procWinner))[i] * 1000;
86 cout <<
Final << endl;
90 MueLu_AggregateDestroy(aggregates);
105 graph = (MueLu_Graph *)malloc(
sizeof(MueLu_Graph));
106 graph->eGraph = NULL;
108 graph->name = (
char *)malloc(
sizeof(
char) * 80);
109 strcpy(Graph->name, name);
110 graph->nVertices = Amatrix->invec_leng;
112 if (Amatrix->getrow->nrows == 0) {
113 graph->vertexNeighbors = NULL;
114 graph->vertexNeighborsPtr = NULL;
117 Epetra_ML_GetCrsDataptrs(Amatrix, &dtmp, &(graph->vertexNeighbors), &(graph->vertexNeighborsPtr));
118 if (graph->vertexNeighborsPtr == NULL) {
119 printf(
"MueLu_BuildGraph: Only functions for an Epetra_CrsMatrix.\n");
122 graph->nEdges = (graph->vertexNeighborsPtr)[Amatrix->getrow->Nrows];
123 Epetra_ML_GetCrsMatrix(Amatrix, (
void **)&A);
124 graph->eGraph = &(A->graph());
126 if (graph->eGraph == NULL)
130 if (graph->nGhost < 0) graph->nGhost = 0;
137 if (graph->name != NULL) free(graph->name);
int MueLu_DestroyGraph(MueLu_Graph *graph)
MueLu_Graph * MueLu_BuildGraph(ML_Matrix *Amatrix, char *name)
int ML_Aggregate_CoarsenUncoupled(ML_Aggregate *mlAggregates, ML_Matrix *Amatrix, ML_Matrix **Pmatrix, ML_Comm *comm)
int NumMyElements() const
Keep data only for this run. Used to keep data useful for Hierarchy::Iterate(). Data will be deleted ...
const Epetra_Map & RowMatrixColMap() const