From 6795ad23f887e4ebe4e74ff22f89b08adc7a4dbf Mon Sep 17 00:00:00 2001 From: Martin Schoenherr <m.schoenherr@tu-braunschweig.de> Date: Mon, 4 Dec 2023 21:16:04 +0100 Subject: [PATCH] delete Buffer2D --- src/gpu/core/LBM/Simulation.cpp | 1 - src/gpu/core/LBM/Simulation.h | 14 +----- src/gpu/core/Utilities/Buffer2D.hpp | 76 ----------------------------- 3 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 src/gpu/core/Utilities/Buffer2D.hpp diff --git a/src/gpu/core/LBM/Simulation.cpp b/src/gpu/core/LBM/Simulation.cpp index 3880ec7c6..0098fbda0 100644 --- a/src/gpu/core/LBM/Simulation.cpp +++ b/src/gpu/core/LBM/Simulation.cpp @@ -22,7 +22,6 @@ #include "Output/NeighborDebugWriter.hpp" #include "Output/VeloASCIIWriter.hpp" ////////////////////////////////////////////////////////////////////////// -#include "Utilities/Buffer2D.hpp" #include "StringUtilities/StringUtil.h" ////////////////////////////////////////////////////////////////////////// #include "PreProcessor/InitLattice.h" diff --git a/src/gpu/core/LBM/Simulation.h b/src/gpu/core/LBM/Simulation.h index f7f2840b7..fe7967120 100644 --- a/src/gpu/core/LBM/Simulation.h +++ b/src/gpu/core/LBM/Simulation.h @@ -4,10 +4,8 @@ #include <memory> #include <vector> -#include <PointerDefinitions.h> - +#include "PointerDefinitions.h" #include "LBM/LB.h" -#include "Utilities/Buffer2D.hpp" namespace vf::parallel { @@ -64,16 +62,6 @@ private: std::unique_ptr<KernelFactory> kernelFactory; std::shared_ptr<PreProcessorFactory> preProcessorFactory; - Buffer2D <real> sbuf_t; - Buffer2D <real> rbuf_t; - Buffer2D <real> sbuf_b; - Buffer2D <real> rbuf_b; - - Buffer2D <int> geo_sbuf_t; - Buffer2D <int> geo_rbuf_t; - Buffer2D <int> geo_sbuf_b; - Buffer2D <int> geo_rbuf_b; - vf::parallel::Communicator& communicator; SPtr<Parameter> para; std::shared_ptr<DataWriter> dataWriter; diff --git a/src/gpu/core/Utilities/Buffer2D.hpp b/src/gpu/core/Utilities/Buffer2D.hpp deleted file mode 100644 index 00232ec9f..000000000 --- a/src/gpu/core/Utilities/Buffer2D.hpp +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef BUFFER2D_H -#define BUFFER2D_H - -#include <iostream> -#include <stdlib.h> - -template <class T> -class Buffer2D -{ -public: - Buffer2D() - { - data = NULL; - } - Buffer2D(int r, int c) - { - data = NULL; - setSize(r, c); - } - ~Buffer2D() - { - if(data != NULL) - delete[] data; - } - void setSize(int r, int c) - { - size = r*c; - row = r; - column = c; - if(data != NULL) - delete[] data; - data = new T[size]; - } - void Empty() - { - if(data != NULL) - { - delete[] data; - data = NULL; - } - } - T& operator [] (const int i) - { - try - { - if (i > row) - { - throw i; - } - } - catch (int i) - { - std::cout << "Error: row " << i << " does not exist!" << std::endl; - exit(EXIT_FAILURE); - } - return data[i*column]; - } - T* getData() - { - return data; - } - int getSize() - { - return size; - } - int getRowSize() - { - return column; - } - -private: - T* data; - int row, column; - int size; -}; -#endif //BUFFER2D_H -- GitLab