48 #include "ml_aggregate.h"
49 #include "ml_epetra_utils.h"
60 ML_Matrix *Amatrix, ML_Matrix **Pmatrix, ML_Comm *comm)
65 if (graph->eGraph->Comm().MyPID() == 0 && mlAggregates->printFlag < MueLu_PrintLevel())
66 printf(
"ML_Aggregate_CoarsenUncoupled : \n");
68 MueLu_AggOptions aggregateOptions;
70 aggregateOptions.printFlag = mlAggregates->print_flag;
71 aggregateOptions.minNodesPerAggregate = mlAggregates->min_nodes_per_aggregate;
72 aggregateOptions.maxNeighAlreadySelected = mlAggregates->max_neigh_already_selected;
73 aggregateOptions.ordering = mlAggregates->ordering;
74 aggregateOptions.phase3AggCreation = mlAggregates->phase3_agg_creation;
77 Aggregates *aggregates = NULL;
79 aggregates = MueLu_Aggregate_CoarsenUncoupled(&aggregateOptions,graph);
82 MueLu_AggregateLeftOvers(&aggregateOptions, aggregates,
"UC_CleanUp", graph);
86 for (
int i = 0; i < aggregates->vertex2AggId->Map().NumMyElements(); i++)
87 Final[i] = (*(aggregates->vertex2AggId))[i] + (*(aggregates->procWinner))[i]*1000;
89 cout <<
Final << endl; sleep(2);
92 MueLu_AggregateDestroy(aggregates);
108 graph = (MueLu_Graph *) malloc(
sizeof(MueLu_Graph));
109 graph->eGraph = NULL;
111 graph->name = (
char *) malloc(
sizeof(
char)*80); strcpy(Graph->name,name);
112 graph->nVertices = Amatrix->invec_leng;
114 if ( Amatrix->getrow->nrows == 0) {
115 graph->vertexNeighbors = NULL;
116 graph->vertexNeighborsPtr = NULL;
120 Epetra_ML_GetCrsDataptrs(Amatrix, &dtmp, &(graph->vertexNeighbors),&(graph->vertexNeighborsPtr));
121 if ( graph->vertexNeighborsPtr == NULL) {
122 printf(
"MueLu_BuildGraph: Only functions for an Epetra_CrsMatrix.\n");
125 graph->nEdges = (graph->vertexNeighborsPtr)[Amatrix->getrow->Nrows];
126 Epetra_ML_GetCrsMatrix( Amatrix, (
void **) &A );
127 graph->eGraph = &(A->graph());
129 if (graph->eGraph == NULL) graph->nGhost = 0;
132 if (graph->nGhost < 0) graph->nGhost = 0;
139 if ( graph != NULL) {
140 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