Skip to content
Snippets Groups Projects
Commit 4a5a2215 authored by Markus Holzer's avatar Markus Holzer
Browse files

Updated CodeGen Tutorial 03

parent 67a6aa80
No related merge requests found
...@@ -139,7 +139,7 @@ int main(int argc, char** argv) ...@@ -139,7 +139,7 @@ int main(int argc, char** argv)
// Common Fields // Common Fields
BlockDataID velocityFieldId = field::addToStorage< VectorField_T >(blocks, "velocity", real_c(0.0), field::fzyx); BlockDataID velocityFieldId = field::addToStorage< VectorField_T >(blocks, "velocity", real_c(0.0), field::fzyx);
BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >(blocks, "flag field"); BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >(blocks, "flag field");
#if defined(WALBERLA_BUILD_WITH_CUDA) #if defined(WALBERLA_BUILD_WITH_CUDA)
// GPU Field for PDFs // GPU Field for PDFs
...@@ -150,7 +150,8 @@ int main(int argc, char** argv) ...@@ -150,7 +150,8 @@ int main(int argc, char** argv)
BlockDataID velocityFieldIdGPU = BlockDataID velocityFieldIdGPU =
cuda::addGPUFieldToStorage< VectorField_T >(blocks, velocityFieldId, "velocity on GPU", true); cuda::addGPUFieldToStorage< VectorField_T >(blocks, velocityFieldId, "velocity on GPU", true);
#else #else
BlockDataID pdfFieldId = field::addToStorage< PdfField_T >(blocks, "pdf field", real_c(0.0), field::fzyx); // CPU Field for PDFs
BlockDataID pdfFieldId = field::addToStorage< PdfField_T >(blocks, "pdf field", real_c(0.0), field::fzyx);
#endif #endif
// Velocity field setup // Velocity field setup
...@@ -207,8 +208,7 @@ int main(int argc, char** argv) ...@@ -207,8 +208,7 @@ int main(int argc, char** argv)
#if defined(WALBERLA_BUILD_WITH_CUDA) #if defined(WALBERLA_BUILD_WITH_CUDA)
cuda::communication::UniformGPUScheme< Stencil_T > com(blocks, 0); cuda::communication::UniformGPUScheme< Stencil_T > com(blocks, 0);
com.addPackInfo(make_shared< PackInfo_T >(pdfFieldId)); com.addPackInfo(make_shared< PackInfo_T >(pdfFieldId));
auto simpleOverlapTimeStep = [&]() { com.communicate(nullptr); }; auto communication = std::function< void() >([&]() { com.communicate(nullptr); });
auto communication = std::function< void() >(simpleOverlapTimeStep);
#else #else
blockforest::communication::UniformBufferedScheme< Stencil_T > communication(blocks); blockforest::communication::UniformBufferedScheme< Stencil_T > communication(blocks);
communication.addPackInfo(make_shared< PackInfo_T >(pdfFieldId)); communication.addPackInfo(make_shared< PackInfo_T >(pdfFieldId));
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment