Refactor loop breakout to same syntax as in fillMatrix
This commit is contained in:
parent
6ea3bf0182
commit
08dba0975b
@ -269,15 +269,16 @@ void BTCSDiffusion::fillVectorFromRow2D(Eigen::Map<DMatrixRowMajor> &c,
|
|||||||
|
|
||||||
if (tmp_bc.type == BTCSDiffusion::BC_CONSTANT) {
|
if (tmp_bc.type == BTCSDiffusion::BC_CONSTANT) {
|
||||||
b_vector[offset * row + j] = tmp_bc.value;
|
b_vector[offset * row + j] = tmp_bc.value;
|
||||||
} else {
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
double y_values[3];
|
double y_values[3];
|
||||||
y_values[0] =
|
y_values[0] =
|
||||||
(row != 0 ? c(row - 1, j - 1)
|
(row != 0 ? c(row - 1, j - 1)
|
||||||
: getBCFromFlux(tmp_bc, c(row, j - 1), alpha[j - 1]));
|
: getBCFromFlux(tmp_bc, c(row, j - 1), alpha[j - 1]));
|
||||||
y_values[1] = c(row, j - 1);
|
y_values[1] = c(row, j - 1);
|
||||||
y_values[2] = (row != nrow - 1
|
y_values[2] =
|
||||||
? c(row + 1, j - 1)
|
(row != nrow - 1 ? c(row + 1, j - 1)
|
||||||
: getBCFromFlux(tmp_bc, c(row, j - 1), alpha[j - 1]));
|
: getBCFromFlux(tmp_bc, c(row, j - 1), alpha[j - 1]));
|
||||||
|
|
||||||
double t0_c =
|
double t0_c =
|
||||||
@ -286,7 +287,6 @@ void BTCSDiffusion::fillVectorFromRow2D(Eigen::Map<DMatrixRowMajor> &c,
|
|||||||
b_vector[offset * row + j] = -c(row, j - 1) - t0_c;
|
b_vector[offset * row + j] = -c(row, j - 1) - t0_c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void BTCSDiffusion::setTimestep(double time_step) {
|
void BTCSDiffusion::setTimestep(double time_step) {
|
||||||
this->time_step = time_step;
|
this->time_step = time_step;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user