Made mostly minor changes related to Klocwork analysis
This commit is contained in:
parent
10481d66d1
commit
74ae90ee0c
@ -229,6 +229,12 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver,
|
|||||||
syH = (HYPRE_StructVector) sy;
|
syH = (HYPRE_StructVector) sy;
|
||||||
switch(ssolver)
|
switch(ssolver)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
/* If no solver is matched, use Jacobi, but throw and error */
|
||||||
|
if (ssolver != HYPRE_Jacobi)
|
||||||
|
{
|
||||||
|
hypre_error(HYPRE_ERROR_GENERIC);
|
||||||
|
} /* don't break */
|
||||||
case HYPRE_Jacobi:
|
case HYPRE_Jacobi:
|
||||||
HYPRE_StructJacobiCreate(comm, (HYPRE_StructSolver *)&sdata);
|
HYPRE_StructJacobiCreate(comm, (HYPRE_StructSolver *)&sdata);
|
||||||
HYPRE_StructJacobiSetMaxIter(sdata, 1);
|
HYPRE_StructJacobiSetMaxIter(sdata, 1);
|
||||||
@ -331,7 +337,7 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver,
|
|||||||
hypre_ParVector *pary;
|
hypre_ParVector *pary;
|
||||||
|
|
||||||
HYPRE_Int iter, part, vi, vj;
|
HYPRE_Int iter, part, vi, vj;
|
||||||
double b_dot_b, r_dot_r;
|
double b_dot_b = 0, r_dot_r;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -908,12 +908,13 @@ hypre_FacSemiRestrictDestroy2( void *fac_restrict_vdata )
|
|||||||
{
|
{
|
||||||
HYPRE_Int ierr = 0;
|
HYPRE_Int ierr = 0;
|
||||||
hypre_FacSemiRestrictData2 *fac_restrict_data = fac_restrict_vdata;
|
hypre_FacSemiRestrictData2 *fac_restrict_data = fac_restrict_vdata;
|
||||||
HYPRE_Int nvars= (fac_restrict_data-> nvars);
|
HYPRE_Int nvars;
|
||||||
HYPRE_Int i, j;
|
HYPRE_Int i, j;
|
||||||
|
|
||||||
|
|
||||||
if (fac_restrict_data)
|
if (fac_restrict_data)
|
||||||
{
|
{
|
||||||
|
nvars= (fac_restrict_data-> nvars);
|
||||||
hypre_SStructPVectorDestroy(fac_restrict_data-> fgrid_cvectors);
|
hypre_SStructPVectorDestroy(fac_restrict_data-> fgrid_cvectors);
|
||||||
|
|
||||||
for (i= 0; i< nvars; i++)
|
for (i= 0; i< nvars; i++)
|
||||||
|
|||||||
@ -70,8 +70,8 @@ hypre_FACSolve3( void *fac_vdata,
|
|||||||
hypre_ParVector *parx;
|
hypre_ParVector *parx;
|
||||||
hypre_ParVector *pary;
|
hypre_ParVector *pary;
|
||||||
|
|
||||||
double b_dot_b, r_dot_r, eps;
|
double b_dot_b = 0, r_dot_r, eps = 0;
|
||||||
double e_dot_e, e_dot_e_l, x_dot_x;
|
double e_dot_e = 0, e_dot_e_l, x_dot_x = 1;
|
||||||
|
|
||||||
HYPRE_Int level, i;
|
HYPRE_Int level, i;
|
||||||
HYPRE_Int ierr = 0;
|
HYPRE_Int ierr = 0;
|
||||||
|
|||||||
@ -10,9 +10,6 @@
|
|||||||
* $Revision$
|
* $Revision$
|
||||||
***********************************************************************EHEADER*/
|
***********************************************************************EHEADER*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "_hypre_sstruct_ls.h"
|
#include "_hypre_sstruct_ls.h"
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
@ -86,8 +83,8 @@ hypre_MaxwellSolve( void * maxwell_vdata,
|
|||||||
HYPRE_Int Solve_err_flag;
|
HYPRE_Int Solve_err_flag;
|
||||||
HYPRE_Int relax_local, cycle_param;
|
HYPRE_Int relax_local, cycle_param;
|
||||||
|
|
||||||
double b_dot_b, r_dot_r, eps;
|
double b_dot_b = 0, r_dot_r, eps = 0;
|
||||||
double e_dot_e, x_dot_x;
|
double e_dot_e = 0, x_dot_x = 1;
|
||||||
|
|
||||||
HYPRE_Int i, j;
|
HYPRE_Int i, j;
|
||||||
HYPRE_Int level;
|
HYPRE_Int level;
|
||||||
|
|||||||
@ -81,7 +81,7 @@ hypre_MaxwellSolve2( void * maxwell_vdata,
|
|||||||
HYPRE_Int Solve_err_flag;
|
HYPRE_Int Solve_err_flag;
|
||||||
HYPRE_Int relax_local, cycle_param;
|
HYPRE_Int relax_local, cycle_param;
|
||||||
|
|
||||||
double b_dot_b, r_dot_r, eps;
|
double b_dot_b = 0, r_dot_r, eps = 0;
|
||||||
double e_dot_e, x_dot_x;
|
double e_dot_e, x_dot_x;
|
||||||
|
|
||||||
HYPRE_Int i, j;
|
HYPRE_Int i, j;
|
||||||
|
|||||||
@ -5500,6 +5500,7 @@ hypre_CollapseStencilToStencil(hypre_ParCSRMatrix *Aee,
|
|||||||
marker= hypre_TAlloc(HYPRE_Int, max_ranksize);
|
marker= hypre_TAlloc(HYPRE_Int, max_ranksize);
|
||||||
|
|
||||||
cnt= 0;
|
cnt= 0;
|
||||||
|
centre= 0;
|
||||||
for (j= -1; j<= 1; j++)
|
for (j= -1; j<= 1; j++)
|
||||||
{
|
{
|
||||||
hypre_CopyIndex(pt_location, index1);
|
hypre_CopyIndex(pt_location, index1);
|
||||||
|
|||||||
@ -53,8 +53,8 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata,
|
|||||||
double *rel_norms = (sys_pfmg_data -> rel_norms);
|
double *rel_norms = (sys_pfmg_data -> rel_norms);
|
||||||
HYPRE_Int *active_l = (sys_pfmg_data -> active_l);
|
HYPRE_Int *active_l = (sys_pfmg_data -> active_l);
|
||||||
|
|
||||||
double b_dot_b, r_dot_r, eps;
|
double b_dot_b, r_dot_r, eps = 0;
|
||||||
double e_dot_e, x_dot_x;
|
double e_dot_e = 0, x_dot_x = 1;
|
||||||
|
|
||||||
HYPRE_Int i, l;
|
HYPRE_Int i, l;
|
||||||
|
|
||||||
@ -276,11 +276,6 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata,
|
|||||||
hypre_SStructPInnerProd(e_l[0], e_l[0], &e_dot_e);
|
hypre_SStructPInnerProd(e_l[0], e_l[0], &e_dot_e);
|
||||||
hypre_SStructPInnerProd(x_l[0], x_l[0], &x_dot_x);
|
hypre_SStructPInnerProd(x_l[0], x_l[0], &x_dot_x);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
e_dot_e = 0.0;
|
|
||||||
x_dot_x = 1.0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fine grid post-relaxation */
|
/* fine grid post-relaxation */
|
||||||
|
|||||||
@ -85,12 +85,13 @@ HYPRE_SStructVectorDestroy( HYPRE_SStructVector vector )
|
|||||||
HYPRE_Int nparts;
|
HYPRE_Int nparts;
|
||||||
hypre_SStructPVector **pvectors;
|
hypre_SStructPVector **pvectors;
|
||||||
HYPRE_Int part;
|
HYPRE_Int part;
|
||||||
HYPRE_Int vector_type = hypre_SStructVectorObjectType(vector);
|
HYPRE_Int vector_type;
|
||||||
|
|
||||||
/* GEC1002 destroying dataindices and data in vector */
|
/* GEC1002 destroying data indices and data in vector */
|
||||||
|
|
||||||
if (vector)
|
if (vector)
|
||||||
{
|
{
|
||||||
|
vector_type = hypre_SStructVectorObjectType(vector);
|
||||||
hypre_SStructVectorRefCount(vector) --;
|
hypre_SStructVectorRefCount(vector) --;
|
||||||
if (hypre_SStructVectorRefCount(vector) == 0)
|
if (hypre_SStructVectorRefCount(vector) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2241,7 +2241,7 @@ hypre_SStructGridIntersect( hypre_SStructGrid *grid,
|
|||||||
{
|
{
|
||||||
boxman = hypre_SStructGridBoxManager(grid, part, var);
|
boxman = hypre_SStructGridBoxManager(grid, part, var);
|
||||||
}
|
}
|
||||||
else if (action == 1)
|
else
|
||||||
{
|
{
|
||||||
boxman = hypre_SStructGridNborBoxManager(grid, part, var);
|
boxman = hypre_SStructGridNborBoxManager(grid, part, var);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,7 @@ hypre_PFMGSolve( void *pfmg_vdata,
|
|||||||
double *rel_norms = (pfmg_data -> rel_norms);
|
double *rel_norms = (pfmg_data -> rel_norms);
|
||||||
HYPRE_Int *active_l = (pfmg_data -> active_l);
|
HYPRE_Int *active_l = (pfmg_data -> active_l);
|
||||||
|
|
||||||
double b_dot_b, r_dot_r, eps;
|
double b_dot_b = 0, r_dot_r, eps = 0;
|
||||||
double e_dot_e, x_dot_x;
|
double e_dot_e, x_dot_x;
|
||||||
|
|
||||||
HYPRE_Int i, l;
|
HYPRE_Int i, l;
|
||||||
|
|||||||
@ -80,8 +80,8 @@ hypre_SMGSolve( void *smg_vdata,
|
|||||||
double *norms = (smg_data -> norms);
|
double *norms = (smg_data -> norms);
|
||||||
double *rel_norms = (smg_data -> rel_norms);
|
double *rel_norms = (smg_data -> rel_norms);
|
||||||
|
|
||||||
double b_dot_b, r_dot_r, eps;
|
double b_dot_b = 0, r_dot_r, eps = 0;
|
||||||
double e_dot_e, x_dot_x;
|
double e_dot_e = 0, x_dot_x = 1;
|
||||||
|
|
||||||
HYPRE_Int i, l;
|
HYPRE_Int i, l;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user