#include #include #include #include using namespace Eigen; using namespace tug; using namespace std::chrono; int main(int argc, char *argv[]) { // **** GRID **** int rows = 1024; int cols = 1000; Grid64 grid(rows, cols); MatrixXd concentrations = MatrixXd::Constant(rows, cols, 0.5); concentrations(10, 10) = 15000; concentrations(1014, 990) = 7500; concentrations(10, 990) = 7500; concentrations(1014, 10) = 7500; grid.setConcentrations(concentrations); MatrixXd alphax = MatrixXd::Constant(rows, cols, 1.25); MatrixXd alphay = MatrixXd::Constant(rows, cols, 1.1); alphax.block(0, 0, 100, cols) = MatrixXd::Constant(100, cols, 0.5); alphax.block(100, 0, 100, cols) = MatrixXd::Constant(100, cols, 0.8); alphay.block(0, 0, rows, 200) = MatrixXd::Constant(rows, 200, 0.6); alphay.block(0, 200, rows, 200) = MatrixXd::Constant(rows, 200, 0.9); 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.01); simulation.setIterations(100); 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; }