Set num ghost to match what's in the grid. This gives users the ability to set

larger ghost layers to support non-distance-one stencils.
This commit is contained in:
falgout 2012-09-18 18:04:05 +00:00
parent a217eb5eaa
commit 40e176d653
2 changed files with 2 additions and 14 deletions

View File

@ -52,7 +52,6 @@ hypre_StructMatrixCreate( MPI_Comm comm,
hypre_StructStencil *user_stencil )
{
hypre_StructMatrix *matrix;
HYPRE_Int ndim = hypre_StructGridDim(grid);
HYPRE_Int i;
matrix = hypre_CTAlloc(hypre_StructMatrix, 1);
@ -69,12 +68,7 @@ hypre_StructMatrixCreate( MPI_Comm comm,
hypre_StructMatrixConstantCoefficient(matrix) = 0;
for (i = 0; i < 6; i++)
{
hypre_StructMatrixNumGhost(matrix)[i] = 0;
}
for (i = 0; i < ndim; i++)
{
hypre_StructMatrixNumGhost(matrix)[2*i] = 1;
hypre_StructMatrixNumGhost(matrix)[2*i+1] = 1;
hypre_StructMatrixNumGhost(matrix)[i] = hypre_StructGridNumGhost(grid)[i];
}
return matrix;

View File

@ -26,7 +26,6 @@ hypre_StructVectorCreate( MPI_Comm comm,
hypre_StructGrid *grid )
{
hypre_StructVector *vector;
HYPRE_Int ndim = hypre_StructGridDim(grid);
HYPRE_Int i;
vector = hypre_CTAlloc(hypre_StructVector, 1);
@ -40,12 +39,7 @@ hypre_StructVectorCreate( MPI_Comm comm,
/* set defaults */
for (i = 0; i < 6; i++)
{
hypre_StructVectorNumGhost(vector)[i] = 0;
}
for (i = 0; i < ndim; i++)
{
hypre_StructVectorNumGhost(vector)[2*i] = 1;
hypre_StructVectorNumGhost(vector)[2*i+1] = 1;
hypre_StructVectorNumGhost(vector)[i] = hypre_StructGridNumGhost(grid)[i];
}
return vector;