diff --git a/test/geomechanics/el2p/el2pproblem.hh b/test/geomechanics/el2p/el2pproblem.hh
index bad48992e8f5c22f64873f67eabb63dc0afa4193..b5b05745589c494f116e94311dd888ecdab84209 100644
--- a/test/geomechanics/el2p/el2pproblem.hh
+++ b/test/geomechanics/el2p/el2pproblem.hh
@@ -184,7 +184,11 @@ class El2P_TestProblem : public ImplicitPorousMediaProblem<TypeTag>
     enum {
         // indices of the primary variables
             pressureIdx = Indices::pwIdx,
-            saturationIdx = Indices::snIdx
+            saturationIdx = Indices::snIdx,
+            uxIdx = Indices::uxIdx,
+            uyIdx = Indices::uyIdx,
+            uzIdx = Indices::uzIdx
+
     };
     enum {
         // indices of the equations+
@@ -488,7 +492,7 @@ public:
         // The solid displacement normal to the lateral boundaries is fixed.
         if(globalPos[0] < eps_ || globalPos[0] > this->bBoxMax()[0]-eps_)
         {
-            values.setDirichlet(Indices::u(0));
+            values.setDirichlet(uxIdx);
             if(initializationRun_ == false)
             {
                 values.setDirichlet(pressureIdx, contiWEqIdx);
@@ -498,7 +502,7 @@ public:
         // The solid displacement normal to the lateral boundaries is fixed.
         if(globalPos[1] < eps_ || globalPos[1] > this->bBoxMax()[1]-eps_)
         {
-            values.setDirichlet(Indices::u(1));
+            values.setDirichlet(uyIdx);
             if(initializationRun_ == false)
             {
                 values.setDirichlet(pressureIdx, contiWEqIdx);
@@ -509,7 +513,7 @@ public:
         // Lower boundary closed for brine and CO2 flux, uz is fixed.
         if(globalPos[2] < eps_)
         {
-            values.setDirichlet(Indices::u(2));
+            values.setDirichlet(uzIdx);
         }
 
         // for the initialization run the pressure and saturation