From 893a2856c724b4002896b130fd62a42135209a7c Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Fri, 18 Feb 2022 11:14:56 +0100 Subject: [PATCH 1/2] Add CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 8a0d9cea8121f62ea518a9ab2c48ffc334104ecd Author: Max Lübke Date: Tue Feb 15 20:31:32 2022 +0100 Added tidy analyzer options commit bd59a32420acb282ceba80c13e1f727d1ae3a767 Author: Max Lübke Date: Tue Feb 15 11:09:33 2022 +0100 Update .gitlab-ci.yml file commit ccfcec4f9c0c43341f3b73f2da8ac83ee67e35dc Author: Max Lübke Date: Tue Feb 15 10:55:08 2022 +0100 Update .gitlab-ci.yml file commit c2da2361e0e152a8fd51f0e89ab4fb0afbad57a1 Author: Max Lübke Date: Tue Feb 15 10:47:40 2022 +0100 Update .gitlab-ci.yml file commit 6c10f3b42ae3479f747aab012f7411d48493c426 Author: Max Lübke Date: Tue Feb 15 10:47:16 2022 +0100 Update .gitlab-ci.yml file commit 8f96ccc33556d97e5d37fd448b3f12e024777274 Author: Max Lübke Date: Tue Feb 15 10:46:25 2022 +0100 Update .gitlab-ci.yml file commit afdb0447625d35d6ca989744e94a44f90392d1c7 Author: Max Lübke Date: Tue Feb 15 10:44:56 2022 +0100 Update .gitlab-ci.yml file --- .gitlab-ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5b38c99 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +image: sobc/gitlab-ci + +stages: + - build + - test + +before_script: + - apt-get update && apt-get install -y libeigen3-dev + +build: + stage: build + script: + - mkdir build && cd build + - cmake .. + - make + +lint: + stage: test + script: + - mkdir build && cd build + - cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-checks=cppcoreguidelines-*,clang-analyzer-*,performance-*,readability-*, modernize-*" .. + - make From 21bb3d13385d4c3b27a544a16bcf88f010aabe0c Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Mon, 21 Feb 2022 12:08:13 +0100 Subject: [PATCH 2/2] Fix wrong domain_size datatype --- src/BTCSDiffusion.cpp | 6 +++--- src/BTCSDiffusion.hpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/BTCSDiffusion.cpp b/src/BTCSDiffusion.cpp index 92855dc..da10b26 100644 --- a/src/BTCSDiffusion.cpp +++ b/src/BTCSDiffusion.cpp @@ -20,7 +20,7 @@ BTCSDiffusion::BTCSDiffusion(unsigned int dim) : grid_dim(dim) { deltas.resize(dim, 1); } -void BTCSDiffusion::setXDimensions(unsigned int domain_size, +void BTCSDiffusion::setXDimensions(double domain_size, unsigned int n_grid_cells) { assert(this->grid_dim > 0); this->domain_size[0] = domain_size; @@ -29,7 +29,7 @@ void BTCSDiffusion::setXDimensions(unsigned int domain_size, updateInternals(); } -void BTCSDiffusion::setYDimensions(unsigned int domain_size, +void BTCSDiffusion::setYDimensions(double domain_size, unsigned int n_grid_cells) { assert(this->grid_dim > 1); this->domain_size[1] = domain_size; @@ -38,7 +38,7 @@ void BTCSDiffusion::setYDimensions(unsigned int domain_size, updateInternals(); } -void BTCSDiffusion::setZDimensions(unsigned int domain_size, +void BTCSDiffusion::setZDimensions(double domain_size, unsigned int n_grid_cells) { assert(this->grid_dim > 2); this->domain_size[2] = domain_size; diff --git a/src/BTCSDiffusion.hpp b/src/BTCSDiffusion.hpp index ea3473d..7614ce5 100644 --- a/src/BTCSDiffusion.hpp +++ b/src/BTCSDiffusion.hpp @@ -48,7 +48,7 @@ public: * @param n_grid_cells Number of grid cells in x direction the domain is * divided to. */ - void setXDimensions(unsigned int domain_size, unsigned int n_grid_cells); + void setXDimensions(double domain_size, unsigned int n_grid_cells); /*! * Define the grid in y direction. @@ -59,7 +59,7 @@ public: * @param n_grid_cells Number of grid cells in y direction the domain is * divided to. */ - void setYDimensions(unsigned int domain_size, unsigned int n_grid_cells); + void setYDimensions(double domain_size, unsigned int n_grid_cells); /*! * Define the grid in z direction. @@ -70,7 +70,7 @@ public: * @param n_grid_cells Number of grid cells in z direction the domain is * divided to. */ - void setZDimensions(unsigned int domain_size, unsigned int n_grid_cells); + void setZDimensions(double domain_size, unsigned int n_grid_cells); /*! * Returns the number of grid cells in x direction.