From 67b01dff98a387c2b458890f08b97b86b811aeee Mon Sep 17 00:00:00 2001
From: Robert K <robertk@posteo.org>
Date: Mon, 7 Dec 2015 21:23:02 -0700
Subject: [PATCH] fix CMakeLists for callback and communication.

---
 examples/callback/CMakeLists.txt      | 7 +++----
 examples/communication/CMakeLists.txt | 6 +++---
 examples/communication/fvscheme.hh    | 6 ++++++
 examples/testEfficiency/Makefile.am   | 2 +-
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/examples/callback/CMakeLists.txt b/examples/callback/CMakeLists.txt
index ea07ea2ec..9a4e590d5 100644
--- a/examples/callback/CMakeLists.txt
+++ b/examples/callback/CMakeLists.txt
@@ -17,7 +17,6 @@ set(EXAMPLES main_transport_cb
 add_definitions("-DALUGRID_CUBE")
 add_definitions("-DGRIDDIM=3")
 add_definitions("-DWORLDDIM=3")
-add_definitions("-DCALLBACK_ADAPTATION")
 
 #add_definitions("-DUSE_VECTOR_FOR_PWF")
 
@@ -28,18 +27,18 @@ add_executable(main_transport_cb main.cc)
 dune_target_enable_all_packages( main_transport_cb )
 #dune_target_link_libraries(main_transport_cb "${DUNE_LIBS};${DUNE_ALUGRID_LIBRARY}")
 set_property(TARGET main_transport_cb APPEND PROPERTY 
-  COMPILE_DEFINITIONS "TRANSPORT" )
+  COMPILE_DEFINITIONS "TRANSPORT;CALLBACK_ADAPTATION" )
 
 add_executable(main_ball_cb main.cc)
 dune_target_enable_all_packages( main_ball_cb )
 #dune_target_link_libraries(main_ball_cb "${DUNE_LIBS};${DUNE_ALUGRID_LIBRARY}")
 set_property(TARGET main_ball_cb APPEND PROPERTY 
-  COMPILE_DEFINITIONS "BALL" )
+  COMPILE_DEFINITIONS "BALL;CALLBACK_ADAPTATION" )
 
 add_executable(main_euler_cb main.cc)
 dune_target_enable_all_packages( main_euler_cb )
 #dune_target_link_libraries(main_euler_cb "${DUNE_LIBS};${DUNE_ALUGRID_LIBRARY}")
 set_property(TARGET main_euler_cb APPEND PROPERTY 
-  COMPILE_DEFINITIONS "EULER" )
+  COMPILE_DEFINITIONS "EULER;CALLBACK_ADAPTATION" )
 
 install(FILES ${callback_HEADERS} DESTINATION ${callbackdir})
diff --git a/examples/communication/CMakeLists.txt b/examples/communication/CMakeLists.txt
index 0de0c01f8..12c97e4bd 100644
--- a/examples/communication/CMakeLists.txt
+++ b/examples/communication/CMakeLists.txt
@@ -24,18 +24,18 @@ add_executable(main_transport_comm main.cc)
 dune_target_enable_all_packages(main_transport_comm )
 #dune_target_link_libraries(main_transport_comm "${DUNE_LIBS};${DUNE_ALUGRID_LIBRARY}")
 set_property(TARGET main_transport_comm APPEND PROPERTY 
-  COMPILE_DEFINITIONS "TRANSPORT" )
+  COMPILE_DEFINITIONS "TRANSPORT;NON_BLOCKING" )
 
 add_executable(main_ball_comm main.cc)
 dune_target_enable_all_packages(main_ball_comm )
 #dune_target_link_libraries(main_ball_comm "${DUNE_LIBS};${DUNE_ALUGRID_LIBRARY}")
 set_property(TARGET main_ball_comm APPEND PROPERTY 
-  COMPILE_DEFINITIONS "BALL" )
+  COMPILE_DEFINITIONS "BALL;NON_BLOCKING" )
 
 add_executable(main_euler_comm main.cc)
 dune_target_enable_all_packages(main_euler_comm )
 #dune_target_link_libraries(main_euler_comm "${DUNE_LIBS};${DUNE_ALUGRID_LIBRARY}")
 set_property(TARGET main_euler_comm APPEND PROPERTY 
-  COMPILE_DEFINITIONS "EULER" )
+  COMPILE_DEFINITIONS "EULER;NON_BLOCKING" )
 
 install(FILES ${communication_HEADERS} DESTINATION ${communicationdir})
diff --git a/examples/communication/fvscheme.hh b/examples/communication/fvscheme.hh
index ccc62fb07..a84203d11 100644
--- a/examples/communication/fvscheme.hh
+++ b/examples/communication/fvscheme.hh
@@ -251,7 +251,13 @@ inline double FiniteVolumeScheme< V, Model >
     const Entity &entity = *it;
     const IntersectionIterator iitend = gridView().iend( entity );
     for( IntersectionIterator iit = gridView().ibegin( entity ); iit != iitend; ++iit )
+    {
+#if DUNE_VERSION_NEWER(DUNE_GRID,2,4)
+      apply( iit->outside(), time, solution, update, dt );
+#else
       apply( *(iit->outside()), time, solution, update, dt );
+#endif
+    }
   } // end grid traversal
 
   // return time step
diff --git a/examples/testEfficiency/Makefile.am b/examples/testEfficiency/Makefile.am
index 2d78abd93..0b5389e67 100644
--- a/examples/testEfficiency/Makefile.am
+++ b/examples/testEfficiency/Makefile.am
@@ -14,7 +14,7 @@ CLEANFILES = $(DATACLEANFILES)
 
 # possible problems are BALL, TRANSPORT, EULER
 PROBLEM = TRANSPORT
-# extra flags: -DUSE_VECTOR_FOR_PWF -DNO_OUTPUT -DNON_BLOCKING
+# extra flags: -DUSE_VECTOR_FOR_PWF -DNO_OUTPUT -DNON_BLOCKING -DCALLBACK_ADAPTATION
 EXTRAFLAGS = 
 
 AM_CPPFLAGS += $(EXTRAFLAGS)
-- 
GitLab