Fixed a GNU 4.7.2 error with PETSCs MatSetVar, which expected a 1-D array and not a scalar. 4.6.3 let it pass just fine, oddly.

This commit is contained in:
Adam Nelson 2013-04-04 15:13:30 -04:00
parent b8a074b304
commit 9fc77673b4
2 changed files with 8 additions and 4 deletions

View file

@ -78,9 +78,13 @@ contains
cmfd%egrid = (/0.0_8,20.0_8/)
cmfd % indices(4) = 1 ! one energy group
end if
! set global albedo
cmfd % albedo = mesh_ % albedo
if (associated(mesh_ % albedo)) then
cmfd % albedo = mesh_ % albedo
else
cmfd % albedo = (/1.0, 1.0, 1.0, 1.0, 1.0, 1.0/)
end if
! get acceleration map
if (associated(mesh_ % map)) then

View file

@ -250,7 +250,7 @@ contains
call MatGetRow(ctx%loss%M, irow, ncols, cols, vals, ierr)
! set that row to Jacobian matrix
call MatSetValues(jac_prec, 1, irow, ncols, cols(1:ncols), vals, &
call MatSetValues(jac_prec, 1, (/irow/), ncols, cols(1:ncols), vals, &
INSERT_VALUES, ierr)
! restore the row
@ -283,7 +283,7 @@ contains
! set values in last row of matrix
if (rank == n_procs_cmfd - 1) then
phi_tmp = -phi_tmp ! negate the transpose
call MatSetValues(jac_prec, 1, n, n, (/(k,k=0,n-1)/), phi_tmp, &
call MatSetValues(jac_prec, 1, (/n/), n, (/(k,k=0,n-1)/), phi_tmp, &
INSERT_VALUES, ierr)
call MatSetValue(jac_prec, n, n, ONE, INSERT_VALUES, ierr)
end if