From 7d78da923f4f0baa63afb02df03ee24d68fe5ac4 Mon Sep 17 00:00:00 2001 From: Christian Godenschwager <christian.godenschwager@fau.de> Date: Sat, 5 Aug 2017 02:33:19 +0200 Subject: [PATCH] Added VTK Output to CUDA game of life tutorial --- apps/tutorials/cuda/01_GameOfLife_cuda.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/tutorials/cuda/01_GameOfLife_cuda.cpp b/apps/tutorials/cuda/01_GameOfLife_cuda.cpp index 391f4ab11..518acb7e1 100644 --- a/apps/tutorials/cuda/01_GameOfLife_cuda.cpp +++ b/apps/tutorials/cuda/01_GameOfLife_cuda.cpp @@ -36,6 +36,7 @@ #include "field/AddToStorage.h" #include "field/communication/UniformMPIDatatypeInfo.h" +#include "field/vtk/VTKWriter.h" #include "geometry/initializer/ScalarFieldFromGrayScaleImage.h" #include "geometry/structured/GrayScaleImage.h" @@ -127,7 +128,7 @@ int main( int argc, char ** argv ) commScheme.addDataToCommunicate( make_shared<Packing>(gpuFieldSrcID) ); // Create Timeloop - const uint_t numberOfTimesteps = uint_t(10); // number of timesteps for non-gui runs + const uint_t numberOfTimesteps = uint_t(100); // number of timesteps for non-gui runs SweepTimeloop timeloop ( blocks, numberOfTimesteps ); // Registering the sweep @@ -136,6 +137,10 @@ int main( int argc, char ** argv ) timeloop.add() << Sweep( cuda::fieldCpyFunctor<ScalarField, GPUField >(cpuFieldID, gpuFieldDstID) ); + // Register VTK output + timeloop.addFuncAfterTimeStep( field::createVTKOutput<ScalarField>( cpuFieldID, *blocks, "game_of_life" ) ); + + // GUI output GUI gui ( timeloop, blocks, argc, argv ); gui.run(); -- GitLab