40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#include <Eigen/Eigen>
|
|
#include <tug/Simulation.hpp>
|
|
|
|
using namespace Eigen;
|
|
using namespace tug;
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
// **** GRID ****
|
|
int rows = 100;
|
|
int cols = 100;
|
|
Grid64 grid(rows, cols);
|
|
|
|
MatrixXd concentrations = MatrixXd::Constant(rows, cols, 0);
|
|
concentrations(10, 10) = 2000;
|
|
concentrations(90, 90) = 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.setBoundarySideConstant(BC_SIDE_LEFT, 1);
|
|
bc.setBoundarySideConstant(BC_SIDE_RIGHT, 1);
|
|
bc.setBoundarySideConstant(BC_SIDE_TOP, 0);
|
|
bc.setBoundarySideConstant(BC_SIDE_BOTTOM, 2);
|
|
|
|
// **** SIMULATION ****
|
|
Simulation simulation = Simulation(grid, bc);
|
|
simulation.setTimestep(0.05);
|
|
simulation.setIterations(1000);
|
|
simulation.setOutputCSV(CSV_OUTPUT_VERBOSE);
|
|
simulation.setOutputConsole(CONSOLE_OUTPUT_OFF);
|
|
|
|
// **** RUN SIMULATION ****
|
|
simulation.run();
|
|
}
|