Added GraphSetObjectType() calls
This commit is contained in:
parent
b93cf71a29
commit
1217add3b1
@ -135,6 +135,9 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, &graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
HYPRE_SStructGraphSetObjectType(graph, object_type);
|
||||
|
||||
/* Now we need to tell the graph which stencil to use for each variable on
|
||||
each part (we only have one variable and one part) */
|
||||
HYPRE_SStructGraphSetStencil(graph, part, var, stencil);
|
||||
|
||||
@ -168,6 +168,9 @@ c-----------------------------------------------------------------------
|
||||
c Create the graph object
|
||||
call HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, graph, ierr)
|
||||
|
||||
c See MatrixSetObjectType below
|
||||
call HYPRE_SStructGraphSetObjectType(graph, object_type, ierr)
|
||||
|
||||
c Now we need to tell the graph which stencil to use for each
|
||||
c variable on each part (we only have one variable and one part)
|
||||
call HYPRE_SStructGraphSetStencil(graph, part, var, stencil, ierr)
|
||||
|
||||
@ -375,6 +375,9 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, &graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR);
|
||||
|
||||
/* Now we need to tell the graph which stencil to use for each
|
||||
variable on each part (we only have one variable) */
|
||||
for (part = 0; part < num_procs; part++)
|
||||
|
||||
@ -362,6 +362,9 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, &graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR);
|
||||
|
||||
/* Indicate that this problem uses finite element stiffness matrices and
|
||||
load vectors, instead of stencils. */
|
||||
for (part = 0; part < num_procs; part++)
|
||||
|
||||
@ -477,6 +477,9 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, edge_grid, &A_graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
HYPRE_SStructGraphSetObjectType(A_graph, HYPRE_PARCSR);
|
||||
|
||||
/* Indicate that this problem uses finite element stiffness matrices and
|
||||
load vectors, instead of stencils. */
|
||||
HYPRE_SStructGraphSetFEM(A_graph, part);
|
||||
@ -646,6 +649,9 @@ int main (int argc, char *argv[])
|
||||
/* Create the discrete gradient graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, edge_grid, &G_graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
HYPRE_SStructGraphSetObjectType(G_graph, HYPRE_PARCSR);
|
||||
|
||||
/* Since the discrete gradient relates edge and nodal variables (it is a
|
||||
rectangular matrix), we have to specify the domain (column) grid. */
|
||||
HYPRE_SStructGraphSetDomainGrid(G_graph, node_grid);
|
||||
|
||||
@ -472,6 +472,9 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, edge_grid, &A_graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
HYPRE_SStructGraphSetObjectType(A_graph, HYPRE_PARCSR);
|
||||
|
||||
/* Indicate that this problem uses finite element stiffness matrices and
|
||||
load vectors, instead of stencils. */
|
||||
HYPRE_SStructGraphSetFEM(A_graph, part);
|
||||
@ -641,6 +644,9 @@ int main (int argc, char *argv[])
|
||||
/* Create the discrete gradient graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, edge_grid, &G_graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
HYPRE_SStructGraphSetObjectType(G_graph, HYPRE_PARCSR);
|
||||
|
||||
/* Since the discrete gradient relates edge and nodal variables (it is a
|
||||
rectangular matrix), we have to specify the domain (column) grid. */
|
||||
HYPRE_SStructGraphSetDomainGrid(G_graph, node_grid);
|
||||
|
||||
@ -145,6 +145,10 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, &graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
object_type = HYPRE_STRUCT;
|
||||
HYPRE_SStructGraphSetObjectType(graph, object_type);
|
||||
|
||||
/* Now we need to tell the graph which stencil to use for each
|
||||
variable on each part (we only have one variable and one part) */
|
||||
HYPRE_SStructGraphSetStencil(graph, part, var, stencil);
|
||||
|
||||
@ -447,6 +447,10 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, &graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
object_type = HYPRE_STRUCT;
|
||||
HYPRE_SStructGraphSetObjectType(graph, object_type);
|
||||
|
||||
/* Now we need to tell the graph which stencil to use for each
|
||||
variable on each part (we only have one variable and one part)*/
|
||||
HYPRE_SStructGraphSetStencil(graph, part, var, stencil);
|
||||
|
||||
@ -254,6 +254,10 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, &graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
object_type = HYPRE_SSTRUCT;
|
||||
HYPRE_SStructGraphSetObjectType(graph, object_type);
|
||||
|
||||
/* Use the 5-pt stencil on part 0 */
|
||||
part = 0;
|
||||
HYPRE_SStructGraphSetStencil(graph, part, var, stencil_5pt);
|
||||
|
||||
@ -235,6 +235,17 @@ int main (int argc, char *argv[])
|
||||
/* Create the graph object */
|
||||
HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, &graph);
|
||||
|
||||
/* See MatrixSetObjectType below */
|
||||
if (solver_id > 1 && solver_id < 4)
|
||||
{
|
||||
object_type = HYPRE_PARCSR;
|
||||
}
|
||||
else
|
||||
{
|
||||
object_type = HYPRE_SSTRUCT;
|
||||
}
|
||||
HYPRE_SStructGraphSetObjectType(graph, object_type);
|
||||
|
||||
/* Assign the u-stencil we created to variable u (variable 0) */
|
||||
var = 0;
|
||||
HYPRE_SStructGraphSetStencil(graph, part, var, stencil_u);
|
||||
@ -262,14 +273,6 @@ int main (int argc, char *argv[])
|
||||
unstructured solvers, e.g. BoomerAMG, the object type should be
|
||||
HYPRE_PARCSR. If the problem is purely structured (with one part), you
|
||||
may want to use HYPRE_STRUCT to access the structured solvers. */
|
||||
if (solver_id > 1 && solver_id < 4)
|
||||
{
|
||||
object_type = HYPRE_PARCSR;
|
||||
}
|
||||
else
|
||||
{
|
||||
object_type = HYPRE_SSTRUCT;
|
||||
}
|
||||
HYPRE_SStructMatrixSetObjectType(A, object_type);
|
||||
|
||||
/* Indicate that the matrix coefficients are ready to be set */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user