Merge branch 'cleanup' into 'main'

Cleanup of application sources

See merge request mluebke/diffusion!19
This commit is contained in:
Max Lübke 2022-05-16 12:23:11 +02:00
commit ef84560719
4 changed files with 10 additions and 18 deletions

View File

@ -1,8 +1,6 @@
#include <diffusion/BTCSDiffusion.hpp>
#include <diffusion/BoundaryCondition.hpp>
#include <algorithm> // for copy, max
#include <cmath>
#include <iomanip>
#include <iostream> // for std
#include <vector> // 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<double> alpha(n, 1 * pow(10, -1));
std::vector<double> field(n, 1 * std::pow(10, -6));
std::vector<double> alpha(n, 1e-1);
std::vector<double> field(n, 1e-6);
std::vector<boundary_condition> 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));

View File

@ -1,5 +1,3 @@
#include <algorithm> // for copy, max
#include <cmath>
#include <diffusion/BTCSDiffusion.hpp>
#include <diffusion/BoundaryCondition.hpp>
#include <iomanip>
@ -18,8 +16,8 @@ int main(int argc, char *argv[]) {
int m = 5;
// create input + diffusion coefficients for each grid cell
std::vector<double> alpha(n * m, 1 * pow(10, -1));
std::vector<double> field(n * m, 1 * std::pow(10, -6));
std::vector<double> alpha(n * m, 1e-1);
std::vector<double> field(n * m, 1e-6);
std::vector<boundary_condition> 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.);

View File

@ -1,5 +1,3 @@
#include <algorithm> // for copy, max
#include <cmath>
#include <diffusion/BTCSDiffusion.hpp>
#include <diffusion/BoundaryCondition.hpp>
#include <iomanip>
@ -18,8 +16,8 @@ int main(int argc, char *argv[]) {
int m = 5;
// create input + diffusion coefficients for each grid cell
std::vector<double> alpha(n * m, 1 * pow(10, -1));
std::vector<double> field(n * m, 1 * std::pow(10, -6));
std::vector<double> alpha(n * m, 1e-1);
std::vector<double> field(n * m, 1e-6);
std::vector<boundary_condition> 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.);

View File

@ -1,5 +1,3 @@
#include <algorithm> // for copy, max
#include <cmath>
#include <diffusion/BTCSDiffusion.hpp>
#include <diffusion/BoundaryCondition.hpp>
#include <iomanip>
@ -18,7 +16,7 @@ int main(int argc, char *argv[]) {
int m = 501;
// create input + diffusion coefficients for each grid cell
std::vector<double> alpha(n * m, 1 * pow(10, -1));
std::vector<double> alpha(n * m, 1e-1);
std::vector<double> field(n * m, 0.);
std::vector<boundary_condition> bc((n + 2) * (m + 2), {0, 0});