From cb1faf04f8c9124539a81949a8bf19dbabb937f9 Mon Sep 17 00:00:00 2001 From: Hamidreza Norouzi Date: Mon, 20 Jan 2025 15:43:56 +0330 Subject: [PATCH] bug fixes for build with float in cuda --- CMakeLists.txt | 2 +- src/phasicFlow/dictionary/dictionary.hpp | 2 +- src/phasicFlow/repository/Time/timeControl.cpp | 2 +- src/phasicFlow/structuredData/domain/simulationDomain.cpp | 2 +- src/phasicFlow/structuredData/infinitePlane/infinitePlane.cpp | 2 +- src/phasicFlow/types/basicTypes/bTypesFunctions.cpp | 1 - src/phasicFlow/types/basicTypes/bTypesFunctions.hpp | 2 +- 7 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbb2eaf2..5bdcde81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(phasicFlow VERSION 1.0 ) set(CMAKE_CXX_STANDARD 17 CACHE STRING "" FORCE) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_INSTALL_PREFIX ${phasicFlow_SOURCE_DIR} CACHE PATH "Install path of phasicFlow" FORCE) -set(CMAKE_BUILD_TYPE Debug CACHE STRING "build type" FORCE) +set(CMAKE_BUILD_TYPE Release CACHE STRING "build type" FORCE) set(BUILD_SHARED_LIBS ON CACHE BOOL "Build using shared libraries" FORCE) mark_as_advanced(FORCE var BUILD_SHARED_LIBS) diff --git a/src/phasicFlow/dictionary/dictionary.hpp b/src/phasicFlow/dictionary/dictionary.hpp index e64dfec1..0a7da6d5 100644 --- a/src/phasicFlow/dictionary/dictionary.hpp +++ b/src/phasicFlow/dictionary/dictionary.hpp @@ -431,7 +431,7 @@ T dictionary::getValOrSet template T dictionary::getValOrSetMax(const word& keyword, const T& setMaxVal)const { - return max(getValOrSet(keyword, setMaxVal), setMaxVal); + return max(getValOrSet(keyword, setMaxVal), static_cast(setMaxVal)); } template diff --git a/src/phasicFlow/repository/Time/timeControl.cpp b/src/phasicFlow/repository/Time/timeControl.cpp index b6305545..6ccc4086 100644 --- a/src/phasicFlow/repository/Time/timeControl.cpp +++ b/src/phasicFlow/repository/Time/timeControl.cpp @@ -167,7 +167,7 @@ void pFlow::timeControl::checkForOutputToFile() lastSaved_ = currentTime_; save = true; } - else if( std::abs(currentTime_ - lastSaved_) < std::min( pow(10.0,-1.0*timePrecision_), 0.5 *dt_) ) + else if( std::abs(currentTime_ - lastSaved_) < std::min( pow(10.0,-1.0*timePrecision_), static_cast(0.5 *dt_)) ) { lastSaved_ = currentTime_; save = true; diff --git a/src/phasicFlow/structuredData/domain/simulationDomain.cpp b/src/phasicFlow/structuredData/domain/simulationDomain.cpp index eaf55965..7621e79f 100644 --- a/src/phasicFlow/structuredData/domain/simulationDomain.cpp +++ b/src/phasicFlow/structuredData/domain/simulationDomain.cpp @@ -31,7 +31,7 @@ bool pFlow::simulationDomain::prepareBoundaryDicts() real neighborLength = boundaries.getVal("neighborLength"); real boundaryExtntionLengthRatio = - boundaries.getValOrSetMax("boundaryExtntionLengthRatio", 0.1); + boundaries.getValOrSetMax("boundaryExtntionLengthRatio", static_cast(0.1)); uint32 updateInterval = boundaries.getValOrSetMax("updateInterval", 1u); diff --git a/src/phasicFlow/structuredData/infinitePlane/infinitePlane.cpp b/src/phasicFlow/structuredData/infinitePlane/infinitePlane.cpp index d9f41a38..89e497fb 100644 --- a/src/phasicFlow/structuredData/infinitePlane/infinitePlane.cpp +++ b/src/phasicFlow/structuredData/infinitePlane/infinitePlane.cpp @@ -28,7 +28,7 @@ pFlow::infinitePlane::infinitePlane ) { auto ln = cross(p2-p1, p3-p1); - + if( equal(ln.length(),0.0) ) { fatalErrorInFunction<< diff --git a/src/phasicFlow/types/basicTypes/bTypesFunctions.cpp b/src/phasicFlow/types/basicTypes/bTypesFunctions.cpp index c99eb4bd..dedf002d 100755 --- a/src/phasicFlow/types/basicTypes/bTypesFunctions.cpp +++ b/src/phasicFlow/types/basicTypes/bTypesFunctions.cpp @@ -21,7 +21,6 @@ Licence: #include #include #include - #include "bTypesFunctions.hpp" pFlow::int32 diff --git a/src/phasicFlow/types/basicTypes/bTypesFunctions.hpp b/src/phasicFlow/types/basicTypes/bTypesFunctions.hpp index 6efe0e28..5ad36fbb 100755 --- a/src/phasicFlow/types/basicTypes/bTypesFunctions.hpp +++ b/src/phasicFlow/types/basicTypes/bTypesFunctions.hpp @@ -26,7 +26,7 @@ Licence: #define __bTypesFunctions_hpp__ #include "builtinTypes.hpp" -//#include "math.hpp" +#include "math.hpp" #include "numericConstants.hpp" #include "pFlowMacros.hpp"