diff --git a/julia/tests/cpp_bench/BTCS_2027_1999_200.cpp b/julia/tests/cpp_bench/BTCS_2027_1999_200.cpp index 5c20ad1..34fb92e 100644 --- a/julia/tests/cpp_bench/BTCS_2027_1999_200.cpp +++ b/julia/tests/cpp_bench/BTCS_2027_1999_200.cpp @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) { for (int j = 0; j < cols; ++j) { - concentrations(i, j) = static_cast(i * j) / 1e6; + concentrations(i, j) = static_cast((i + 1) * (j + 1)) / 1e2; } } concentrations(10, 10) = 15000; @@ -36,17 +36,17 @@ int main(int argc, char *argv[]) { for (int j = 0; j < cols; ++j) { - alphax(i, j) = std::sin(i / 100.0) * std::cos(j / 100.0); - alphay(i, j) = std::cos(i / 100.0) * std::sin(j / 100.0); + alphax(i, j) = std::sin((i + 1) / 100.0) * std::cos((j + 1) / 100.0); + alphay(i, j) = std::cos((i + 1) / 100.0) * std::sin((j + 1) / 100.0); } } grid.setAlpha(alphax, alphay); // **** BOUNDARY **** Boundary bc = Boundary(grid); - bc.setBoundarySideConstant(BC_SIDE_LEFT, 1.5); + bc.setBoundarySideClosed(BC_SIDE_LEFT); bc.setBoundarySideConstant(BC_SIDE_RIGHT, 1.5); - bc.setBoundarySideConstant(BC_SIDE_TOP, 0.75); + bc.setBoundarySideClosed(BC_SIDE_TOP); bc.setBoundarySideConstant(BC_SIDE_BOTTOM, 0.75); // **** SIMULATION **** diff --git a/julia/tests/cpp_bench/FTCS_2027_1999_200.cpp b/julia/tests/cpp_bench/FTCS_2000_2000_500.cpp similarity index 69% rename from julia/tests/cpp_bench/FTCS_2027_1999_200.cpp rename to julia/tests/cpp_bench/FTCS_2000_2000_500.cpp index 0fb4573..cbae4e2 100644 --- a/julia/tests/cpp_bench/FTCS_2027_1999_200.cpp +++ b/julia/tests/cpp_bench/FTCS_2000_2000_500.cpp @@ -11,8 +11,8 @@ using namespace std::chrono; int main(int argc, char *argv[]) { // **** GRID **** - int rows = 2027; - int cols = 1999; + int rows = 2000; + int cols = 2000; Grid64 grid(rows, cols); MatrixXd concentrations(rows, cols); @@ -20,13 +20,10 @@ int main(int argc, char *argv[]) { for (int j = 0; j < cols; ++j) { - concentrations(i, j) = static_cast(i * j) / 1e6; + concentrations(i, j) = static_cast(((i + 1) * (j + 1)) / 1e6); } } - concentrations(10, 10) = 15000; - concentrations(2020, 1994) = 7500; - concentrations(10, 1994) = 7500; - concentrations(2020, 10) = 7500; + concentrations(1000, 1000) = 2000; grid.setConcentrations(concentrations); // Complex alpha patterns @@ -36,23 +33,23 @@ int main(int argc, char *argv[]) { for (int j = 0; j < cols; ++j) { - alphax(i, j) = std::sin(i / 100.0) * std::cos(j / 100.0); - alphay(i, j) = std::cos(i / 100.0) * std::sin(j / 100.0); + alphax(i, j) = std::sin((i + 1) / 100.0) * std::cos((j + 1) / 100.0) + 1; + alphay(i, j) = std::cos((i + 1) / 100.0) * std::sin((j + 1) / 100.0) + 1; } } grid.setAlpha(alphax, alphay); // **** BOUNDARY **** Boundary bc = Boundary(grid); - bc.setBoundarySideConstant(BC_SIDE_LEFT, 1.5); - bc.setBoundarySideConstant(BC_SIDE_RIGHT, 1.5); - bc.setBoundarySideConstant(BC_SIDE_TOP, 0.75); + bc.setBoundarySideClosed(BC_SIDE_LEFT); + bc.setBoundarySideClosed(BC_SIDE_RIGHT); + bc.setBoundarySideClosed(BC_SIDE_TOP); bc.setBoundarySideConstant(BC_SIDE_BOTTOM, 0.75); // **** SIMULATION **** Simulation simulation = Simulation(grid, bc); simulation.setTimestep(0.005); - simulation.setIterations(200); + simulation.setIterations(500); simulation.setOutputCSV(CSV_OUTPUT_ON); simulation.setOutputConsole(CONSOLE_OUTPUT_OFF); diff --git a/julia/tests/julia_bench/BTCS_2027_1999_200.jl b/julia/tests/julia_bench/BTCS_2027_1999_200.jl index 7089130..4530b9a 100644 --- a/julia/tests/julia_bench/BTCS_2027_1999_200.jl +++ b/julia/tests/julia_bench/BTCS_2027_1999_200.jl @@ -10,7 +10,7 @@ function main() grid::Grid = Grid{Float64}(rows, cols, alphaX, alphaY) - concentrations = [i * j / 1e6 for i in 1:rows, j in 1:cols] + concentrations = [i * j / 1e2 for i in 1:rows, j in 1:cols] concentrations[11, 11] = 15000 concentrations[2021, 1995] = 7500 concentrations[11, 1995] = 7500 diff --git a/julia/tests/julia_bench/FTCS_2027_1999_200.jl b/julia/tests/julia_bench/FTCS_2000_2000_500.jl similarity index 59% rename from julia/tests/julia_bench/FTCS_2027_1999_200.jl rename to julia/tests/julia_bench/FTCS_2000_2000_500.jl index 0d8c81d..341e954 100644 --- a/julia/tests/julia_bench/FTCS_2027_1999_200.jl +++ b/julia/tests/julia_bench/FTCS_2000_2000_500.jl @@ -2,32 +2,29 @@ include("../../tug/Simulation.jl") function main() # **** GRID **** - rows::Int = 2027 - cols::Int = 1999 + rows::Int = 2000 + cols::Int = 2000 - alphaX = [sin(i / 100) * cos(j / 100) for i in 1:rows, j in 1:cols] - alphaY = [cos(i / 100) * sin(j / 100) for i in 1:rows, j in 1:cols] + alphaX = [sin(i / 100) * cos(j / 100) + 1 for i in 1:rows, j in 1:cols] + alphaY = [cos(i / 100) * sin(j / 100) + 1 for i in 1:rows, j in 1:cols] grid::Grid = Grid{Float64}(rows, cols, alphaX, alphaY) - concentrations = [i * j / 1e6 for i in 1:rows, j in 1:cols] - concentrations[11, 11] = 15000 - concentrations[2021, 1995] = 7500 - concentrations[11, 1995] = 7500 - concentrations[2021, 11] = 7500 + concentrations = [(i * j) / 1e6 for i in 1:rows, j in 1:cols] + concentrations[1001, 1001] = 2000 setConcentrations!(grid, concentrations) # **** BOUNDARY **** bc::Boundary = Boundary(grid) setBoundarySideClosed!(bc, LEFT) - setBoundarySideConstant!(bc, RIGHT, 1.5) + setBoundarySideClosed!(bc, RIGHT) setBoundarySideClosed!(bc, TOP) setBoundarySideConstant!(bc, BOTTOM, 0.75) # **** SIMULATION **** simulation::Simulation = Simulation(grid, bc, FTCS) simulation = setTimestep(simulation, 0.005) - simulation = setIterations(simulation, 200) + simulation = setIterations(simulation, 500) simulation = setOutputConsole(simulation, CONSOLE_OUTPUT_OFF) simulation = setOutputCSV(simulation, CSV_OUTPUT_ON)