Changed SetBoxValues() to set only stored coefficients. This eliminates a

problem in the SStruct interface for non-cell problems by leaving the ghost
layers for accumulating values.  The symmetric coefficients are filled in (some
in the ghost layers) at Assemble() time.
This commit is contained in:
falgout 2012-02-07 23:48:13 +00:00
parent 3109c15561
commit e390780737

View File

@ -704,6 +704,7 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix,
hypre_StructStencil *stencil;
HYPRE_Int center_rank;
HYPRE_Int *symm_elements;
hypre_BoxArray *data_space;
hypre_Box *data_box;
hypre_IndexRef data_start;
@ -727,6 +728,7 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix,
*-----------------------------------------------------------------------*/
constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix);
symm_elements = hypre_StructMatrixSymmElements(matrix);
if (outside > 0)
{
@ -785,10 +787,12 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix,
for (s = 0; s < num_stencil_indices; s++)
{
datap = hypre_StructMatrixBoxData(matrix, i,
stencil_indices[s]);
/* only set stored stencil values */
if (symm_elements[stencil_indices[s]] < 0)
{
datap = hypre_StructMatrixBoxData(matrix, i, stencil_indices[s]);
if ( constant_coefficient==1 ||
if ( (constant_coefficient==1) ||
(constant_coefficient==2 && stencil_indices[s]!=center_rank ))
/* datap has only one data point for a given i and s */
{
@ -869,6 +873,7 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix,
hypre_BoxLoop2End(datai, dvali);
}
}
} /* end if (symm_elements) */
hypre_IndexD(dval_start, 0) ++;
}