Merge pull request #2673 from blattms/fix-tranyxyz-sub-3D

[bugfix] Fix TRANXYZ for problems with less than 3 dimensions.

Also subsumes and closes #2150.
This commit is contained in:
Bård Skaflestad 2020-06-15 17:15:48 +02:00 committed by GitHub
commit 0310fa4edf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -530,7 +530,7 @@ private:
int gc1 = std::min(cartMapper.cartesianIndex(c1), cartMapper.cartesianIndex(c2));
int gc2 = std::max(cartMapper.cartesianIndex(c1), cartMapper.cartesianIndex(c2));
if (gc2 - gc1 == 1) {
if (gc2 - gc1 == 1 && cartDims[0] > 1) {
if (tranx_deckAssigned)
// set simulator internal transmissibilities to values from inputTranx
trans_[isId] = inputTranxData[c1];
@ -538,7 +538,7 @@ private:
// Scale transmissibilities with scale factor from inputTranx
trans_[isId] *= inputTranxData[c1];
}
else if (gc2 - gc1 == cartDims[0]) {
else if (gc2 - gc1 == cartDims[0] && cartDims[1] > 1) {
if (trany_deckAssigned)
// set simulator internal transmissibilities to values from inputTrany
trans_[isId] = inputTranyData[c1];

View File

@ -552,12 +552,12 @@ private:
int gc1 = std::min(cartIdx1, cartIdx2);
int gc2 = std::max(cartIdx1, cartIdx2);
if (gc2 - gc1 == 1) {
if (gc2 - gc1 == 1 && cartDims[0] > 1 ) {
tranx.data[gc1] = globalTrans->transmissibility(c1, c2);
continue; // skip other if clauses as they are false, last one needs some computation
}
if (gc2 - gc1 == cartDims[0]) {
if (gc2 - gc1 == cartDims[0] && cartDims[1] > 1) {
trany.data[gc1] = globalTrans->transmissibility(c1, c2);
continue; // skipt next if clause as it needs some computation
}