diff --git a/apps/gpu/LBM/MusselOyster/MusselOyster.cpp b/apps/gpu/LBM/MusselOyster/MusselOyster.cpp index 7398baeaf864181b0d71d32bd13b809df2318319..0953c799cd9b1c7ce2edf2353417f115fc8b2899 100644 --- a/apps/gpu/LBM/MusselOyster/MusselOyster.cpp +++ b/apps/gpu/LBM/MusselOyster/MusselOyster.cpp @@ -70,7 +70,7 @@ std::string path("E:/temp/MusselOyster"); - +std::string gridPath("E:/temp/GridMussel/"); std::string simulationName("MusselOyster"); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -110,11 +110,15 @@ void multipleLevel(const std::string& configPath) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SPtr<Parameter> para = Parameter::make(configData, comm); + bool useGridGenerator = false; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// std::string bivalveType = "OYSTER"; // "MUSSEL" "OYSTER" + + if (useGridGenerator) { + real dx = 0.5; real vx = (real) 0.005; real Re = 50.0; @@ -178,10 +182,24 @@ void multipleLevel(const std::string& configPath) SPtr<Grid> grid = gridBuilder->getGrid(gridBuilder->getNumberOfLevels() - 1); ////////////////////////////////////////////////////////////////////////// + para->setDevices(std::vector<uint>{ (uint)0 }); + + para->setOutputPath(path); + para->setOutputPrefix(simulationName); + + para->setFName(para->getOutputPath() + "/" + para->getOutputPrefix()); + + para->setPrintFiles(true); + + para->setMaxLevel(1); + + ////////////////////////////////////////////////////////////////////////// + + // gridBuilder->writeGridsToVtk("E:/temp/MusselOyster/grid/"); // gridBuilder->writeArrows ("E:/temp/MusselOyster/grid/arrow"); - SimulationFileWriter::write("E:/temp/MusselOyster/grid/", gridBuilder, FILEFORMAT::BINARY); + SimulationFileWriter::write(gridPath, gridBuilder, FILEFORMAT::BINARY); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -198,16 +216,7 @@ void multipleLevel(const std::string& configPath) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - para->setDevices(std::vector<uint>{(uint)0}); - - para->setOutputPath( path ); - para->setOutputPrefix( simulationName ); - - para->setFName(para->getOutputPath() + "/" + para->getOutputPrefix()); - - para->setPrintFiles(true); - para->setMaxLevel(1); // para->setVelocity(velocityLB); // para->setViscosity(viscosityLB); @@ -224,14 +233,21 @@ void multipleLevel(const std::string& configPath) // }); - + + return; + } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SPtr<CudaMemoryManager> cudaMemoryManager = CudaMemoryManager::make(para); - SPtr<GridProvider> gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager); - + SPtr<GridProvider> gridGenerator; + if (useGridGenerator) + gridGenerator = GridProvider::makeGridGenerator(gridBuilder, para, cudaMemoryManager); + else { + gridGenerator = GridProvider::makeGridReader(FILEFORMAT::BINARY, para, cudaMemoryManager); + } + Simulation sim; SPtr<FileWriter> fileWriter = SPtr<FileWriter>(new FileWriter()); SPtr<KernelFactoryImp> kernelFactory = KernelFactoryImp::getInstance(); diff --git a/apps/gpu/LBM/MusselOyster/configMusselOyster.txt b/apps/gpu/LBM/MusselOyster/configMusselOyster.txt index 30c4083657c3affe8e7513c3d5904ecfd3158355..52ee1fe70285abb99d55dd72704674e1dba9f981 100644 --- a/apps/gpu/LBM/MusselOyster/configMusselOyster.txt +++ b/apps/gpu/LBM/MusselOyster/configMusselOyster.txt @@ -14,8 +14,8 @@ ################################################## #informations for reading ################################################## -#GridPath="E:/MusselOyster/dummy" -GridPath="C:" +GridPath="E:/temp/GridMussel" +#GridPath="C:" ################################################## #number of grid levels