diff --git a/src/BTCSDiffusion.cpp b/src/BTCSDiffusion.cpp index 6a95b1c..7e2ffbc 100644 --- a/src/BTCSDiffusion.cpp +++ b/src/BTCSDiffusion.cpp @@ -5,8 +5,6 @@ #include #include #include -#include -#include #include #include @@ -145,20 +143,14 @@ void BTCSDiffusion::simulate1D(std::vector &c, boundary_condition left, b_vector[i] = -c[i + !(left_is_constant)]; } - std::cout << b_vector << "\n" << A_matrix << std::endl; - Eigen::SparseLU, Eigen::COLAMDOrdering> solver; solver.analyzePattern(A_matrix); solver.factorize(A_matrix); - std::cout << solver.lastErrorMessage() << std::endl; - x_vector = solver.solve(b_vector); - std::cout << std::setprecision(10) << x_vector << std::endl << std::endl; - for (int i = 0; i < c.size(); i++) { c[i] = x_vector[i + !left_is_constant]; } diff --git a/src/main.cpp b/src/main.cpp index cefb789..9802e1f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,7 @@ #include "BTCSDiffusion.hpp" // for BTCSDiffusion, BTCSDiffusion::BC_DIRICHLET +#include #include // for copy, max +#include #include // for std #include // for vector using namespace std; @@ -27,10 +29,20 @@ int main(int argc, char *argv[]) { // set timestep for simulation to 1 second diffu.setTimestep(1.); + cout << setprecision(12); + // loop 100 times // output is currently generated by the method itself for (int i = 0; i < 100; i++) { diffu.simulate(field, alpha); + + cout << "Iteration: " << i << "\n\n"; + + for (int j = 0; j < field.size(); j++) { + cout << field[j] << "\n"; + } + + cout << "\n" << endl; } return 0;