From b26a3c2e96a9eadbed3cff6aece35020a91edd2e Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Thu, 1 Oct 2020 16:35:45 +0200 Subject: [PATCH] Update do dev. --- CMakeLists.txt | 4 ++++ CONTRIBUTING.md | 20 +++++++++++++++++-- .../VelocityBCAlgorithm.cpp | 2 +- .../Interactors/D3Q27Interactor.h | 1 - src/cpu/VirtualFluidsCore/LBM/D3Q27System.h | 1 - .../Parallel/NullCommunicator.h | 2 +- .../VirtualFluidsCore/Utilities/MemoryUtil.h | 15 +++++++------- 7 files changed, 32 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01f46ac17..fbea2c2bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,9 @@ project(VirtualFluids CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CUDA_STANDARD 14) +set(CMAKE_CUDA_STANDARD_REQUIRED TRUE) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER ".cmake") set(libraryFolder "libs") @@ -45,6 +48,7 @@ option(BUILD_SHARED_LIBS "" ON) if(POLICY CMP0104) cmake_policy(SET CMP0104 NEW) set(CMAKE_CUDA_ARCHITECTURES 30) + # with cuda 11 the minimum architecture is 52 endif() ################################################################################# diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 54a3e307b..4bf538b84 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ -Contributing -============ +# Contributing + If you want to contribute to VirtualFluids, your help is very welcome. To contribute use a pull request as follows: @@ -23,3 +23,19 @@ To contribute use a pull request as follows: your extra branch(es). And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code. + +## Documentation + +To build sustainable research software, it is mandatory to document code. +Even if it turns out that some developments are not continued, documentation is important to help future scientists to learn from the own experiences. + +The documentation of the source code takes place… + +- in commit messages + - As it is possible to put all the information into the commit messages, we want to keep the messages short and on a higher level of abstraction. + - The commit message should briefly summarize what the commit does to the code. + +- in source code + - VirtualFluids is using Doxygen to generate Documentation from within the source code + - In most of the cases comment should describe ***why*** something was implemented and not ***how***. + - if available add formulars, references to scripts, paper, and all information you got linked to the implemented code diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp index 342f21143..595907b59 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp @@ -74,7 +74,7 @@ void VelocityBCAlgorithm::applyBC() const int invDir = D3Q27System::INVDIR[fdir]; LBMReal q = bcPtr->getQ(invDir); LBMReal velocity = bcPtr->getBoundaryVelocity(invDir); - LBMReal fReturn = f[invDir] - velocity; + LBMReal fReturn = f[invDir] - velocity; // TODO: compare with development distributions->setDistributionForDirection(fReturn, x1+D3Q27System::DX1[invDir], x2+D3Q27System::DX2[invDir], x3+D3Q27System::DX3[invDir], fdir); } } diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h index fd232ff9a..6ecb10f02 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h @@ -87,7 +87,6 @@ public: ObObject* clone() { throw UbException(UB_EXARGS,"not implemented"); } - void writeValidationAVSFile(std::string filename); virtual std::vector< std::pair<GbPoint3D,GbPoint3D> > getQsLineSet(); diff --git a/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h b/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h index a3acab7d8..f1c6c1c79 100644 --- a/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h +++ b/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h @@ -282,7 +282,6 @@ namespace D3Q27System static LBMReal getCompFeqForDirection(const int& direction, const LBMReal& drho,const LBMReal& vx1,const LBMReal& vx2,const LBMReal& vx3) { using namespace UbMath; - LBMReal cu_sq=1.5*(vx1*vx1+vx2*vx2+vx3*vx3); ////----- diff --git a/src/cpu/VirtualFluidsCore/Parallel/NullCommunicator.h b/src/cpu/VirtualFluidsCore/Parallel/NullCommunicator.h index 6fa79a241..c4cc092cc 100644 --- a/src/cpu/VirtualFluidsCore/Parallel/NullCommunicator.h +++ b/src/cpu/VirtualFluidsCore/Parallel/NullCommunicator.h @@ -42,7 +42,7 @@ //! \details NullCommunicator is only a place-holder. It is only one process in shared memory. class NullCommunicator : public Communicator { - private: +private: NullCommunicator(); NullCommunicator( const NullCommunicator& ){} public: diff --git a/src/cpu/VirtualFluidsCore/Utilities/MemoryUtil.h b/src/cpu/VirtualFluidsCore/Utilities/MemoryUtil.h index 7f6f99752..1102acac0 100644 --- a/src/cpu/VirtualFluidsCore/Utilities/MemoryUtil.h +++ b/src/cpu/VirtualFluidsCore/Utilities/MemoryUtil.h @@ -46,7 +46,7 @@ #include "stdlib.h" #include "stdio.h" #include "string.h" -#elif (defined(__amd64) || defined(__amd64__) || defined(__unix__)) && !defined(__AIX__) +#elif (defined(__amd64) || defined(__amd64__) || defined(__unix__) || defined(__CYGWIN__)) && !defined(__AIX__) #define MEMORYUTIL_LINUX #include "sys/types.h" #include "sys/sysinfo.h" @@ -80,7 +80,12 @@ namespace Utilities //Multiply in next statement to avoid int overflow on right hand side... totalPhysMem *= memInfo.mem_unit; #elif defined(MEMORYUTIL_APPLE) - long long totalPhysMem = 0; + int mib [] = { CTL_HW, HW_MEMSIZE }; + int64_t totalPhysMem; + size_t length = sizeof(totalPhysMem); + + if(sysctl(mib, 2, &totalPhysMem, &length, nullptr, 0) == -1) + return 0; #else #error "MemoryUtil::getTotalPhysMem - UnknownMachine" #endif @@ -142,12 +147,8 @@ namespace Utilities PROCESS_MEMORY_COUNTERS pmc; GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)); SIZE_T physMemUsedByMe = pmc.WorkingSetSize; - #elif defined(MEMORYUTIL_LINUX) + #elif defined(MEMORYUTIL_LINUX) || defined(MEMORYUTIL_APPLE) || defined(MEMORYUTIL_CYGWIN) long long physMemUsedByMe = (long long)getValue() * (long long)1024; - #elif defined(MEMORYUTIL_APPLE) - long long physMemUsedByMe = 0; - #elif defined(MEMORYUTIL_CYGWIN) - long long physMemUsedByMe = (long long)getValue() * (long long)1024; #else #error "MemoryUtil::getPhysMemUsedByMe - UnknownMachine" #endif -- GitLab