diff --git a/src/GksGpu/Analyzer/ConvergenceAnalyzer.cpp b/src/GksGpu/Analyzer/ConvergenceAnalyzer.cpp index 77264712c5eb2cd2cdfd12c2ec0e2d74b628113b..2125ceb6c10d2074c6e5f804e3944cd031601f1c 100644 --- a/src/GksGpu/Analyzer/ConvergenceAnalyzer.cpp +++ b/src/GksGpu/Analyzer/ConvergenceAnalyzer.cpp @@ -10,6 +10,8 @@ #include "FlowStateData/AccessDeviceData.cuh" +namespace GksGpu { + ConvergenceAnalyzer::ConvergenceAnalyzer(SPtr<DataBase> dataBase, uint outputIter, real convergenceThreshold) { this->dataBase = dataBase; @@ -132,3 +134,5 @@ void ConvergenceAnalyzer::printL2Change(ConservedVariables L2Change) *logging::out << logging::Logger::INFO_HIGH << header.str() << "\n"; *logging::out << logging::Logger::INFO_HIGH << body.str() << "\n"; } + +} // namespace GksGpu diff --git a/src/GksGpu/Analyzer/ConvergenceAnalyzer.h b/src/GksGpu/Analyzer/ConvergenceAnalyzer.h index 116d3dad357795fd1dd945e1fa070158ae006e56..ae9a540986bde1a43515be38d6a0d6337e17bf19 100644 --- a/src/GksGpu/Analyzer/ConvergenceAnalyzer.h +++ b/src/GksGpu/Analyzer/ConvergenceAnalyzer.h @@ -11,6 +11,8 @@ #include "FlowStateData/FlowStateData.cuh" +namespace GksGpu { + struct DataBase; class VF_PUBLIC ConvergenceAnalyzer @@ -41,4 +43,6 @@ private: }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Analyzer/CupsAnalyzer.cpp b/src/GksGpu/Analyzer/CupsAnalyzer.cpp index 86dc316a28549861b7b90ef7ac78bb71932025ec..3407db77f94fecbb25020ee86eb60b80b497be8c 100644 --- a/src/GksGpu/Analyzer/CupsAnalyzer.cpp +++ b/src/GksGpu/Analyzer/CupsAnalyzer.cpp @@ -10,6 +10,8 @@ #include "DataBase/DataBase.h" +namespace GksGpu { + CupsAnalyzer::CupsAnalyzer(SPtr<DataBase> dataBase, bool outputPerTime, real outputTime, bool outputPerIter, uint outputIter) @@ -127,4 +129,6 @@ std::string CupsAnalyzer::getTimeString(real time) return timeString.str(); } +} // namespace GksGpu + diff --git a/src/GksGpu/Analyzer/CupsAnalyzer.h b/src/GksGpu/Analyzer/CupsAnalyzer.h index 49651a221e9836a45000b6a1dbe88df77c440923..41f06d32eb084354bff1e64936f75f44ff3bbd06 100644 --- a/src/GksGpu/Analyzer/CupsAnalyzer.h +++ b/src/GksGpu/Analyzer/CupsAnalyzer.h @@ -9,6 +9,8 @@ #include "Core/DataTypes.h" #include "Core/Timer/Timer.h" +namespace GksGpu { + struct DataBase; class VF_PUBLIC CupsAnalyzer @@ -52,4 +54,6 @@ private: std::string getTimeString( real time ); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Analyzer/EnstrophyAnalyzer.cu b/src/GksGpu/Analyzer/EnstrophyAnalyzer.cu index 9ab9e1644c71411816768c8ff138ca03a9fd08b7..5a3dc76db1440fc641bd7c58cdce48b7996d63ee 100644 --- a/src/GksGpu/Analyzer/EnstrophyAnalyzer.cu +++ b/src/GksGpu/Analyzer/EnstrophyAnalyzer.cu @@ -21,6 +21,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + __global__ void enstrophyKernel ( DataBaseStruct dataBase, Parameters parameters, real* enstrophy, uint nx, uint startIndex, uint numberOfEntities ); __host__ __device__ inline void enstrophyFunction( DataBaseStruct dataBase, Parameters parameters, real* enstrophy, uint nx, uint startIndex, uint index ); @@ -337,4 +339,6 @@ void EnstrophyAnalyzer::writeToFile(std::string filename) *logging::out << logging::Logger::INFO_INTERMEDIATE << "done!\n"; } +} // namespace GksGpu + diff --git a/src/GksGpu/Analyzer/EnstrophyAnalyzer.h b/src/GksGpu/Analyzer/EnstrophyAnalyzer.h index 41393953d426dc373a45b4fd8c2855c634d73a91..259362d78acc84b743412f688f5f7f9ed1fcb10a 100644 --- a/src/GksGpu/Analyzer/EnstrophyAnalyzer.h +++ b/src/GksGpu/Analyzer/EnstrophyAnalyzer.h @@ -13,6 +13,8 @@ #include "FlowStateData/FlowStateData.cuh" +namespace GksGpu { + struct DataBase; class VF_PUBLIC EnstrophyAnalyzer @@ -39,4 +41,6 @@ public: }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Analyzer/HeatFluxAnalyzer.cu b/src/GksGpu/Analyzer/HeatFluxAnalyzer.cu index 4e8b2d3776fab8eb99b801f240e5a6f8f4f79a5e..e03c8fe5200e1daa24bf48076e2db5c423d66ff8 100644 --- a/src/GksGpu/Analyzer/HeatFluxAnalyzer.cu +++ b/src/GksGpu/Analyzer/HeatFluxAnalyzer.cu @@ -26,6 +26,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + __global__ void heatFluxKernel ( DataBaseStruct dataBase, GksGpu::BoundaryConditionStruct boundaryCondition, Parameters parameters, real* heatFlux, uint startIndex, uint numberOfEntities ); __host__ __device__ inline void heatFluxFunction( DataBaseStruct& dataBase, GksGpu::BoundaryConditionStruct& boundaryCondition, Parameters& parameters, real* heatFlux, uint startIndex, uint index ); @@ -144,4 +146,6 @@ void HeatFluxAnalyzer::writeToFile(std::string filename) *logging::out << logging::Logger::INFO_INTERMEDIATE << "done!\n"; } +} // namespace GksGpu + diff --git a/src/GksGpu/Analyzer/HeatFluxAnalyzer.h b/src/GksGpu/Analyzer/HeatFluxAnalyzer.h index 1c94955d80a352f3e83a3ba5964328fcfff24e23..fcdeb82a661f398be0d13017f2715ea8fc3486d4 100644 --- a/src/GksGpu/Analyzer/HeatFluxAnalyzer.h +++ b/src/GksGpu/Analyzer/HeatFluxAnalyzer.h @@ -15,6 +15,8 @@ #include "Parameters/Parameters.h" +namespace GksGpu { + struct DataBase; class VF_PUBLIC HeatFluxAnalyzer @@ -45,4 +47,6 @@ public: }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Analyzer/KineticEnergyAnalyzer.cu b/src/GksGpu/Analyzer/KineticEnergyAnalyzer.cu index 88bbc2c00c9b42a7859ee06338cfaa52a75ab637..e2df78f78c61d1cbe15efb27d6e836a560e2888e 100644 --- a/src/GksGpu/Analyzer/KineticEnergyAnalyzer.cu +++ b/src/GksGpu/Analyzer/KineticEnergyAnalyzer.cu @@ -21,6 +21,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + __global__ void kineticEnergyKernel ( DataBaseStruct dataBase, real* kineticEnergy, uint startIndex, uint numberOfEntities ); __host__ __device__ inline void kineticEnergyFunction( DataBaseStruct dataBase, real* kineticEnergy, uint startIndex, uint index ); @@ -107,4 +109,6 @@ void KineticEnergyAnalyzer::writeToFile(std::string filename) *logging::out << logging::Logger::INFO_INTERMEDIATE << "done!\n"; } +} // namespace GksGpu + diff --git a/src/GksGpu/Analyzer/KineticEnergyAnalyzer.h b/src/GksGpu/Analyzer/KineticEnergyAnalyzer.h index 32945c66061aabbe062c0f0af5d951b019be4439..d8c25160fa1cc9cf0dfce9d3a96dd50529de91cf 100644 --- a/src/GksGpu/Analyzer/KineticEnergyAnalyzer.h +++ b/src/GksGpu/Analyzer/KineticEnergyAnalyzer.h @@ -11,6 +11,8 @@ #include "FlowStateData/FlowStateData.cuh" +namespace GksGpu { + struct DataBase; class VF_PUBLIC KineticEnergyAnalyzer @@ -35,4 +37,6 @@ public: }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Analyzer/PointTimeSeriesAnalyzer.cu b/src/GksGpu/Analyzer/PointTimeSeriesAnalyzer.cu index c605bb68e907ddaef16555bc87dfe6d2e68a014b..bba7a1e88cfc0f227e298258e76097169faae7d9 100644 --- a/src/GksGpu/Analyzer/PointTimeSeriesAnalyzer.cu +++ b/src/GksGpu/Analyzer/PointTimeSeriesAnalyzer.cu @@ -28,6 +28,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + __global__ void pointTimeSeriesKernel ( DataBaseStruct dataBase, PointTimeSeriesAnalyzerStruct pointTimeSeriesAnalyzer, Parameters parameters, uint startIndex, uint numberOfEntities ); __host__ __device__ inline void pointTimeSeriesFunction( DataBaseStruct dataBase, PointTimeSeriesAnalyzerStruct pointTimeSeriesAnalyzer, Parameters parameters, uint startIndex, uint index ); @@ -189,4 +191,6 @@ void PointTimeSeriesAnalyzer::download() checkCudaErrors( cudaMemcpy( this->hostSeries.data() + oldSize, this->deviceSeries , sizeof(real) * outputIter, cudaMemcpyDeviceToHost ) ); } +} // namespace GksGpu + diff --git a/src/GksGpu/Analyzer/PointTimeSeriesAnalyzer.h b/src/GksGpu/Analyzer/PointTimeSeriesAnalyzer.h index 867ae1fd6c9c844c3da9bb855125c8ca529d8eec..013c0be3c1ce209dddbf9eb30e3ca9c08d2b8f1a 100644 --- a/src/GksGpu/Analyzer/PointTimeSeriesAnalyzer.h +++ b/src/GksGpu/Analyzer/PointTimeSeriesAnalyzer.h @@ -11,9 +11,12 @@ #include "Core/DataTypes.h" #include "Core/VectorTypes.h" +class GksMeshAdapter; + +namespace GksGpu { + struct DataBase; struct Parameters; -class GksMeshAdapter; struct PointTimeSeriesAnalyzerStruct { @@ -67,4 +70,6 @@ public: void download(); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Analyzer/PointTimeSeriesCollector.cpp b/src/GksGpu/Analyzer/PointTimeSeriesCollector.cpp index d1bc55c342db6f3b70f8a81fdff91022e59f6ec8..81918b256ab84e5ea9c3d9db97dd8962a0bc1b7d 100644 --- a/src/GksGpu/Analyzer/PointTimeSeriesCollector.cpp +++ b/src/GksGpu/Analyzer/PointTimeSeriesCollector.cpp @@ -9,6 +9,8 @@ #include "Parameters/Parameters.h" +namespace GksGpu { + PointTimeSeriesCollector::~PointTimeSeriesCollector() { } @@ -78,3 +80,5 @@ void PointTimeSeriesCollector::writeToFile(std::string filename) *logging::out << logging::Logger::INFO_INTERMEDIATE << "done!\n"; } + +} // namespace GksGpu diff --git a/src/GksGpu/Analyzer/PointTimeseriesCollector.h b/src/GksGpu/Analyzer/PointTimeseriesCollector.h index 4ed4c6ab858b82bf2a882620aa523e85ac2556a9..36436222031d85a77a5beec692968e41e48c08f2 100644 --- a/src/GksGpu/Analyzer/PointTimeseriesCollector.h +++ b/src/GksGpu/Analyzer/PointTimeseriesCollector.h @@ -12,10 +12,13 @@ #include "Core/DataTypes.h" #include "Core/VectorTypes.h" +class GksMeshAdapter; + +namespace GksGpu { + class PointTimeSeriesAnalyzer; struct DataBase; struct Parameters; -class GksMeshAdapter; class VF_PUBLIC PointTimeSeriesCollector { @@ -36,4 +39,6 @@ public: void writeToFile( std::string filename ); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Analyzer/TurbulenceAnalyzer.cu b/src/GksGpu/Analyzer/TurbulenceAnalyzer.cu index 66c81ff5113783e38521d95ad15a3bc7c5067c6c..d05c47cd2309c6b2804f04dbd0c2214d3be388a3 100644 --- a/src/GksGpu/Analyzer/TurbulenceAnalyzer.cu +++ b/src/GksGpu/Analyzer/TurbulenceAnalyzer.cu @@ -26,6 +26,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + __global__ void turbulenceKernel ( DataBaseStruct dataBase, TurbulenceAnalyzerStruct turbulenceAnalyzer, Parameters parameters, uint startIndex, uint numberOfEntities ); __host__ __device__ inline void turbulenceFunction( DataBaseStruct dataBase, TurbulenceAnalyzerStruct turbulenceAnalyzer, Parameters parameters, uint startIndex, uint index ); @@ -424,4 +426,6 @@ void TurbulenceAnalyzer::upload() if( collect_p ) checkCudaErrors( cudaMemcpy( this->p , this->h_p.data() , sizeof(real) * dataBase->numberOfCells, cudaMemcpyHostToDevice ) ); } +} // namespace GksGpu + diff --git a/src/GksGpu/Analyzer/TurbulenceAnalyzer.h b/src/GksGpu/Analyzer/TurbulenceAnalyzer.h index 8965e96f55d42a92b20be9338a2dadad174d7db5..b7686496c3895daf1f100cd9769e5a1948950dfb 100644 --- a/src/GksGpu/Analyzer/TurbulenceAnalyzer.h +++ b/src/GksGpu/Analyzer/TurbulenceAnalyzer.h @@ -12,6 +12,8 @@ #include "FlowStateData/FlowStateData.cuh" +namespace GksGpu { + struct DataBase; struct Parameters; @@ -120,4 +122,6 @@ public: void upload(); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/BoundaryConditions/BoundaryCondition.h b/src/GksGpu/BoundaryConditions/BoundaryCondition.h index 8ec82c2c0693ef5c6d4bf5be06aab9814600654b..70be3a6a0269abe72836ab94d75a79330b9da7bf 100644 --- a/src/GksGpu/BoundaryConditions/BoundaryCondition.h +++ b/src/GksGpu/BoundaryConditions/BoundaryCondition.h @@ -15,11 +15,12 @@ #include "Parameters/Parameters.h" class GksMeshAdapter; -class DataBaseAllocator; -struct DataBase; namespace GksGpu{ +class DataBaseAllocator; +struct DataBase; + struct BoundaryConditionStruct { uint numberOfCells; diff --git a/src/GksGpu/CellProperties/CellProperties.cuh b/src/GksGpu/CellProperties/CellProperties.cuh index 246c462f3eb73e0d796574b1de3d466791275d4d..1ce36e85baa70739d9a98abf6cb9d3b9bd1a25f8 100644 --- a/src/GksGpu/CellProperties/CellProperties.cuh +++ b/src/GksGpu/CellProperties/CellProperties.cuh @@ -22,6 +22,8 @@ ////////////////////////////////////////////////////////////////////////// +namespace GksGpu { + typedef unsigned char CellProperties; ////////////////////////////////////////////////////////////////////////// @@ -43,5 +45,7 @@ __host__ __device__ inline bool isCellProperties( const CellProperties& left, co ////////////////////////////////////////////////////////////////////////// +} // namespace GksGpu + #endif diff --git a/src/GksGpu/CellUpdate/CellUpdate.cu b/src/GksGpu/CellUpdate/CellUpdate.cu index 2af0fc30aa194f654a959477bf8f409c99db11b8..a133ad759ee2d018c7df5cb6238d7ce71c3f338c 100644 --- a/src/GksGpu/CellUpdate/CellUpdate.cu +++ b/src/GksGpu/CellUpdate/CellUpdate.cu @@ -22,6 +22,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + __global__ void cellUpdateKernel ( DataBaseStruct dataBase, Parameters parameters, uint startIndex, uint numberOfEntities ); __host__ __device__ inline void cellUpdateFunction( DataBaseStruct dataBase, Parameters parameters, uint startIndex, uint index ); @@ -214,3 +216,5 @@ __host__ __device__ inline void cellUpdateFunction(DataBaseStruct dataBase, Para writeCellData(cellIndex, dataBase, cons); } + +} // namespace GksGpu diff --git a/src/GksGpu/CellUpdate/CellUpdate.h b/src/GksGpu/CellUpdate/CellUpdate.h index ce725cdc9c5dd9bb96171d9ff138cfaa9e272e81..a64613bbe6ec8d5ee676c6662cdcb895cb58267e 100644 --- a/src/GksGpu/CellUpdate/CellUpdate.h +++ b/src/GksGpu/CellUpdate/CellUpdate.h @@ -9,6 +9,8 @@ #include "DataBase/DataBase.h" #include "Parameters/Parameters.h" +namespace GksGpu { + class VF_PUBLIC CellUpdate { public: @@ -18,4 +20,6 @@ public: uint level ); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/CellUpdate/Reaction.cuh b/src/GksGpu/CellUpdate/Reaction.cuh index 5f7820d3137d7285e01eb5a981b0755bb2399159..1e3c7b2f696f5a7597834505e1dc68dde0542a92 100644 --- a/src/GksGpu/CellUpdate/Reaction.cuh +++ b/src/GksGpu/CellUpdate/Reaction.cuh @@ -19,6 +19,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + inline __host__ __device__ real getTurbulentViscosityDeardorff(const DataBaseStruct& dataBase, const Parameters& parameters, const uint cellIndex, const ConservedVariables& cons ) { // See FDS 6 Technical Reference Guide, Section 4.2.3 @@ -184,4 +186,6 @@ __host__ __device__ inline void chemicalReaction(DataBaseStruct dataBase, Parame } #endif // USE_PASSIVE_SCALAR -} \ No newline at end of file +} + +} // namespace GksGpu \ No newline at end of file diff --git a/src/GksGpu/Communication/Communicator.cpp b/src/GksGpu/Communication/Communicator.cpp index bc8ea73e083e0564ab10e648c98e85fa1889e7fa..3e2eaca36adcaf43729e737210eed0646bee59c0 100644 --- a/src/GksGpu/Communication/Communicator.cpp +++ b/src/GksGpu/Communication/Communicator.cpp @@ -22,6 +22,8 @@ #include "CudaUtility/CudaUtility.h" +namespace GksGpu { + int Communicator::tagSendPositive = 0; int Communicator::tagSendNegative = 1; @@ -95,3 +97,5 @@ void Communicator::recvData( SPtr<DataBase> dataBase, int tag ) #endif // USE_CUDA_AWARE_MPI } + +} // namespace GksGpu diff --git a/src/GksGpu/Communication/Communicator.cu b/src/GksGpu/Communication/Communicator.cu index bf2ca31af3fb469552e34303bd81b2bd8e556aa7..5cdbcd69e54b9441aa832def6fcbc3b99ef9960c 100644 --- a/src/GksGpu/Communication/Communicator.cu +++ b/src/GksGpu/Communication/Communicator.cu @@ -24,6 +24,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + ////////////////////////////////////////////////////////////////////////// __global__ void sendBufferKernel ( const DataBaseStruct dataBase, @@ -158,4 +160,6 @@ __host__ __device__ inline void recvBufferFunction( const DataBaseStruct dataBas dataBase.data[ RHO_S_1(cellIdx, dataBase.numberOfCells) ] = recvBuffer[ RHO_S_1(index, numberOfRecvNodes) ] ; dataBase.data[ RHO_S_2(cellIdx, dataBase.numberOfCells) ] = recvBuffer[ RHO_S_2(index, numberOfRecvNodes) ] ; #endif // USE_PASSIVE_SCALAR -} \ No newline at end of file +} + +} // namespace GksGpu \ No newline at end of file diff --git a/src/GksGpu/Communication/Communicator.h b/src/GksGpu/Communication/Communicator.h index 7434f121f9d31bbe40827b582983650f535d1baa..6aa564ae602427e3c83d34ec5cf4343574095ae8 100644 --- a/src/GksGpu/Communication/Communicator.h +++ b/src/GksGpu/Communication/Communicator.h @@ -13,6 +13,9 @@ #include "Core/VectorTypes.h" class GksMeshAdapter; + +namespace GksGpu { + class DataBaseAllocator; struct DataBase; @@ -54,4 +57,6 @@ struct VF_PUBLIC Communicator : public std::enable_shared_from_this<Communicator void recvData( SPtr<DataBase> dataBase, int tag ); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Communication/MpiUtility.cpp b/src/GksGpu/Communication/MpiUtility.cpp index 3f72776284fb5e46e38a2686153d7c8f677a49d9..1dbfcaf15a3023ea03f829f9d74aa84548523a04 100644 --- a/src/GksGpu/Communication/MpiUtility.cpp +++ b/src/GksGpu/Communication/MpiUtility.cpp @@ -5,6 +5,8 @@ #define ENV_LOCAL_RANK "OMPI_COMM_WORLD_RANK" #define ENV_COMM_WORLD_SIZE "OMPI_COMM_WORLD_SIZE" +namespace GksGpu { + int MpiUtility::getMpiRankBeforeInit() { char * localRankStr = NULL; @@ -34,3 +36,5 @@ int MpiUtility::getMpiWorldSizeBeforeInit() return 1; } } + +} // namespace GksGpu diff --git a/src/GksGpu/Communication/MpiUtility.h b/src/GksGpu/Communication/MpiUtility.h index 18f408ed7b29e7f3531dab801ce2883e10bf8fb7..6fbab567aea127937a6c87f09c09f939af103750 100644 --- a/src/GksGpu/Communication/MpiUtility.h +++ b/src/GksGpu/Communication/MpiUtility.h @@ -10,6 +10,9 @@ #include "Core/VectorTypes.h" class GksMeshAdapter; + +namespace GksGpu { + class DataBaseAllocator; struct DataBase; @@ -20,4 +23,6 @@ struct VF_PUBLIC MpiUtility static int getMpiWorldSizeBeforeInit(); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/CudaUtility/CudaRunKernel.hpp b/src/GksGpu/CudaUtility/CudaRunKernel.hpp index ded692e4adc54e4a2aec013edaca4167102525d2..91de639cc712745cadd5f8a21e3c330dde989121 100644 --- a/src/GksGpu/CudaUtility/CudaRunKernel.hpp +++ b/src/GksGpu/CudaUtility/CudaRunKernel.hpp @@ -8,6 +8,8 @@ #include "CudaUtility/CudaUtility.h" +namespace GksGpu { + template<typename KernelFunctor, typename FunctionFunctor, typename... TArgs> void runKernel(KernelFunctor kernel, FunctionFunctor function, std::string deviceType, const CudaUtility::CudaGrid& grid, TArgs... args) { @@ -27,4 +29,6 @@ void runKernel(KernelFunctor kernel, FunctionFunctor function, std::string devic } } +} // namespace GksGpu + #endif diff --git a/src/GksGpu/CudaUtility/CudaUtility.cpp b/src/GksGpu/CudaUtility/CudaUtility.cpp index d77c928a81c4d63b836aa12a62f0eec8cd3ecd5c..0cd9e948dca8522284efe3febce95320dd5f4243 100644 --- a/src/GksGpu/CudaUtility/CudaUtility.cpp +++ b/src/GksGpu/CudaUtility/CudaUtility.cpp @@ -8,6 +8,8 @@ #include "Core/DataTypes.h" #include "Core/Logger/Logger.h" +namespace GksGpu { + cudaStream_t CudaUtility::computeStream = nullptr; cudaStream_t CudaUtility::communicationStream = nullptr; @@ -90,3 +92,5 @@ void CudaUtility::synchronizeCudaStream(cudaStream_t stream) { checkCudaErrors( cudaStreamSynchronize(stream) ); } + +} // namespace GksGpu diff --git a/src/GksGpu/CudaUtility/CudaUtility.h b/src/GksGpu/CudaUtility/CudaUtility.h index 716688d7951ed32066fc1901e3b98b61a05e241f..2eb425e7c9276fc2b754eee4c8d78bc0d49c4981 100644 --- a/src/GksGpu/CudaUtility/CudaUtility.h +++ b/src/GksGpu/CudaUtility/CudaUtility.h @@ -8,6 +8,8 @@ #include "Core/DataTypes.h" +namespace GksGpu { + class VF_PUBLIC CudaUtility { public: @@ -40,4 +42,6 @@ public: static void synchronizeCudaStream( cudaStream_t stream ); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/DataBase/DataBase.cpp b/src/GksGpu/DataBase/DataBase.cpp index 36b6194b8f2ae65230259106e05697e6f30daaa1..21c51b7575fbb46870b6b0397fe01d954e6458be 100644 --- a/src/GksGpu/DataBase/DataBase.cpp +++ b/src/GksGpu/DataBase/DataBase.cpp @@ -14,6 +14,8 @@ #include "GksMeshAdapter/GksMeshAdapter.h" #include "Communication/Communicator.h" +namespace GksGpu { + DataBase::DataBase( std::string type ) : myAllocator ( DataBaseAllocator::create( type ) ), numberOfNodes (0), @@ -234,3 +236,5 @@ std::string DataBase::getDeviceType() { return this->myAllocator->getDeviceType(); } + +} // namespace GksGpu diff --git a/src/GksGpu/DataBase/DataBase.h b/src/GksGpu/DataBase/DataBase.h index 5a8820aced5b6e1f86d95d951ceb61b1bc184c9c..449e1f49b2f83143a6243cbda415226c3f288561 100644 --- a/src/GksGpu/DataBase/DataBase.h +++ b/src/GksGpu/DataBase/DataBase.h @@ -19,7 +19,9 @@ class GksMeshAdapter; -namespace GksGpu{ struct BoundaryCondition; } +namespace GksGpu { + +struct BoundaryCondition; class DataBaseAllocator; struct DataBase; struct PerLevelCounts; @@ -34,7 +36,7 @@ struct VF_PUBLIC DataBase : public std::enable_shared_from_this<DataBase> SPtr<DataBaseAllocator> myAllocator; - std::vector< SPtr<GksGpu::BoundaryCondition> > boundaryConditions; + std::vector< SPtr<BoundaryCondition> > boundaryConditions; std::vector< std::array< SPtr< Communicator >, 6 > > communicators; @@ -172,4 +174,6 @@ struct VF_PUBLIC PerLevelCounts uint startOfFineToCoarse; }; +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/DataBase/DataBaseAllocator.cpp b/src/GksGpu/DataBase/DataBaseAllocator.cpp index 38e073f16e7811ca8d07b4ca0eec72a2ed4f69de..fc5a8ddf3ee1f4ea1816a01ad315afd4df85ccf3 100644 --- a/src/GksGpu/DataBase/DataBaseAllocator.cpp +++ b/src/GksGpu/DataBase/DataBaseAllocator.cpp @@ -8,6 +8,8 @@ #include <string> +namespace GksGpu { + std::shared_ptr<DataBaseAllocator> DataBaseAllocator::create(std::string type) { if ( type == "GPU" ) @@ -27,3 +29,5 @@ DataBaseAllocator::DataBaseAllocator() DataBaseAllocator::DataBaseAllocator(const DataBaseAllocator & orig) { } + +} // namespace GksGpu diff --git a/src/GksGpu/DataBase/DataBaseAllocator.h b/src/GksGpu/DataBase/DataBaseAllocator.h index b6905889854c04c35960b7277dbcd6dd2923f82a..305d9e66118726cd077bbb29d6a047ecca37f4de 100644 --- a/src/GksGpu/DataBase/DataBaseAllocator.h +++ b/src/GksGpu/DataBase/DataBaseAllocator.h @@ -10,8 +10,11 @@ #include "VirtualFluidsDefinitions.h" class GksMeshAdapter; + +namespace GksGpu { + struct DataBase; -namespace GksGpu { struct BoundaryCondition; }; +struct BoundaryCondition; struct Communicator; class VF_PUBLIC DataBaseAllocator { @@ -36,9 +39,9 @@ public: ////////////////////////////////////////////////////////////////////////// - virtual void freeMemory( GksGpu::BoundaryCondition& boundaryCondition ) = 0; + virtual void freeMemory( BoundaryCondition& boundaryCondition ) = 0; - virtual void allocateMemory( SPtr<GksGpu::BoundaryCondition> boundaryCondition, std::vector<uint> ghostCells, std::vector<uint> domainCells, std::vector<uint> secondCells ) = 0; + virtual void allocateMemory( SPtr<BoundaryCondition> boundaryCondition, std::vector<uint> ghostCells, std::vector<uint> domainCells, std::vector<uint> secondCells ) = 0; ////////////////////////////////////////////////////////////////////////// @@ -64,5 +67,7 @@ protected: }; +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/DataBase/DataBaseAllocatorCPU.cpp b/src/GksGpu/DataBase/DataBaseAllocatorCPU.cpp index 8ec4898d38966de4ad879db0f0ab00a8b759b4be..e1fe121b5cd370f6090ca2c82cd9a0f2448935ac 100644 --- a/src/GksGpu/DataBase/DataBaseAllocatorCPU.cpp +++ b/src/GksGpu/DataBase/DataBaseAllocatorCPU.cpp @@ -17,6 +17,8 @@ #include "Definitions/MemoryAccessPattern.h" +namespace GksGpu { + void DataBaseAllocatorCPU::freeMemory( DataBase& dataBase) { dataBase.cellToNode.clear(); @@ -256,3 +258,5 @@ std::string DataBaseAllocatorCPU::getDeviceType() { return std::string("CPU"); } + +} // namespace GksGpu diff --git a/src/GksGpu/DataBase/DataBaseAllocatorCPU.h b/src/GksGpu/DataBase/DataBaseAllocatorCPU.h index 30829ae915b370c6e2d9bd496908211c34310f2f..35e89a3d4ddf6477de9114404946f8745dedd4d6 100644 --- a/src/GksGpu/DataBase/DataBaseAllocatorCPU.h +++ b/src/GksGpu/DataBase/DataBaseAllocatorCPU.h @@ -8,6 +8,8 @@ #include "VirtualFluidsDefinitions.h" +namespace GksGpu { + class VF_PUBLIC DataBaseAllocatorCPU : public DataBaseAllocator { public: @@ -26,9 +28,9 @@ public: ////////////////////////////////////////////////////////////////////////// - virtual void freeMemory( GksGpu::BoundaryCondition& boundaryCondition ) override; + virtual void freeMemory( BoundaryCondition& boundaryCondition ) override; - virtual void allocateMemory( SPtr<GksGpu::BoundaryCondition> boundaryCondition, std::vector<uint> ghostCells, std::vector<uint> domainCells, std::vector<uint> secondCells ) override; + virtual void allocateMemory( SPtr<BoundaryCondition> boundaryCondition, std::vector<uint> ghostCells, std::vector<uint> domainCells, std::vector<uint> secondCells ) override; ////////////////////////////////////////////////////////////////////////// @@ -46,5 +48,7 @@ public: virtual std::string getDeviceType() override; }; +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/DataBase/DataBaseAllocatorGPU.cpp b/src/GksGpu/DataBase/DataBaseAllocatorGPU.cpp index f5b88d37db0506bacabe40d0367a71d2ed73f670..9d1400d6f43cc669eba00401b1c30057330cf843 100644 --- a/src/GksGpu/DataBase/DataBaseAllocatorGPU.cpp +++ b/src/GksGpu/DataBase/DataBaseAllocatorGPU.cpp @@ -22,6 +22,8 @@ #include "CudaUtility/CudaUtility.h" +namespace GksGpu { + void DataBaseAllocatorGPU::freeMemory( DataBase& dataBase ) { dataBase.cellToNode.clear(); @@ -299,3 +301,5 @@ std::string DataBaseAllocatorGPU::getDeviceType() { return std::string("GPU"); } + +} // namespace GksGpu diff --git a/src/GksGpu/DataBase/DataBaseAllocatorGPU.h b/src/GksGpu/DataBase/DataBaseAllocatorGPU.h index 4f60d18553114eb48920597178e79bcfa97ddf1e..ed7418b8c1398f302bd14f15f9784b113ae92d9f 100644 --- a/src/GksGpu/DataBase/DataBaseAllocatorGPU.h +++ b/src/GksGpu/DataBase/DataBaseAllocatorGPU.h @@ -8,6 +8,8 @@ #include "VirtualFluidsDefinitions.h" +namespace GksGpu { + class VF_PUBLIC DataBaseAllocatorGPU : public DataBaseAllocator { public: @@ -26,9 +28,9 @@ public: ////////////////////////////////////////////////////////////////////////// - virtual void freeMemory( GksGpu::BoundaryCondition& boundaryCondition ) override; + virtual void freeMemory( BoundaryCondition& boundaryCondition ) override; - virtual void allocateMemory( SPtr<GksGpu::BoundaryCondition> boundaryCondition, std::vector<uint> ghostCells, std::vector<uint> domainCells, std::vector<uint> secondCells ) override; + virtual void allocateMemory( SPtr<BoundaryCondition> boundaryCondition, std::vector<uint> ghostCells, std::vector<uint> domainCells, std::vector<uint> secondCells ) override; ////////////////////////////////////////////////////////////////////////// @@ -46,5 +48,7 @@ public: virtual std::string getDeviceType() override; }; +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/DataBase/DataBaseStruct.h b/src/GksGpu/DataBase/DataBaseStruct.h index 00c30f50ff193a0d0c1c3e270a7e54380a1bedff..f808719208b6a099b56fe11044611a9326d85cf8 100644 --- a/src/GksGpu/DataBase/DataBaseStruct.h +++ b/src/GksGpu/DataBase/DataBaseStruct.h @@ -5,6 +5,8 @@ #include <VirtualFluidsDefinitions.h> +namespace GksGpu{ + struct VF_PUBLIC DataBaseStruct { uint numberOfCells; @@ -38,5 +40,7 @@ struct VF_PUBLIC DataBaseStruct int* crashCellIndex; }; +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/Definitions/AccumulatorDataType.h b/src/GksGpu/Definitions/AccumulatorDataType.h index 41a4170ebd4a5cd83cc305edc3b52db0f45d55c6..05cdeba8f71e577d4f09a7aa76403db42784a4ea 100644 --- a/src/GksGpu/Definitions/AccumulatorDataType.h +++ b/src/GksGpu/Definitions/AccumulatorDataType.h @@ -1,7 +1,11 @@ #ifndef AccumulatorDataType_H #define AccumulatorDataType_H +namespace GksGpu { + typedef float realAccumulator; //typedef double realAccumulator; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/FlowStateData/AccessDeviceData.cuh b/src/GksGpu/FlowStateData/AccessDeviceData.cuh index 8d37f14bdd328edf9305a40f88985ea6beba2712..3ff9848f15d57ab66ed5c8c6178df3afd1d4c581 100644 --- a/src/GksGpu/FlowStateData/AccessDeviceData.cuh +++ b/src/GksGpu/FlowStateData/AccessDeviceData.cuh @@ -18,6 +18,8 @@ #include "FlowStateData/FlowStateData.cuh" +namespace GksGpu { + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// __host__ __device__ inline void readCellData(const uint cellIdx, const DataBaseStruct& dataBase, ConservedVariables& cellCons) @@ -74,4 +76,6 @@ __host__ __device__ inline void writeCellDataUpdate(const uint cellIdx, const Da #endif // USE_PASSIVE_SCALAR } +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/FlowStateData/FlowStateData.cuh b/src/GksGpu/FlowStateData/FlowStateData.cuh index b7974e0693a4a2c72ffd455a875510a00265c02d..3ec3a7c9e60cf60d14fec43eaa1d17792148fb15 100644 --- a/src/GksGpu/FlowStateData/FlowStateData.cuh +++ b/src/GksGpu/FlowStateData/FlowStateData.cuh @@ -13,6 +13,8 @@ #include "Definitions/PassiveScalar.h" +namespace GksGpu { + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -249,5 +251,7 @@ __host__ __device__ inline ConservedVariables operator* ( const real left, const return result; } +} // namespace GksGpu + #endif diff --git a/src/GksGpu/FlowStateData/FlowStateDataConversion.cuh b/src/GksGpu/FlowStateData/FlowStateDataConversion.cuh index 210410c9789f54dad3ab02bc872ecb7868493a32..c33f02ea3f9f4d13050c72b52b471b312a52b1c8 100644 --- a/src/GksGpu/FlowStateData/FlowStateDataConversion.cuh +++ b/src/GksGpu/FlowStateData/FlowStateDataConversion.cuh @@ -16,6 +16,8 @@ #include "FlowStateData/FlowStateData.cuh" #include "FlowStateData/ThermalDependencies.cuh" +namespace GksGpu { + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -76,5 +78,7 @@ __host__ __device__ inline PrimitiveVariables toPrimitiveVariables( const Conser #endif } +} // namespace GksGpu + #endif diff --git a/src/GksGpu/FlowStateData/ThermalDependencies.cuh b/src/GksGpu/FlowStateData/ThermalDependencies.cuh index 5ab85436bb7684fdcc2858ff623d5c2c7be6a38c..045d0ffb203f0c531f639612b8b3ae9e97467c5b 100644 --- a/src/GksGpu/FlowStateData/ThermalDependencies.cuh +++ b/src/GksGpu/FlowStateData/ThermalDependencies.cuh @@ -18,6 +18,8 @@ #include "FlowStateData/FlowStateData.cuh" #include "FlowStateData/HeatCapacities.cuh" +namespace GksGpu { + #ifdef USE_PASSIVE_SCALAR //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -56,6 +58,8 @@ __host__ __device__ inline void setLambdaFromT( PrimitiveVariables& prim, real T #endif // USE_PASSIVE_SCALAR +} // namespace GksGpu + diff --git a/src/GksGpu/FluxComputation/ApplyFlux.cuh b/src/GksGpu/FluxComputation/ApplyFlux.cuh index 30ca4e734fdbf5c5925defad5e88821f5eb63e94..da9e34b1c02c194acec28e11fab0ad1a33bd1fb6 100644 --- a/src/GksGpu/FluxComputation/ApplyFlux.cuh +++ b/src/GksGpu/FluxComputation/ApplyFlux.cuh @@ -10,6 +10,8 @@ #include "FlowStateData/FlowStateData.cuh" #include "FlowStateData/AccessDeviceData.cuh" +namespace GksGpu { + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// __host__ __device__ inline void applyFluxToNegCell( const DataBaseStruct& dataBase, @@ -133,4 +135,6 @@ __host__ __device__ inline void applyFluxToPosCell( const DataBaseStruct& dataBa #endif } +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/FluxComputation/AssembleFlux.cuh b/src/GksGpu/FluxComputation/AssembleFlux.cuh index 118a597a7f0096815a6f51b8089dc2876a0aaa21..4b2773275b2fada17318bd2a28e0e6f6bba300db 100644 --- a/src/GksGpu/FluxComputation/AssembleFlux.cuh +++ b/src/GksGpu/FluxComputation/AssembleFlux.cuh @@ -19,6 +19,8 @@ extern __device__ real atomicAdd(real* address, real val); #define NUMBER_OF_MOMENTS 7 +namespace GksGpu { + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -573,4 +575,6 @@ __host__ __device__ inline void assembleFlux( const PrimitiveVariables& facePrim ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/FluxComputation/ExpansionCoefficients.cuh b/src/GksGpu/FluxComputation/ExpansionCoefficients.cuh index f5e6dcf449b8abcd9be0b5772a60d1f6fb9f6007..52e5133e6ae6e0aedf2f02fc8d820a6eb877d4a7 100644 --- a/src/GksGpu/FluxComputation/ExpansionCoefficients.cuh +++ b/src/GksGpu/FluxComputation/ExpansionCoefficients.cuh @@ -10,6 +10,8 @@ #include "FlowStateData/FlowStateData.cuh" #include "FlowStateData/AccessDeviceData.cuh" +namespace GksGpu { + __host__ __device__ inline void computeExpansionCoefficients(const PrimitiveVariables & facePrim, const ConservedVariables & gradient, const real K, @@ -53,4 +55,6 @@ __host__ __device__ inline void computeExpansionCoefficients(const PrimitiveVari #endif // USE_PASSIVE_SCALAR } +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/FluxComputation/FluxComputation.cu b/src/GksGpu/FluxComputation/FluxComputation.cu index 087c6e9d2f4252402dd199afde275c139c52d1c5..df2a63bc80b9e84d2eb548c5e0c48f47e99f7cfa 100644 --- a/src/GksGpu/FluxComputation/FluxComputation.cu +++ b/src/GksGpu/FluxComputation/FluxComputation.cu @@ -24,6 +24,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + __global__ void fluxKernel ( DataBaseStruct dataBase, Parameters parameters, char direction, uint startIndex, uint numberOfEntities ); __host__ __device__ inline void fluxFunction( DataBaseStruct dataBase, Parameters parameters, char direction, uint startIndex, uint index ); @@ -472,3 +474,5 @@ __host__ __device__ inline void fluxFunction(DataBaseStruct dataBase, Parameters } } } + +} // namespace GksGpu diff --git a/src/GksGpu/FluxComputation/FluxComputation.h b/src/GksGpu/FluxComputation/FluxComputation.h index 673dcc929d5a34d5e1b955a9962ce70eef98a3d3..74bc5762124f6b83b9743222705bedc6138f7732 100644 --- a/src/GksGpu/FluxComputation/FluxComputation.h +++ b/src/GksGpu/FluxComputation/FluxComputation.h @@ -9,6 +9,8 @@ #include "DataBase/DataBase.h" #include "Parameters/Parameters.h" +namespace GksGpu { + class VF_PUBLIC FluxComputation { public: @@ -19,4 +21,6 @@ public: bool evaluateCommFaces = false); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/FluxComputation/Moments.cuh b/src/GksGpu/FluxComputation/Moments.cuh index ba4ef47ceb3ef1606b67b9d5942796e9d56e6d56..f0a83b275969befb43f2d46785792cd5f42fa2a6 100644 --- a/src/GksGpu/FluxComputation/Moments.cuh +++ b/src/GksGpu/FluxComputation/Moments.cuh @@ -12,6 +12,8 @@ #define NUMBER_OF_MOMENTS 7 +namespace GksGpu { + __host__ __device__ inline void computeMoments( const PrimitiveVariables & facePrim, const real K, real momentU [NUMBER_OF_MOMENTS], @@ -46,6 +48,8 @@ __host__ __device__ inline void computeMoments( const PrimitiveVariables & faceP momentXi[6] = ( K + c4o1 ) / ( c2o1 * facePrim.lambda ) * momentXi[4]; } +} // namespace GksGpu + #endif \ No newline at end of file diff --git a/src/GksGpu/FluxComputation/Reconstruction.cuh b/src/GksGpu/FluxComputation/Reconstruction.cuh index 6f7c0b45e91840d61199d758697e0b058c4e02a1..131bd828073327b7f00fe355ca588bee3f7bfe5e 100644 --- a/src/GksGpu/FluxComputation/Reconstruction.cuh +++ b/src/GksGpu/FluxComputation/Reconstruction.cuh @@ -13,6 +13,8 @@ #include "FlowStateData/AccessDeviceData.cuh" #include "FlowStateData/ThermalDependencies.cuh" +namespace GksGpu { + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -250,6 +252,8 @@ __host__ __device__ inline void reconstructFiniteDifferences( const uint faceInd } } +} // namespace GksGpu + diff --git a/src/GksGpu/FluxComputation/Smagorinsky.cuh b/src/GksGpu/FluxComputation/Smagorinsky.cuh index d77eb6b07fcda046e6e456c328d54b14e8853082..f94aeb5c6c0dc54f4061a6bcf7e0c0989802c3b1 100644 --- a/src/GksGpu/FluxComputation/Smagorinsky.cuh +++ b/src/GksGpu/FluxComputation/Smagorinsky.cuh @@ -13,6 +13,8 @@ #include "FlowStateData/FlowStateData.cuh" #include "FlowStateData/AccessDeviceData.cuh" +namespace GksGpu { + inline __host__ __device__ real getTurbulentViscositySmagorinsky(const Parameters & parameters, const PrimitiveVariables& facePrim, const ConservedVariables gradX1, @@ -48,4 +50,6 @@ inline __host__ __device__ real getTurbulentViscositySmagorinsky(const Parameter return facePrim.rho * Cs*Cs * parameters.dx*parameters.dx * S; } +} // namespace GksGpu + #endif diff --git a/src/GksGpu/FluxComputation/SutherlandsLaw.cuh b/src/GksGpu/FluxComputation/SutherlandsLaw.cuh index 6587519ab70a1b33db87f1066ec5e0121c6be009..4f1f94d2ab2819a9bafcf9d6512d8646f1b618f7 100644 --- a/src/GksGpu/FluxComputation/SutherlandsLaw.cuh +++ b/src/GksGpu/FluxComputation/SutherlandsLaw.cuh @@ -13,6 +13,8 @@ #include "FlowStateData/FlowStateData.cuh" #include "FlowStateData/AccessDeviceData.cuh" +namespace GksGpu { + inline __host__ __device__ real sutherlandsLaw(const Parameters & parameters, const real r) { real S = real( 110.5 ); @@ -24,4 +26,6 @@ inline __host__ __device__ real sutherlandsLaw(const Parameters & parameters, co return parameters.mu * sqrt( r * r * r ) * ( C + c1o1 ) / ( r + C ); } +} // namespace GksGpu + #endif diff --git a/src/GksGpu/FluxComputation/Transformation.cuh b/src/GksGpu/FluxComputation/Transformation.cuh index 027dcb17361334ba21f0b1eb45e56c9bbc4d7a6b..26a575c7350e8df98b30a0ba8660d3f012d1a882 100644 --- a/src/GksGpu/FluxComputation/Transformation.cuh +++ b/src/GksGpu/FluxComputation/Transformation.cuh @@ -10,6 +10,8 @@ #include "FlowStateData/FlowStateData.cuh" #include "FlowStateData/AccessDeviceData.cuh" +namespace GksGpu { + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// __host__ __device__ inline void transformGlobalToLocal(Vec3& vector, const char direction) @@ -120,4 +122,6 @@ __host__ __device__ inline void transformLocalToGlobal(PrimitiveVariables& prim, //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Initializer/Initializer.cpp b/src/GksGpu/Initializer/Initializer.cpp index d121262fe2319ef850e8ab61a08121035532eb26..ee1b8e89a9f5cb370e1783624cd6e687ff4de4b5 100644 --- a/src/GksGpu/Initializer/Initializer.cpp +++ b/src/GksGpu/Initializer/Initializer.cpp @@ -12,6 +12,8 @@ #include "Definitions/MemoryAccessPattern.h" #include "Definitions/PassiveScalar.h" +namespace GksGpu { + void Initializer::interpret(SPtr<DataBase> dataBase, std::function<ConservedVariables(Vec3)> initialCondition) { for( uint cellIdx = 0; cellIdx < dataBase->numberOfCells; cellIdx++ ){ @@ -33,3 +35,5 @@ void Initializer::interpret(SPtr<DataBase> dataBase, std::function<ConservedVari return; } + +} // namespace GksGpu diff --git a/src/GksGpu/Initializer/Initializer.h b/src/GksGpu/Initializer/Initializer.h index 696a6226fa57993143a073763b3d7f2d0a1f8c8c..481d5410c53c894cdeabf4de38344f9af68615af 100644 --- a/src/GksGpu/Initializer/Initializer.h +++ b/src/GksGpu/Initializer/Initializer.h @@ -14,6 +14,8 @@ #include "DataBase/DataBase.h" #include "FlowStateData/FlowStateData.cuh" +namespace GksGpu { + class VF_PUBLIC Initializer { public: @@ -23,4 +25,6 @@ public: static void initializeDataUpdate( SPtr<DataBase> dataBase ); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Initializer/InitializerKernel.cu b/src/GksGpu/Initializer/InitializerKernel.cu index 96c338119f2082fa3d8100cee0fe61797e0fc196..a929f3b4f1b7c726b52754faa3a8f29bb5fcf543 100644 --- a/src/GksGpu/Initializer/InitializerKernel.cu +++ b/src/GksGpu/Initializer/InitializerKernel.cu @@ -14,6 +14,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + __global__ void initializeDataUpdateKernel ( DataBaseStruct dataBase, uint numberOfEntities ); __host__ __device__ inline void initializeDataUpdateFunction( DataBaseStruct dataBase, uint index ); @@ -63,3 +65,5 @@ __host__ __device__ inline void initializeDataUpdateFunction(DataBaseStruct data dataBase.diffusivity[ index ] = c1o1; } + +} // namespace GksGpu diff --git a/src/GksGpu/Interface/CoarseToFineKernel.cu b/src/GksGpu/Interface/CoarseToFineKernel.cu index 828da1ea55228b0dc4a1e2b1e2567b06e2fd4f01..b6536353f8260502c171bfd9a2ff99d5f49506f4 100644 --- a/src/GksGpu/Interface/CoarseToFineKernel.cu +++ b/src/GksGpu/Interface/CoarseToFineKernel.cu @@ -18,6 +18,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + ////////////////////////////////////////////////////////////////////////// __global__ void coarseToFineKernel ( DataBaseStruct dataBase, uint startIndex, uint numberOfEntities ); @@ -421,3 +423,5 @@ __host__ __device__ inline void coarseToFineFunctionPrimitiveInterpolation( Data writeCellData(childCellIndex, dataBase, childCons); } } + +} // namespace GksGpu diff --git a/src/GksGpu/Interface/FineToCoarseKernel.cu b/src/GksGpu/Interface/FineToCoarseKernel.cu index 5c7b4dc4cff5432c04af0348deeabc983cff4a05..b6b3bc32cde5ab138e5c0f7752d48c7283505670 100644 --- a/src/GksGpu/Interface/FineToCoarseKernel.cu +++ b/src/GksGpu/Interface/FineToCoarseKernel.cu @@ -18,6 +18,8 @@ #include "CudaUtility/CudaRunKernel.hpp" +namespace GksGpu { + ////////////////////////////////////////////////////////////////////////// __global__ void fineToCoarseKernel ( DataBaseStruct dataBase, uint startIndex, uint numberOfEntities ); @@ -109,3 +111,5 @@ __host__ __device__ inline void fineToCoarseFunctionPrimitiveInterpolation( Data writeCellData(cellIdx, dataBase, parentCons); } } + +} // namespace GksGpu diff --git a/src/GksGpu/Interface/Interface.h b/src/GksGpu/Interface/Interface.h index 0e2ecbf4c59df8e64b910f44363c22f454844e40..4e14f9663085c4e38ce0391889d236b47560c01d 100644 --- a/src/GksGpu/Interface/Interface.h +++ b/src/GksGpu/Interface/Interface.h @@ -8,6 +8,8 @@ #include "DataBase/DataBase.h" +namespace GksGpu { + class VF_PUBLIC Interface { public: @@ -16,4 +18,6 @@ public: static void runCoarseToFine( SPtr<DataBase> dataBase, uint level ); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Parameters/Parameters.h b/src/GksGpu/Parameters/Parameters.h index 268856795b83f4854ce4752496a02738d5312bd7..c65023c20bd1e4a55bffc596196026e63b799587 100644 --- a/src/GksGpu/Parameters/Parameters.h +++ b/src/GksGpu/Parameters/Parameters.h @@ -6,6 +6,8 @@ #include <VirtualFluidsDefinitions.h> +namespace GksGpu { + enum class VF_PUBLIC ViscosityModel{ constant, sutherlandsLaw @@ -69,4 +71,6 @@ struct VF_PUBLIC Parameters real reactionLimiter = real(1.005); }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/Restart/Restart.cpp b/src/GksGpu/Restart/Restart.cpp index fa7a6044f0d832f12b8d81c3d41efe51684b6211..0f63e8c8f3c7483f9ae355f04c7be6b0c16a7853 100644 --- a/src/GksGpu/Restart/Restart.cpp +++ b/src/GksGpu/Restart/Restart.cpp @@ -11,6 +11,8 @@ #include "Definitions/MemoryAccessPattern.h" +namespace GksGpu { + void Restart::writeRestart( SPtr<DataBase> dataBase, std::string filename, uint iter ) { filename += ".rst"; @@ -89,4 +91,6 @@ bool Restart::readRestart( SPtr<DataBase> dataBase, std::string filename, uint& *logging::out << logging::Logger::INFO_HIGH << "done!\n"; return true; -} \ No newline at end of file +} + +} // namespace GksGpu \ No newline at end of file diff --git a/src/GksGpu/Restart/Restart.h b/src/GksGpu/Restart/Restart.h index 5dcd16771f6462de15a6ff00aed4a98ebb94d55f..6eb563620ddac870366a3561ec6860be25e5fa7a 100644 --- a/src/GksGpu/Restart/Restart.h +++ b/src/GksGpu/Restart/Restart.h @@ -9,6 +9,8 @@ #include "Core/PointerDefinitions.h" #include "Core/DataTypes.h" +namespace GksGpu { + struct DataBase; class VF_PUBLIC Restart @@ -24,5 +26,7 @@ private: ~Restart(){} }; +} // namespace GksGpu + #endif diff --git a/src/GksGpu/TimeStepping/NestedTimeStep.cpp b/src/GksGpu/TimeStepping/NestedTimeStep.cpp index 4653d93b54a6304198c9908d73ad43c809078eaa..516349ff67bc9fa6618ab40aee32a94148633c5d 100644 --- a/src/GksGpu/TimeStepping/NestedTimeStep.cpp +++ b/src/GksGpu/TimeStepping/NestedTimeStep.cpp @@ -12,6 +12,8 @@ #include "Initializer/Initializer.h" #include "CudaUtility/CudaUtility.h" +namespace GksGpu { + void TimeStepping::nestedTimeStep( SPtr<DataBase> dataBase, Parameters parameters, uint level ) @@ -30,7 +32,7 @@ void TimeStepping::nestedTimeStep( SPtr<DataBase> dataBase, ////////////////////////////////////////////////////////////////////////// - for( SPtr<GksGpu::BoundaryCondition> bc : dataBase->boundaryConditions ) + for( SPtr<BoundaryCondition> bc : dataBase->boundaryConditions ) { bc->runBoundaryConditionKernel( dataBase, parameters, level ); } @@ -101,3 +103,5 @@ void TimeStepping::nestedTimeStep( SPtr<DataBase> dataBase, ////////////////////////////////////////////////////////////////////////// } +} // namespace GksGpu + diff --git a/src/GksGpu/TimeStepping/NestedTimeStep.h b/src/GksGpu/TimeStepping/NestedTimeStep.h index 353613b5a27d2cd163255dc27d5888fdb4e28bae..400a1a90431e62258a6802e456a6fec320600483 100644 --- a/src/GksGpu/TimeStepping/NestedTimeStep.h +++ b/src/GksGpu/TimeStepping/NestedTimeStep.h @@ -8,6 +8,7 @@ #include "DataBase/DataBase.h" #include "Parameters/Parameters.h" +namespace GksGpu{ class VF_PUBLIC TimeStepping { @@ -19,4 +20,6 @@ public: }; +} // namespace GksGpu + #endif diff --git a/src/GksVtkAdapter/VTKAdapter.cpp b/src/GksVtkAdapter/VTKAdapter.cpp index d8db04f9d5fcca7215ab6fa04a6c196c8bfcb617..6e20fdd5a2c5f486fcdd2de534f28c6c294e1818 100644 --- a/src/GksVtkAdapter/VTKAdapter.cpp +++ b/src/GksVtkAdapter/VTKAdapter.cpp @@ -26,7 +26,7 @@ #include "GksGpu/FlowStateData/FlowStateData.cuh" #include "GksGpu/FlowStateData/FlowStateDataConversion.cuh" -vtkGridPtr getVtkUnstructuredOctGrid( SPtr<DataBase> dataBase, bool excludeGhostCells ) +vtkGridPtr getVtkUnstructuredOctGrid( SPtr<GksGpu::DataBase> dataBase, bool excludeGhostCells ) { vtkGridPtr grid = vtkGridPtr::New(); @@ -126,7 +126,7 @@ void addVectorCellData( vtkGridPtr grid, grid->GetCellData()->AddArray( data ); } -void addBaseData(vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters) +void addBaseData(vtkGridPtr grid, SPtr<GksGpu::DataBase> dataBase, GksGpu::Parameters parameters) { addScalarIntCellData( grid, dataBase->numberOfCells, "CellIdx", [&] (uint cellIdx) { return cellIdx; @@ -138,7 +138,7 @@ void addBaseData(vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters addScalarRealCellData( grid, dataBase->numberOfCells, "T", [&] (uint cellIdx) { - ConservedVariables cons; + GksGpu::ConservedVariables cons; cons.rho = dataBase->dataHost[ RHO__(cellIdx, dataBase->numberOfCells) ]; cons.rhoU = dataBase->dataHost[ RHO_U(cellIdx, dataBase->numberOfCells) ]; @@ -150,7 +150,7 @@ void addBaseData(vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters cons.rhoS_2 = dataBase->dataHost[ RHO_S_2(cellIdx, dataBase->numberOfCells) ]; #endif // USE_PASSIVE_SCALAR - PrimitiveVariables prim = toPrimitiveVariables(cons, parameters.K); + GksGpu::PrimitiveVariables prim = toPrimitiveVariables(cons, parameters.K); #ifdef USE_PASSIVE_SCALAR return getT(prim); @@ -161,7 +161,7 @@ void addBaseData(vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters addScalarRealCellData( grid, dataBase->numberOfCells, "lambda", [&] (uint cellIdx) { - ConservedVariables cons; + GksGpu::ConservedVariables cons; cons.rho = dataBase->dataHost[ RHO__(cellIdx, dataBase->numberOfCells) ]; cons.rhoU = dataBase->dataHost[ RHO_U(cellIdx, dataBase->numberOfCells) ]; @@ -173,14 +173,14 @@ void addBaseData(vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters cons.rhoS_2 = dataBase->dataHost[ RHO_S_2(cellIdx, dataBase->numberOfCells) ]; #endif // USE_PASSIVE_SCALAR - PrimitiveVariables prim = toPrimitiveVariables(cons, parameters.K); + GksGpu::PrimitiveVariables prim = toPrimitiveVariables(cons, parameters.K); return prim.lambda; } ); addScalarRealCellData( grid, dataBase->numberOfCells, "p", [&] (uint cellIdx) { - ConservedVariables cons; + GksGpu::ConservedVariables cons; cons.rho = dataBase->dataHost[ RHO__(cellIdx, dataBase->numberOfCells) ]; cons.rhoU = dataBase->dataHost[ RHO_U(cellIdx, dataBase->numberOfCells) ]; @@ -192,7 +192,7 @@ void addBaseData(vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters cons.rhoS_2 = dataBase->dataHost[ RHO_S_2(cellIdx, dataBase->numberOfCells) ]; #endif // USE_PASSIVE_SCALAR - PrimitiveVariables prim = toPrimitiveVariables(cons, parameters.K); + GksGpu::PrimitiveVariables prim = toPrimitiveVariables(cons, parameters.K); return 0.5 * prim.rho / prim.lambda; } ); @@ -207,7 +207,7 @@ void addBaseData(vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters addVectorCellData( grid, dataBase->numberOfCells, "Velocity", [&] (uint cellIdx) { - ConservedVariables cons; + GksGpu::ConservedVariables cons; cons.rho = dataBase->dataHost[ RHO__(cellIdx, dataBase->numberOfCells) ]; cons.rhoU = dataBase->dataHost[ RHO_U(cellIdx, dataBase->numberOfCells) ]; @@ -215,7 +215,7 @@ void addBaseData(vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters cons.rhoW = dataBase->dataHost[ RHO_W(cellIdx, dataBase->numberOfCells) ]; cons.rhoE = dataBase->dataHost[ RHO_E(cellIdx, dataBase->numberOfCells) ]; - PrimitiveVariables prim = toPrimitiveVariables( cons, parameters.K ); + GksGpu::PrimitiveVariables prim = toPrimitiveVariables( cons, parameters.K ); return Vec3( prim.U, prim.V, prim.W ); } ); @@ -413,8 +413,8 @@ void writePNG( vtkDataObject * inputData, int nx, int ny, double L, double H, st //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void writeVtkXML(std::shared_ptr<DataBase> dataBase, - Parameters parameters, +void writeVtkXML(std::shared_ptr<GksGpu::DataBase> dataBase, + GksGpu::Parameters parameters, int mode, std::string filename) { @@ -429,7 +429,7 @@ void writeVtkXML(std::shared_ptr<DataBase> dataBase, *logging::out << logging::Logger::INFO_INTERMEDIATE << "done!\n"; } -void VF_PUBLIC writeVtkXMLParallelSummaryFile(std::shared_ptr<DataBase> dataBase, Parameters parameters, std::string filename, uint mpiWorldSize) +void VF_PUBLIC writeVtkXMLParallelSummaryFile(std::shared_ptr<GksGpu::DataBase> dataBase, GksGpu::Parameters parameters, std::string filename, uint mpiWorldSize) { *logging::out << logging::Logger::INFO_INTERMEDIATE << "Write " << filename << ".pvtu" << " ... \n"; @@ -442,8 +442,8 @@ void VF_PUBLIC writeVtkXMLParallelSummaryFile(std::shared_ptr<DataBase> dataBase *logging::out << logging::Logger::INFO_INTERMEDIATE << "done!\n"; } -void writeTurbulenceVtkXML(std::shared_ptr<DataBase> dataBase, - std::shared_ptr<TurbulenceAnalyzer> turbulenceAnalyzer, +void writeTurbulenceVtkXML(std::shared_ptr<GksGpu::DataBase> dataBase, + std::shared_ptr<GksGpu::TurbulenceAnalyzer> turbulenceAnalyzer, int mode, std::string filename) { @@ -534,7 +534,7 @@ void writeTurbulenceVtkXML(std::shared_ptr<DataBase> dataBase, *logging::out << logging::Logger::INFO_INTERMEDIATE << "done!\n"; } -void VF_PUBLIC writeTurbulenceVtkXMLParallelSummaryFile(std::shared_ptr<DataBase> dataBase, std::shared_ptr<TurbulenceAnalyzer> turbulenceAnalyzer,Parameters parameters, std::string filename, uint mpiWorldSize) +void VF_PUBLIC writeTurbulenceVtkXMLParallelSummaryFile(std::shared_ptr<GksGpu::DataBase> dataBase, std::shared_ptr<GksGpu::TurbulenceAnalyzer> turbulenceAnalyzer,GksGpu::Parameters parameters, std::string filename, uint mpiWorldSize) { *logging::out << logging::Logger::INFO_INTERMEDIATE << "Write " << filename << ".pvtu" << " ... \n"; @@ -593,7 +593,7 @@ void VF_PUBLIC writeTurbulenceVtkXMLParallelSummaryFile(std::shared_ptr<DataBase *logging::out << logging::Logger::INFO_INTERMEDIATE << "done!\n"; } -void mapFlowField(std::shared_ptr<DataBase> base, std::shared_ptr<DataBase> target) +void mapFlowField(std::shared_ptr<GksGpu::DataBase> base, std::shared_ptr<GksGpu::DataBase> target) { vtkGridPtr gridBase = getVtkUnstructuredOctGrid(base, true); vtkGridPtr gridTarget = getVtkUnstructuredOctGrid(target, true); @@ -616,7 +616,7 @@ void mapFlowField(std::shared_ptr<DataBase> base, std::shared_ptr<DataBase> targ if( base->isGhostCell( cellIdx ) ) continue; - ConservedVariables cons; + GksGpu::ConservedVariables cons; cons.rho = base->dataHost[ RHO__(cellIdx, base->numberOfCells) ]; cons.rhoU = base->dataHost[ RHO_U(cellIdx, base->numberOfCells) ]; @@ -712,7 +712,7 @@ void mapFlowField(std::shared_ptr<DataBase> base, std::shared_ptr<DataBase> targ } } -void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<DataBase> dataBase, std::shared_ptr<GksGpu::ConcreteHeatFlux> bc, Parameters parameters, int mode, std::string filename) +void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<GksGpu::DataBase> dataBase, std::shared_ptr<GksGpu::ConcreteHeatFlux> bc, GksGpu::Parameters parameters, int mode, std::string filename) { *logging::out << logging::Logger::INFO_INTERMEDIATE << "Write " << filename << ".vtu" << " ... \n"; @@ -729,7 +729,7 @@ void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<DataBase> dataBase, s if( bc->domainCellsHost[index] > dataBase->perLevelCount[ dataBase->getCellLevel( bc->domainCellsHost[index] ) ].startOfCells + dataBase->perLevelCount[ dataBase->getCellLevel( bc->domainCellsHost[index] ) ].numberOfBulkCells ) continue; - if( isCellProperties( dataBase->cellPropertiesHost[ bc->domainCellsHost[index] ], CELL_PROPERTIES_FINE_GHOST ) ) continue; + if( GksGpu::isCellProperties( dataBase->cellPropertiesHost[ bc->domainCellsHost[index] ], CELL_PROPERTIES_FINE_GHOST ) ) continue; real dx = bc->L / real(bc->numberOfPoints + 1); @@ -835,12 +835,12 @@ void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<DataBase> dataBase, s if( bc->domainCellsHost[cellIdx] > dataBase->perLevelCount[ dataBase->getCellLevel( bc->domainCellsHost[cellIdx] ) ].startOfCells + dataBase->perLevelCount[ dataBase->getCellLevel( bc->domainCellsHost[cellIdx] ) ].numberOfBulkCells ) continue; - if( isCellProperties( dataBase->cellPropertiesHost[ bc->domainCellsHost[cellIdx] ], CELL_PROPERTIES_FINE_GHOST ) ) continue; + if( GksGpu::isCellProperties( dataBase->cellPropertiesHost[ bc->domainCellsHost[cellIdx] ], CELL_PROPERTIES_FINE_GHOST ) ) continue; real T = c0o1; { - ConservedVariables cons; + GksGpu::ConservedVariables cons; cons.rho = dataBase->dataHost[RHO__(bc->domainCellsHost[cellIdx], dataBase->numberOfCells)]; cons.rhoU = dataBase->dataHost[RHO_U(bc->domainCellsHost[cellIdx], dataBase->numberOfCells)]; @@ -848,7 +848,7 @@ void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<DataBase> dataBase, s cons.rhoW = dataBase->dataHost[RHO_W(bc->domainCellsHost[cellIdx], dataBase->numberOfCells)]; cons.rhoE = dataBase->dataHost[RHO_E(bc->domainCellsHost[cellIdx], dataBase->numberOfCells)]; - PrimitiveVariables prim = toPrimitiveVariables(cons, parameters.K); + GksGpu::PrimitiveVariables prim = GksGpu::toPrimitiveVariables(cons, parameters.K); #ifdef USE_PASSIVE_SCALAR T += c3o2 * getT(prim); @@ -859,7 +859,7 @@ void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<DataBase> dataBase, s } { - ConservedVariables cons; + GksGpu::ConservedVariables cons; cons.rho = dataBase->dataHost[RHO__(bc->secondCellsHost[cellIdx], dataBase->numberOfCells)]; cons.rhoU = dataBase->dataHost[RHO_U(bc->secondCellsHost[cellIdx], dataBase->numberOfCells)]; @@ -867,7 +867,7 @@ void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<DataBase> dataBase, s cons.rhoW = dataBase->dataHost[RHO_W(bc->secondCellsHost[cellIdx], dataBase->numberOfCells)]; cons.rhoE = dataBase->dataHost[RHO_E(bc->secondCellsHost[cellIdx], dataBase->numberOfCells)]; - PrimitiveVariables prim = toPrimitiveVariables(cons, parameters.K); + GksGpu::PrimitiveVariables prim = GksGpu::toPrimitiveVariables(cons, parameters.K); #ifdef USE_PASSIVE_SCALAR T -= c1o2 * getT(prim); diff --git a/src/GksVtkAdapter/VTKAdapter.h b/src/GksVtkAdapter/VTKAdapter.h index 6c3070689fe66b53a0cd4a5e07087010449def34..d5effc8d86f1e81f462465654036f3777bfb8e19 100644 --- a/src/GksVtkAdapter/VTKAdapter.h +++ b/src/GksVtkAdapter/VTKAdapter.h @@ -41,7 +41,7 @@ struct rgbColor unsigned char b; }; -vtkGridPtr VF_PUBLIC getVtkUnstructuredOctGrid( SPtr<DataBase> dataBase, bool excludeGhostCells = false ); +vtkGridPtr VF_PUBLIC getVtkUnstructuredOctGrid( SPtr<GksGpu::DataBase> dataBase, bool excludeGhostCells = false ); void VF_PUBLIC addScalarIntCellData( vtkGridPtr grid, uint numberOfCells, @@ -58,7 +58,7 @@ void VF_PUBLIC addVectorCellData( vtkGridPtr grid, std::string name, std::function<Vec3(uint)> getData ); -void VF_PUBLIC addBaseData( vtkGridPtr grid, SPtr<DataBase> dataBase, Parameters parameters ); +void VF_PUBLIC addBaseData( vtkGridPtr grid, SPtr<GksGpu::DataBase> dataBase, GksGpu::Parameters parameters ); void VF_PUBLIC writeVtkUnstructuredGrid( vtkGridPtr grid, int mode, std::string filename ); diff --git a/src/GksVtkAdapter/VTKInterface.h b/src/GksVtkAdapter/VTKInterface.h index a25a049f7a9fa84ba371759288e648f9e2a309c7..1680bd511431f863f211fa80dd86cc697f3d3fda 100644 --- a/src/GksVtkAdapter/VTKInterface.h +++ b/src/GksVtkAdapter/VTKInterface.h @@ -5,36 +5,38 @@ #include "VirtualFluidsDefinitions.h" +namespace GksGpu{ struct DataBase; class TurbulenceAnalyzer; -namespace GksGpu{ struct ConcreteHeatFlux; } +struct ConcreteHeatFlux; +} -void VF_PUBLIC writeVtkXML(std::shared_ptr<DataBase> dataBase, - Parameters parameters, +void VF_PUBLIC writeVtkXML(std::shared_ptr<GksGpu::DataBase> dataBase, + GksGpu::Parameters parameters, int mode, std::string filename); -void VF_PUBLIC writeVtkXMLParallelSummaryFile(std::shared_ptr<DataBase> dataBase, - Parameters parameters, +void VF_PUBLIC writeVtkXMLParallelSummaryFile(std::shared_ptr<GksGpu::DataBase> dataBase, + GksGpu::Parameters parameters, std::string filename, uint mpiWorldSize); -void VF_PUBLIC writeTurbulenceVtkXML(std::shared_ptr<DataBase> dataBase, - std::shared_ptr<TurbulenceAnalyzer> turbulenceAnalyzer, +void VF_PUBLIC writeTurbulenceVtkXML(std::shared_ptr<GksGpu::DataBase> dataBase, + std::shared_ptr<GksGpu::TurbulenceAnalyzer> turbulenceAnalyzer, int mode, std::string filename); -void VF_PUBLIC writeTurbulenceVtkXMLParallelSummaryFile(std::shared_ptr<DataBase> dataBase, - std::shared_ptr<TurbulenceAnalyzer> turbulenceAnalyzer, - Parameters parameters, +void VF_PUBLIC writeTurbulenceVtkXMLParallelSummaryFile(std::shared_ptr<GksGpu::DataBase> dataBase, + std::shared_ptr<GksGpu::TurbulenceAnalyzer> turbulenceAnalyzer, + GksGpu::Parameters parameters, std::string filename, uint mpiWorldSize); -void VF_PUBLIC mapFlowField( std::shared_ptr<DataBase> base, std::shared_ptr<DataBase> target ); +void VF_PUBLIC mapFlowField( std::shared_ptr<GksGpu::DataBase> base, std::shared_ptr<GksGpu::DataBase> target ); -void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<DataBase> dataBase, +void VF_PUBLIC writeConcreteHeatFluxVtkXML(std::shared_ptr<GksGpu::DataBase> dataBase, std::shared_ptr<GksGpu::ConcreteHeatFlux> bc, - Parameters parameters, + GksGpu::Parameters parameters, int mode, std::string filename);