12 #include "ml_aggregate.h"
13 #include "ml_epetra_utils.h"
24 ML_Matrix *Amatrix, ML_Matrix **Pmatrix, ML_Comm *comm) {
28 if (graph->eGraph->Comm().MyPID() == 0 && mlAggregates->printFlag < MueLu_PrintLevel())
29 printf(
"ML_Aggregate_CoarsenUncoupled : \n");
31 MueLu_AggOptions aggregateOptions;
33 aggregateOptions.printFlag = mlAggregates->print_flag;
34 aggregateOptions.minNodesPerAggregate = mlAggregates->min_nodes_per_aggregate;
35 aggregateOptions.maxNeighAlreadySelected = mlAggregates->max_neigh_already_selected;
36 aggregateOptions.ordering = mlAggregates->ordering;
37 aggregateOptions.phase3AggCreation = mlAggregates->phase3_agg_creation;
39 Aggregates *aggregates = NULL;
41 aggregates = MueLu_Aggregate_CoarsenUncoupled(&aggregateOptions, graph);
43 MueLu_AggregateLeftOvers(&aggregateOptions, aggregates,
"UC_CleanUp", graph);
47 for (
int i = 0; i < aggregates->vertex2AggId->Map().NumMyElements(); i++)
48 Final[i] = (*(aggregates->vertex2AggId))[i] + (*(aggregates->procWinner))[i] * 1000;
50 cout <<
Final << endl;
54 MueLu_AggregateDestroy(aggregates);
69 graph = (MueLu_Graph *)malloc(
sizeof(MueLu_Graph));
72 graph->name = (
char *)malloc(
sizeof(
char) * 80);
73 strcpy(Graph->name, name);
74 graph->nVertices = Amatrix->invec_leng;
76 if (Amatrix->getrow->nrows == 0) {
77 graph->vertexNeighbors = NULL;
78 graph->vertexNeighborsPtr = NULL;
81 Epetra_ML_GetCrsDataptrs(Amatrix, &dtmp, &(graph->vertexNeighbors), &(graph->vertexNeighborsPtr));
82 if (graph->vertexNeighborsPtr == NULL) {
83 printf(
"MueLu_BuildGraph: Only functions for an Epetra_CrsMatrix.\n");
86 graph->nEdges = (graph->vertexNeighborsPtr)[Amatrix->getrow->Nrows];
87 Epetra_ML_GetCrsMatrix(Amatrix, (
void **)&A);
88 graph->eGraph = &(A->graph());
90 if (graph->eGraph == NULL)
94 if (graph->nGhost < 0) graph->nGhost = 0;
101 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