Added comparison to machine epsilon when filling vector
This commit is contained in:
parent
04cdadc23d
commit
9c3c478c63
@ -25,6 +25,8 @@
|
|||||||
#define omp_get_thread_num() 0
|
#define omp_get_thread_num() 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DOUBLE_MACHINE_EPSILON 1.93e-34
|
||||||
|
|
||||||
constexpr int BTCS_MAX_DEP_PER_CELL = 3;
|
constexpr int BTCS_MAX_DEP_PER_CELL = 3;
|
||||||
constexpr int BTCS_2D_DT_SIZE = 2;
|
constexpr int BTCS_2D_DT_SIZE = 2;
|
||||||
Diffusion::BTCSDiffusion::BTCSDiffusion(unsigned int dim) : grid_dim(dim) {
|
Diffusion::BTCSDiffusion::BTCSDiffusion(unsigned int dim) : grid_dim(dim) {
|
||||||
@ -302,7 +304,8 @@ void Diffusion::BTCSDiffusion::fillVectorFromRow(
|
|||||||
}
|
}
|
||||||
|
|
||||||
double t0_c_j = time_step * alpha[j] * (t0_c[j] / (dx * dx));
|
double t0_c_j = time_step * alpha[j] * (t0_c[j] / (dx * dx));
|
||||||
b_vector[j + 1] = -c[j] - t0_c_j;
|
double value = (c[j] < DOUBLE_MACHINE_EPSILON ? .0 : c[j]);
|
||||||
|
b_vector[j + 1] = -value - t0_c_j;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is not correct currently.We will fix this when we are able to define
|
// this is not correct currently.We will fix this when we are able to define
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user