You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (int i = 1; i < totalEq; i++) {//copy the lower tri component to the upper tri
ncol = cols_per_row[i];
HYPRE_IJMatrixGetValues(*p_matrix, -nrow, &ncol, &id_rows[i], cols, val);
for (int j = 0; j < ncol; j++) {
irow = cols[j];
if (i!=irow)
HYPRE_IJMatrixSetValues(*p_matrix, nrow, &nj, &irow, &i, &val[j]);
}
}
It is not working during solving. I did test the whole entry testing and it worked well, even under multi-threaded processes. I tested this hyperij_set_symmetry() on the full entry matrix and it validated the functionality.
Is there re-initialization needed after IJMatrixAssembly()?
thanks!
The text was updated successfully, but these errors were encountered:
To benchmark Hypre Linear IJ matrix interface further, I made an equivalent symmetric assembly of IJ matrix using the function below:
static HYPRE_IJMatrix* p_matrix;
static HYPER_Int TotalEq;
HYPRESOL_API void hyperij_set_symmetry( )
{
int nrow = 1, nj = 1;
HYPRE_Int* cols = new HYPRE_Int[totalEq];
HYPRE_Int* cols_per_row = new HYPRE_Int[totalEq];
HYPRE_Int* id_rows = new HYPRE_Int[totalEq];
HYPRE_Complex* val = new HYPRE_Complex[totalEq];
HYPRE_Int irow, ncol;
for (int i = 0; i < totalEq; i++) id_rows[i] = i;
HYPRE_IJMatrixGetRowCounts(*p_matrix, totalEq, id_rows, cols_per_row);
for (int i = 1; i < totalEq; i++) {//copy the lower tri component to the upper tri
ncol = cols_per_row[i];
HYPRE_IJMatrixGetValues(*p_matrix, -nrow, &ncol, &id_rows[i], cols, val);
for (int j = 0; j < ncol; j++) {
irow = cols[j];
if (i!=irow)
HYPRE_IJMatrixSetValues(*p_matrix, nrow, &nj, &irow, &i, &val[j]);
}
}
delete[] id_rows;
delete[] cols_per_row;
delete[] cols;
delete[] val;
}
So, after the IJ matrix assembly with only the lower tri components, I make the call
HYPRE_IJMatrixAssemble(*p_matrix);
hyperij_set_symmetry();
It is not working during solving. I did test the whole entry testing and it worked well, even under multi-threaded processes. I tested this hyperij_set_symmetry() on the full entry matrix and it validated the functionality.
Is there re-initialization needed after IJMatrixAssembly()?
thanks!
The text was updated successfully, but these errors were encountered: