diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b33dfec..c51ac9f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,3 +1,5 @@ add_executable(first_example first_example.cpp) +add_executable(second_example second_example.cpp) -target_link_libraries(first_example tug) \ No newline at end of file +target_link_libraries(first_example tug) +target_link_libraries(second_example tug) \ No newline at end of file diff --git a/examples/second_example.cpp b/examples/second_example.cpp new file mode 100644 index 0000000..897fdb1 --- /dev/null +++ b/examples/second_example.cpp @@ -0,0 +1,57 @@ +#include "tug/BoundaryCondition.hpp" +#include + +#include + +using namespace std; +using namespace tug::diffusion; +using namespace tug::bc; + +int main(int argc, char *argv[]) { + + int dim = 2; + int n = 5; + int m = 5; + + vector alpha(n * m, 1e-1); + vector field(n * m, 0); + field[0] = 1e-6; + // for (int i = 1; i<20; i++) { + // for (int j = 0; j<20; j++ ) { + // field[i] = 0; + // } + // } + + // print field + cout << "Initial field:" << endl; + for (int i = 0; i &A_matrix, /** * Solving linear equation system with brutal implementation of the Thomas - * algorithm. + * algorithm (a.k.a. Tridiagonal matrix algorithm). * * \param A_matrix The A matrix represented as a sparse matrix using Eigen * library.