From 0177e86aebf40693927d05349a5b6f64db5ded26 Mon Sep 17 00:00:00 2001
From: Christoph Grueninger <christoph.grueninger@iws.uni-stuttgart.de>
Date: Tue, 2 Oct 2012 14:11:34 +0000
Subject: [PATCH] [test_adaptive2p2c] Fix compilation of test_adaptive2p2c even
 if ALUGrid is not present.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9173 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 .../decoupled/2p2c/2p2cadaptiveproperties.hh  |  2 +-
 .../decoupled/2p2c/fvtransport2p2cadaptive.hh |  4 ++--
 test/decoupled/2p2c/test_adaptive2p2c.cc      |  5 +++++
 .../2p2c/test_adaptive2p2cproblem.hh          | 20 +++++++++----------
 4 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/dumux/decoupled/2p2c/2p2cadaptiveproperties.hh b/dumux/decoupled/2p2c/2p2cadaptiveproperties.hh
index f280920501..87c3966de0 100644
--- a/dumux/decoupled/2p2c/2p2cadaptiveproperties.hh
+++ b/dumux/decoupled/2p2c/2p2cadaptiveproperties.hh
@@ -78,7 +78,7 @@ SET_TYPE_PROP(DecoupledTwoPTwoCAdaptive, Indices, DecoupledTwoPTwoCIndicesAdapti
 // Set the model properties
 SET_TYPE_PROP(DecoupledTwoPTwoCAdaptive, TransportModel, FVTransport2P2CAdaptive<TypeTag>);
 SET_TYPE_PROP(DecoupledTwoPTwoCAdaptive, PressureModel, FVPressure2P2CAdaptive<TypeTag>);
-};
+}
 
 
 /*!
diff --git a/dumux/decoupled/2p2c/fvtransport2p2cadaptive.hh b/dumux/decoupled/2p2c/fvtransport2p2cadaptive.hh
index 2753f9d195..56baba7727 100644
--- a/dumux/decoupled/2p2c/fvtransport2p2cadaptive.hh
+++ b/dumux/decoupled/2p2c/fvtransport2p2cadaptive.hh
@@ -212,13 +212,13 @@ void FVTransport2P2CAdaptive<TypeTag>::update(const Scalar t, Scalar& dt, Transp
                 if (enableMPFA && isIt->outside()->level()!=eIt.level())
                     getMpfaFlux(entries, timestepFlux, isIt, cellDataI);
                 else
-                    getFlux(entries, timestepFlux, *isIt, cellDataI);
+                    this->getFlux(entries, timestepFlux, *isIt, cellDataI);
             }
 
             //     Boundary Face
             if (isIt->boundary())
             {
-                getFluxOnBoundary(entries, timestepFlux, *isIt, cellDataI);
+                this->getFluxOnBoundary(entries, timestepFlux, *isIt, cellDataI);
             }
 
             // add to update vector
diff --git a/test/decoupled/2p2c/test_adaptive2p2c.cc b/test/decoupled/2p2c/test_adaptive2p2c.cc
index a0ea70c22d..74d876677c 100644
--- a/test/decoupled/2p2c/test_adaptive2p2c.cc
+++ b/test/decoupled/2p2c/test_adaptive2p2c.cc
@@ -52,6 +52,11 @@ void usage(const char *progName, const std::string &errorMsg)
 // The main function using the standard start procedure
 int main(int argc, char** argv)
 {
+#if HAVE_ALUGRID
     typedef TTAG(Adaptive2p2c) TypeTag;
     return Dumux::start<TypeTag>(argc, argv, usage);
+#else
+#warning ALUGrid needed for this test.
+    std::cout << "ALUGrid needed for this test. Aborting." << std::endl;
+#endif
 }
diff --git a/test/decoupled/2p2c/test_adaptive2p2cproblem.hh b/test/decoupled/2p2c/test_adaptive2p2cproblem.hh
index 3aea9de28f..77fe24213b 100644
--- a/test/decoupled/2p2c/test_adaptive2p2cproblem.hh
+++ b/test/decoupled/2p2c/test_adaptive2p2cproblem.hh
@@ -24,11 +24,8 @@
 #ifndef DUMUX_TEST_ADAPTIVE_2P2C_PROBLEM_HH
 #define DUMUX_TEST_ADAPTIVE_2P2C_PROBLEM_HH
 
-#if HAVE_ALUGRID
-
-#include <dune/grid/yaspgrid.hh>
-#include <dune/grid/sgrid.hh>
-#include <dune/grid/alugrid/2d/alugrid.hh>
+#include <dune/grid/alugrid.hh>
+// #include <dune/grid/uggrid.hh>
 
 #include <dumux/common/cubegridcreator.hh>
 
@@ -56,8 +53,12 @@ NEW_TYPE_TAG(Adaptive2p2c, INHERITS_FROM(DecoupledTwoPTwoCAdaptive,Test2P2CSpati
 // Set the grid type
 SET_PROP(Adaptive2p2c, Grid)
 {
+#if HAVE_ALUGRID
     typedef Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming> type;
-//    typedef Dune::UGGrid<2> type;
+// #elif HAVE_UG
+//     typedef Dune::UGGrid<2> type;
+#endif
+    
 };
 // set the GridCreator property
 SET_TYPE_PROP(Adaptive2p2c, GridCreator, CubeGridCreator<TypeTag>);
@@ -208,7 +209,7 @@ Scalar temperatureAtPos(const GlobalPosition& globalPos) const
  */
 Scalar referencePressureAtPos(const GlobalPosition& globalPos) const
 {
-	return 1e6;
+    return 1e6;
 }
 /*!
  * \copydoc Dumux::TestDecTwoPTwoCProblem::boundaryTypesAtPos()
@@ -251,14 +252,14 @@ void dirichletAtPos(PrimaryVariables &bcValues, const GlobalPosition& globalPos)
  */
 void neumannAtPos(PrimaryVariables &neumannValues, const GlobalPosition& globalPos) const
 {
-    setZero(neumannValues, Indices::contiWEqIdx);
+    this->setZero(neumannValues, Indices::contiWEqIdx);
 }
 /*!
  * \copydoc Dumux::TestDecTwoPTwoCProblem::sourceAtPos()
  */
 void source(PrimaryVariables &values, const Element &element)
 {
-    setZero(values, Indices::contiWEqIdx);
+    this->setZero(values, Indices::contiWEqIdx);
     ElementPointer father(element);
     // access level 1 entity
     while (father->level() != this->gridAdapt().getMinLevel())
@@ -289,6 +290,5 @@ Grid grid_;
 Dumux::VtkMultiWriter<GridView> debugWriter_;
 };
 } //end namespace
-#endif //have alu
 
 #endif
-- 
GitLab