#include "BTCSDiffusion.hpp" // for BTCSDiffusion, BTCSDiffusion::BC_DIRICHLET #include // for copy, max #include // for std #include // for vector using namespace std; int main(int argc, char *argv[]) { // dimension of grid int dim = 1; int n = 20; // create input + diffusion coefficients for each grid cell std::vector alpha(n, 1 * pow(10, -1)); std::vector field(n, 1 * std::pow(10, -6)); // create instance of diffusion module BTCSDiffusion diffu(dim); diffu.setXDimensions(1, n); // set the boundary condition for the left ghost cell to dirichlet diffu.setBoundaryCondition(0, 5. * std::pow(10, -6), BTCSDiffusion::BC_CONSTANT); // set timestep for simulation to 1 second diffu.setTimestep(1.); // loop 100 times // output is currently generated by the method itself for (int i = 0; i < 100; i++) { diffu.simulate(field, alpha); } return 0; }