change dx to 1/n-1
This commit is contained in:
parent
971f8212af
commit
3562f30efa
@ -50,7 +50,7 @@ void BTCSDiffusion::setBoundaryCondition(std::vector<double> input,
|
|||||||
void BTCSDiffusion::simulate(std::vector<double> &c, std::vector<double> &alpha,
|
void BTCSDiffusion::simulate(std::vector<double> &c, std::vector<double> &alpha,
|
||||||
double timestep) {
|
double timestep) {
|
||||||
// calculate dx
|
// calculate dx
|
||||||
double dx = 1. / this->dim_x;
|
double dx = 1. / (this->dim_x - 1);
|
||||||
|
|
||||||
// calculate size needed for A matrix and b,x vectors
|
// calculate size needed for A matrix and b,x vectors
|
||||||
int size = this->dim_x + 2;
|
int size = this->dim_x + 2;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user