#include #include #include #include using namespace Eigen; using namespace tug; using namespace std::chrono; int main(int argc, char *argv[]) { // **** GRID **** int rows = 20; int cols = 20; Grid64 grid(rows, cols); MatrixXd concentrations = MatrixXd::Constant(rows, cols, 0); concentrations(10, 10) = 2000; grid.setConcentrations(concentrations); MatrixXd alphax = MatrixXd::Constant(rows, cols, 1); MatrixXd alphay = MatrixXd::Constant(rows, cols, 1); grid.setAlpha(alphax, alphay); // **** BOUNDARY **** Boundary bc = Boundary(grid); bc.setBoundarySideClosed(BC_SIDE_LEFT); bc.setBoundarySideClosed(BC_SIDE_RIGHT); bc.setBoundarySideClosed(BC_SIDE_TOP); bc.setBoundarySideClosed(BC_SIDE_BOTTOM); // **** SIMULATION **** Simulation simulation = Simulation(grid, bc); simulation.setTimestep(0.1); simulation.setIterations(500); simulation.setOutputCSV(CSV_OUTPUT_ON); simulation.setOutputConsole(CONSOLE_OUTPUT_OFF); // **** RUN SIMULATION **** auto start = high_resolution_clock::now(); simulation.run(); auto stop = high_resolution_clock::now(); auto duration = duration_cast(stop - start); std::cout << duration.count() << std::endl; }