diff --git a/src/main.cpp b/src/main.cpp index b4ef449..9735f11 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,26 +6,25 @@ using namespace std; int main(int argc, char *argv[]) { + // count of grid cells int x = 20; + // create input + diffusion coefficients for each grid cell std::vector alpha(x, 1 * pow(10, -1)); std::vector input(x, 1 * std::pow(10, -6)); - std::vector bc_left, bc_right; - - bc_left.push_back(5. * std::pow(10, -6)); - bc_right.push_back(-1); + // create instance of diffusion module BTCSDiffusion diffu(x); + // set the boundary condition for the left ghost cell to dirichlet diffu.setBoundaryCondition(0, 5. * std::pow(10, -6), BTCSDiffusion::BC_DIRICHLET); + + // set timestep for simulation to 1 second diffu.setTimestep(1.); - // diffu.setBoundaryCondition(bc_left, BTCSDiffusion::LEFT); - // we don't need this since Neumann condition with gradient of 0 is set per - // default - // diffu.setBoundaryCondition(bc_right, BTCSDiffusion::RIGHT); - + // loop 100 times + // output is currently generated by the method itself for (int i = 0; i < 100; i++) { diffu.simulate(input, alpha); }