diff --git a/app/main_1D.cpp b/app/main_1D.cpp index 2fb7c21..013676c 100644 --- a/app/main_1D.cpp +++ b/app/main_1D.cpp @@ -1,8 +1,6 @@ #include #include -#include // for copy, max -#include #include #include // for std #include // for vector @@ -18,8 +16,8 @@ int main(int argc, char *argv[]) { int n = 20; // create input + diffusion coefficients for each grid cell - std::vector alpha(n, 1 * pow(10, -1)); - std::vector field(n, 1 * std::pow(10, -6)); + std::vector alpha(n, 1e-1); + std::vector field(n, 1e-6); std::vector bc(n + 2, {0, 0}); // create instance of diffusion module @@ -28,7 +26,7 @@ int main(int argc, char *argv[]) { diffu.setXDimensions(1, n); // set the boundary condition for the left ghost cell to dirichlet - bc[0] = {Diffusion::BC_CONSTANT, 5 * std::pow(10, -6)}; + bc[0] = {Diffusion::BC_CONSTANT, 5e-6}; // diffu.setBoundaryCondition(1, 0, BTCSDiffusion::BC_CONSTANT, // 5. * std::pow(10, -6)); diff --git a/app/main_2D.cpp b/app/main_2D.cpp index 502ad0e..f3d2cb5 100644 --- a/app/main_2D.cpp +++ b/app/main_2D.cpp @@ -1,5 +1,3 @@ -#include // for copy, max -#include #include #include #include @@ -18,8 +16,8 @@ int main(int argc, char *argv[]) { int m = 5; // create input + diffusion coefficients for each grid cell - std::vector alpha(n * m, 1 * pow(10, -1)); - std::vector field(n * m, 1 * std::pow(10, -6)); + std::vector alpha(n * m, 1e-1); + std::vector field(n * m, 1e-6); std::vector bc((n + 2) * (m + 2), {0, 0}); // create instance of diffusion module @@ -29,7 +27,7 @@ int main(int argc, char *argv[]) { diffu.setYDimensions(1, m); // set inlet to higher concentration without setting bc - field[12] = 5 * std::pow(10, -3); + field[12] = 5e-3; // set timestep for simulation to 1 second diffu.setTimestep(1.); diff --git a/app/main_2D_const.cpp b/app/main_2D_const.cpp index e70f8ad..cfc9aaa 100644 --- a/app/main_2D_const.cpp +++ b/app/main_2D_const.cpp @@ -1,5 +1,3 @@ -#include // for copy, max -#include #include #include #include @@ -18,8 +16,8 @@ int main(int argc, char *argv[]) { int m = 5; // create input + diffusion coefficients for each grid cell - std::vector alpha(n * m, 1 * pow(10, -1)); - std::vector field(n * m, 1 * std::pow(10, -6)); + std::vector alpha(n * m, 1e-1); + std::vector field(n * m, 1e-6); std::vector bc((n + 2) * (m + 2), {0, 0}); // create instance of diffusion module @@ -29,7 +27,7 @@ int main(int argc, char *argv[]) { diffu.setYDimensions(1, m); for (int i = 1; i <= n; i++) { - bc[(n + 2) * i] = {Diffusion::BC_CONSTANT, 5 * std::pow(10, -6)}; + bc[(n + 2) * i] = {Diffusion::BC_CONSTANT, 5e-6}; } // set timestep for simulation to 1 second diffu.setTimestep(1.); diff --git a/app/main_2D_mdl.cpp b/app/main_2D_mdl.cpp index f4eab0c..cdcd73d 100644 --- a/app/main_2D_mdl.cpp +++ b/app/main_2D_mdl.cpp @@ -1,5 +1,3 @@ -#include // for copy, max -#include #include #include #include @@ -18,7 +16,7 @@ int main(int argc, char *argv[]) { int m = 501; // create input + diffusion coefficients for each grid cell - std::vector alpha(n * m, 1 * pow(10, -1)); + std::vector alpha(n * m, 1e-1); std::vector field(n * m, 0.); std::vector bc((n + 2) * (m + 2), {0, 0});