TugJulia/julia/tests/cpp_bench/BTCS_20_20_500.cpp
nebmit 88ecf82477
test: moved to singular csv output
Changed testcases to use CSV_OUTPUT_ON isntead of CSV_OUTPUT_VERBOSE

[skip ci]
2023-11-21 13:55:37 +01:00

39 lines
1010 B
C++

#include <Eigen/Eigen>
#include <tug/Simulation.hpp>
using namespace Eigen;
using namespace tug;
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 ****
simulation.run();
}