From 7d499b75c54bac1eba4a1d183573e563a8203059 Mon Sep 17 00:00:00 2001 From: Hannes Signer Date: Sat, 8 Nov 2025 12:09:48 +0100 Subject: [PATCH] remove old examples --- examples/BTCS_2D_proto_example.cpp | 84 ------------------------ examples/FTCS_2D_proto_closed_mdl.cpp | 90 -------------------------- examples/FTCS_2D_proto_example_mdl.cpp | 81 ----------------------- 3 files changed, 255 deletions(-) delete mode 100644 examples/BTCS_2D_proto_example.cpp delete mode 100644 examples/FTCS_2D_proto_closed_mdl.cpp delete mode 100644 examples/FTCS_2D_proto_example_mdl.cpp diff --git a/examples/BTCS_2D_proto_example.cpp b/examples/BTCS_2D_proto_example.cpp deleted file mode 100644 index c09d93d..0000000 --- a/examples/BTCS_2D_proto_example.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace tug; - -int main(int argc, char *argv[]) { - // EASY_PROFILER_ENABLE; - // profiler::startListen(); - // ************** - // **** GRID **** - // ************** - // profiler::startListen(); - // create a grid with a 20 x 20 field - int row = 40; - int col = 50; - - // (optional) set the domain, e.g.: - // grid.setDomain(20, 20); - - // (optional) set the concentrations, e.g.: - // MatrixXd concentrations = MatrixXd::Constant(20,20,1000); // - // #row,#col,value grid.setConcentrations(concentrations); - MatrixXd concentrations = MatrixXd::Constant(row, col, 0); - concentrations(10, 10) = 2000; - Grid64 grid(concentrations); - - // (optional) set alphas of the grid, e.g.: - // MatrixXd alphax = MatrixXd::Constant(20,20,1); // row,col,value - // MatrixXd alphay = MatrixXd::Constant(20,20,1); // row,col,value - // grid.setAlpha(alphax, alphay); - - // ****************** - // **** BOUNDARY **** - // ****************** - - // create a boundary with constant values - Boundary bc = Boundary(grid); - bc.setBoundarySideClosed(BC_SIDE_LEFT); - bc.setBoundarySideClosed(BC_SIDE_RIGHT); - bc.setBoundarySideClosed(BC_SIDE_TOP); - bc.setBoundarySideClosed(BC_SIDE_BOTTOM); - // bc.setBoundarySideConstant(BC_SIDE_LEFT, 0); - // bc.setBoundarySideConstant(BC_SIDE_RIGHT, 0); - // bc.setBoundarySideConstant(BC_SIDE_TOP, 0); - // bc.setBoundarySideConstant(BC_SIDE_BOTTOM, 0); - - // (optional) set boundary condition values for one side, e.g.: - // VectorXd bc_left_values = VectorXd::Constant(20,1); // length,value - // bc.setBoundaryConditionValue(BC_SIDE_LEFT, bc_left_values); // side,values - // VectorXd bc_zero_values = VectorXd::Constant(20,0); - // bc.setBoundaryConditionValue(BC_SIDE_LEFT, bc_zero_values); - // bc.setBoundaryConditionValue(BC_SIDE_RIGHT, bc_zero_values); - // VectorXd bc_front_values = VectorXd::Constant(20,2000); - // bc.setBoundaryConditionValue(BC_SIDE_TOP, bc_front_values); - // bc.setBoundaryConditionValue(BC_SIDE_BOTTOM, bc_zero_values); - - // ************************ - // **** SIMULATION ENV **** - // ************************ - - // set up a simulation environment - Diffusion simulation(grid, bc); // grid,boundary - - // set the timestep of the simulation - simulation.setTimestep(0.1); // timestep - - // set the number of iterations - simulation.setIterations(300); - - // set kind of output [CSV_OUTPUT_OFF (default), CSV_OUTPUT_ON, - // CSV_OUTPUT_VERBOSE] - simulation.setOutputCSV(CSV_OUTPUT_XTREME); - - // **** RUN SIMULATION **** - - // run the simulation - - // EASY_BLOCK("SIMULATION") - simulation.run(); - // EASY_END_BLOCK; - // profiler::dumpBlocksToFile("test_profile.prof"); - // profiler::stopListen(); -} diff --git a/examples/FTCS_2D_proto_closed_mdl.cpp b/examples/FTCS_2D_proto_closed_mdl.cpp deleted file mode 100644 index 69b31c3..0000000 --- a/examples/FTCS_2D_proto_closed_mdl.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file FTCS_2D_proto_closed_mdl.cpp - * @author Hannes Signer, Philipp Ungrund, MDL - * @brief Creates a TUG simulation in 2D with FTCS approach and closed boundary - * condition; optional command line argument: number of cols and rows - * - */ - -#include -#include -#include -#include - -using namespace Eigen; -using namespace tug; - -int main(int argc, char *argv[]) { - - int row = 64; - - if (argc == 2) { - // no cmd line argument, take col=row=64 - row = atoi(argv[1]); - } - int col = row; - - std::cout << "Nrow =" << row << std::endl; - // ************** - // **** GRID **** - // ************** - - // create a grid with a 20 x 20 field - int n2 = row / 2 - 1; - - // (optional) set the domain, e.g.: - // grid.setDomain(20, 20); - - // (optional) set the concentrations, e.g.: - // MatrixXd concentrations = MatrixXd::Constant(20,20,1000); // - // #row,#col,value - MatrixXd concentrations = MatrixXd::Constant(row, col, 0); - concentrations(n2, n2) = 1; - concentrations(n2, n2 + 1) = 1; - concentrations(n2 + 1, n2) = 1; - concentrations(n2 + 1, n2 + 1) = 1; - Grid64 grid(concentrations); - - // (optional) set alphas of the grid, e.g.: - MatrixXd alphax = MatrixXd::Constant(row, col, 1E-4); // row,col,value - MatrixXd alphay = MatrixXd::Constant(row, col, 1E-6); // row,col,value - grid.setAlpha(alphax, alphay); - - // ****************** - // **** BOUNDARY **** - // ****************** - - // create a boundary with constant values - Boundary bc = Boundary(grid); - - // (optional) set boundary condition values for one side, e.g.: - bc.setBoundarySideClosed(BC_SIDE_LEFT); // side,values - bc.setBoundarySideClosed(BC_SIDE_RIGHT); - bc.setBoundarySideClosed(BC_SIDE_TOP); - bc.setBoundarySideClosed(BC_SIDE_BOTTOM); - - // ************************ - // **** SIMULATION ENV **** - // ************************ - - // set up a simulation environment - Diffusion simulation( - grid, bc); // grid,boundary,simulation-approach - - // set the timestep of the simulation - simulation.setTimestep(10000); // timestep - - // set the number of iterations - simulation.setIterations(100); - - // (optional) set kind of output [CSV_OUTPUT_OFF (default), CSV_OUTPUT_ON, - // CSV_OUTPUT_VERBOSE] - simulation.setOutputCSV(CSV_OUTPUT_VERBOSE); - - // **** RUN SIMULATION **** - - // run the simulation - simulation.run(); - - return 0; -} diff --git a/examples/FTCS_2D_proto_example_mdl.cpp b/examples/FTCS_2D_proto_example_mdl.cpp deleted file mode 100644 index 41ddb91..0000000 --- a/examples/FTCS_2D_proto_example_mdl.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file FTCS_2D_proto_example.cpp - * @author Hannes Signer, Philipp Ungrund - * @brief Creates a prototypical standard TUG simulation in 2D with FTCS - * approach and constant boundary condition - * - */ - -#include -#include - -using namespace Eigen; -using namespace tug; - -int main(int argc, char *argv[]) { - - // ************** - // **** GRID **** - // ************** - - // create a grid with a 20 x 20 field - int row = 64; - int col = 64; - int n2 = row / 2 - 1; - - // (optional) set the domain, e.g.: - // grid.setDomain(20, 20); - - // (optional) set the concentrations, e.g.: - // MatrixXd concentrations = MatrixXd::Constant(20,20,1000); // - // #row,#col,value - MatrixXd concentrations = MatrixXd::Constant(row, col, 0); - concentrations(n2, n2) = 1; - concentrations(n2, n2 + 1) = 1; - concentrations(n2 + 1, n2) = 1; - concentrations(n2 + 1, n2 + 1) = 1; - Grid64 grid(concentrations); - - // (optional) set alphas of the grid, e.g.: - MatrixXd alphax = MatrixXd::Constant(row, col, 1E-4); // row,col,value - MatrixXd alphay = MatrixXd::Constant(row, col, 1E-6); // row,col,value - grid.setAlpha(alphax, alphay); - - // ****************** - // **** BOUNDARY **** - // ****************** - - // create a boundary with constant values - Boundary bc = Boundary(grid); - - // (optional) set boundary condition values for one side, e.g.: - bc.setBoundarySideConstant(BC_SIDE_LEFT, 0); // side,values - bc.setBoundarySideConstant(BC_SIDE_RIGHT, 0); - bc.setBoundarySideConstant(BC_SIDE_TOP, 0); - bc.setBoundarySideConstant(BC_SIDE_BOTTOM, 0); - - // ************************ - // **** SIMULATION ENV **** - // ************************ - - // set up a simulation environment - Diffusion simulation( - grid, bc); // grid,boundary,simulation-approach - - // (optional) set the timestep of the simulation - simulation.setTimestep(1000); // timestep - - // (optional) set the number of iterations - simulation.setIterations(5); - - // (optional) set kind of output [CSV_OUTPUT_OFF (default), CSV_OUTPUT_ON, - // CSV_OUTPUT_VERBOSE] - simulation.setOutputCSV(CSV_OUTPUT_OFF); - - // **** RUN SIMULATION **** - - // run the simulation - simulation.run(); - - return 0; -}