Skip to content

Commit

Permalink
fix a bug that shows up when diagonal coupling is turned on with arra…
Browse files Browse the repository at this point in the history
…y variables idaholab#23123
  • Loading branch information
YaqiWang committed Jan 12, 2023
1 parent f68c959 commit 7555390
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions framework/include/base/Assembly.h
Expand Up @@ -1629,13 +1629,20 @@ class Assembly
unsigned int jvar,
const RealEigenMatrix & v) const
{
unsigned int pace = ((ivar == jvar && _component_block_diagonal[ivar]) ? 0 : nphi);
unsigned int saved_j = j;
for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
if (ivar == jvar && _component_block_diagonal[ivar])
{
j = saved_j;
for (unsigned int l = 0; l < v.cols(); ++l, j += pace)
ke(i, j) += v(k, l);
for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
ke(i, j) += v(k, k);
}
else
{
unsigned int saved_j = j;
for (unsigned int k = 0; k < v.rows(); ++k, i += ntest)
{
j = saved_j;
for (unsigned int l = 0; l < v.cols(); ++l, j += nphi)
ke(i, j) += v(k, l);
}
}
}

Expand Down

0 comments on commit 7555390

Please sign in to comment.