diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0aae37de33695ded5a1ce0a68c792d21620864af..7f8f40cc4f3600eb6ca2303e492c077619e4c0ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,7 @@ include( CTest )
 
 # Build options
 option ( WALBERLA_DOUBLE_ACCURACY           "Floating point accuracy, defaults to double"     ON )
+option ( WALBERLA_PE_DOUBLE_ACCURACY        "PE Floating point accuracy, defaults to double"  ON )
 option ( WALBERLA_ENABLE_GUI                "Compile with GUI"                                   )
 
 option ( WALBERLA_BUILD_TESTS               "Build Testcases"                                    )
diff --git a/src/core/DataTypes.h b/src/core/DataTypes.h
index 765636c0626c6bd62bde1a57d94f86c0ed8f0bba..e114c39d33c73ec667d1360d9bb53799a55fd406 100644
--- a/src/core/DataTypes.h
+++ b/src/core/DataTypes.h
@@ -22,6 +22,7 @@
 #pragma once
 
 #include "waLBerlaDefinitions.h"
+#include "core/math/MathTrait.h"
 
 #include <boost/cstdint.hpp>
 #include <boost/make_shared.hpp>
@@ -171,6 +172,11 @@ typedef double real_t;
 #else
 typedef float  real_t;
 #endif
+#ifdef WALBERLA_PE_DOUBLE_ACCURACY
+typedef double pe_real_t;
+#else
+typedef float  pe_real_t;
+#endif
 
 template< typename T > inline real_t real_c  ( T t ) { return numeric_cast< real_t >(t); } ///< cast to type real_t using "real_c(x)"
 template< typename T > inline double double_c( T t ) { return numeric_cast< double >(t); } ///< cast to type double
@@ -214,20 +220,11 @@ inline bool realIsEqual( const real_t a, const real_t b, const real_t eps = real
    return std::fabs( a - b ) < eps;
 }
 
-
-inline bool floatIsEqual( long double lhs, long double rhs, const long double epsilon = real_comparison::Epsilon<long double>::value )
-{
-   return std::fabs( lhs - rhs ) < epsilon;
-}
-
-inline bool floatIsEqual( double lhs, double rhs, const double epsilon = real_comparison::Epsilon<double>::value )
-{
-   return std::fabs( lhs - rhs ) < epsilon;
-}
-
-inline bool floatIsEqual( float lhs, float rhs, const float epsilon = real_comparison::Epsilon<float>::value )
+template< typename T, typename U >
+inline bool floatIsEqual( T lhs, U rhs, const typename math::MathTrait<T,U>::LowType epsilon = real_comparison::Epsilon<typename math::MathTrait<T,U>::LowType>::value )
 {
-   return std::fabs( lhs - rhs ) < epsilon;
+   typedef typename math::MathTrait<T,U>::LowType LT;
+   return std::fabs( LT(lhs) - LT(rhs) ) < epsilon;
 }
 
 
diff --git a/src/core/math/Matrix3.h b/src/core/math/Matrix3.h
index 31f129e7db42db8e9e1c2249f265fec8f2d4d105..3548e0c77a0fdbf263e8e510dcedfc79fdd0a7af 100644
--- a/src/core/math/Matrix3.h
+++ b/src/core/math/Matrix3.h
@@ -1745,16 +1745,16 @@ namespace walberla {
 namespace debug {
 namespace check_functions_detail {
 
-template< >
-inline bool check_float_equal( const math::Matrix3<real_t> & lhs, const math::Matrix3<real_t> & rhs )
+template< typename T, typename U >
+inline bool check_float_equal( const math::Matrix3<T> & lhs, const math::Matrix3<U> & rhs )
 {
    return floatIsEqual( lhs[0], rhs[0] ) && floatIsEqual( lhs[1], rhs[1] ) && floatIsEqual( lhs[2], rhs[2] )
        && floatIsEqual( lhs[3], rhs[3] ) && floatIsEqual( lhs[4], rhs[4] ) && floatIsEqual( lhs[5], rhs[5] )
        && floatIsEqual( lhs[6], rhs[6] ) && floatIsEqual( lhs[7], rhs[7] ) && floatIsEqual( lhs[8], rhs[8] );
 }
 
-template< >
-inline bool check_float_equal_eps( const math::Matrix3<real_t> & lhs, const math::Matrix3<real_t> & rhs, const real_t epsilon )
+template< typename T, typename U >
+inline bool check_float_equal_eps( const math::Matrix3<T> & lhs, const math::Matrix3<U> & rhs, const typename math::MathTrait<T,U>::LowType epsilon )
 {
    return floatIsEqual( lhs[0], rhs[0], epsilon ) && floatIsEqual( lhs[1], rhs[1], epsilon ) && floatIsEqual( lhs[2], rhs[2], epsilon )
        && floatIsEqual( lhs[3], rhs[3], epsilon ) && floatIsEqual( lhs[4], rhs[4], epsilon ) && floatIsEqual( lhs[5], rhs[5], epsilon )
diff --git a/src/core/math/Parser.cpp b/src/core/math/Parser.cpp
index 523048e20eb445026ce458e44f4d7aec28a40846..a838422608a4c3337b76d11f6be71b32efa89eda 100644
--- a/src/core/math/Parser.cpp
+++ b/src/core/math/Parser.cpp
@@ -115,7 +115,7 @@ void FunctionParser::parse( const std::string & eq )
    if (isConstant_)
    {
       const double value = evaluate(std::map<std::string, double>());
-      isZero_ = floatIsEqual(value, 0);
+      isZero_ = floatIsEqual(value, 0.0);
    }
    else
    {
diff --git a/src/core/math/Quaternion.h b/src/core/math/Quaternion.h
index ddf90343008c172b186bfa2e07157a2c71ca1b77..3ce23a278997d6a641fa5804af924ec488b5a2ad 100644
--- a/src/core/math/Quaternion.h
+++ b/src/core/math/Quaternion.h
@@ -271,7 +271,7 @@ inline Quaternion<Type>::Quaternion( Vector3<Axis> axis, Type angle )
    static_assert(boost::is_floating_point<Axis>::value, "Axis has to be floating point!" );
 
    auto axisLength = axis.length();
-   if( (floatIsEqual(axisLength, 0)) || (math::equal(std::fabs(angle), real_c(0)))  ) {
+   if( (floatIsEqual(axisLength, 0.0)) || (math::equal(std::fabs(angle), real_c(0)))  ) {
       reset();
       return;
    }
@@ -1192,14 +1192,14 @@ namespace walberla {
 namespace debug {
 namespace check_functions_detail {
 
-template< >
-inline bool check_float_equal( const math::Quaternion<real_t> & lhs, const math::Quaternion<real_t> & rhs )
+template< typename T, typename U >
+inline bool check_float_equal( const math::Quaternion<T> & lhs, const math::Quaternion<U> & rhs )
 {
    return floatIsEqual( lhs[0], rhs[0] ) && floatIsEqual( lhs[1], rhs[1] ) && floatIsEqual( lhs[2], rhs[2] ) && floatIsEqual( lhs[3], rhs[3] );
 }
 
-template< >
-inline bool check_float_equal_eps( const math::Quaternion<real_t> & lhs, const math::Quaternion<real_t> & rhs, const real_t epsilon )
+template< typename T, typename U >
+inline bool check_float_equal_eps( const math::Quaternion<T> & lhs, const math::Quaternion<U> & rhs, const typename math::MathTrait<T,U>::LowType epsilon )
 {
    return floatIsEqual( lhs[0], rhs[0], epsilon ) && floatIsEqual( lhs[1], rhs[1], epsilon ) && floatIsEqual( lhs[2], rhs[2], epsilon ) && floatIsEqual( lhs[3], rhs[3], epsilon );
 }
diff --git a/src/core/math/Vector3.h b/src/core/math/Vector3.h
index 38fbf7ef0c40e0d3111bc7214bf21d6d8f05b826..6c2bc2f34de89e252876c1008afbff5288971bd9 100644
--- a/src/core/math/Vector3.h
+++ b/src/core/math/Vector3.h
@@ -1944,14 +1944,14 @@ namespace walberla {
 namespace debug {
 namespace check_functions_detail {
 
-template< >
-inline bool check_float_equal( const math::Vector3<real_t> & lhs, const math::Vector3<real_t> & rhs )
+template< typename T, typename U >
+inline bool check_float_equal( const math::Vector3<T> & lhs, const math::Vector3<U> & rhs )
 {
    return floatIsEqual( lhs[0], rhs[0] ) && floatIsEqual( lhs[1], rhs[1] ) && floatIsEqual( lhs[2], rhs[2] );
 }
 
-template< >
-inline bool check_float_equal_eps( const math::Vector3<real_t> & lhs, const math::Vector3<real_t> & rhs, const real_t epsilon )
+template< typename T, typename U >
+inline bool check_float_equal_eps( const math::Vector3<T> & lhs, const math::Vector3<U> & rhs, const typename math::MathTrait<T,U>::LowType epsilon )
 {
    return floatIsEqual( lhs[0], rhs[0], epsilon ) && floatIsEqual( lhs[1], rhs[1], epsilon ) && floatIsEqual( lhs[2], rhs[2], epsilon );
 }
diff --git a/src/geometry/GeometricalFunctions.cpp b/src/geometry/GeometricalFunctions.cpp
index ec8e02b826e544261c554eeb4c3e71bc7ee62a0b..7b7978c126b620ddb59c4311e942101a433a802a 100644
--- a/src/geometry/GeometricalFunctions.cpp
+++ b/src/geometry/GeometricalFunctions.cpp
@@ -61,32 +61,33 @@ namespace geometry {
  * \image html lineBox.png
  * \image latex lineBox.eps "Calculation of the closest points between a line and a box" width=455pt
  */
-void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>& p2, const Vector3<real_t>& c, const Matrix3<real_t>& R,
-                              const Vector3<real_t>& side, Vector3<real_t>& lret, Vector3<real_t>& bret )
+template <typename T>
+void getClosestLineBoxPoints( const Vector3<T>& p1, const Vector3<T>& p2, const Vector3<T>& c, const Matrix3<T>& R,
+                              const Vector3<T>& side, Vector3<T>& lret, Vector3<T>& bret )
 {
    using namespace walberla::math;
    //----- Note: All computations will be performed in the box-relative coordinate-system -----
 
 
    // Calculating the global and relative direction of the line p1--p2
-   const Vector3<real_t> l( p2 - p1 );
-   Vector3<real_t> tmp( R * l );
+   const Vector3<T> l( p2 - p1 );
+   Vector3<T> tmp( R * l );
 
    // Saving the sign of the direction p1--p2
-   const real_t sign[] = { math::sign(tmp[0]), math::sign(tmp[1]), math::sign(tmp[2]) };
+   const T sign[] = { math::sign(tmp[0]), math::sign(tmp[1]), math::sign(tmp[2]) };
 
    // Calculating the absolute values of the direction direction
-   const real_t v [] = { sign[0]*tmp[0], sign[1]*tmp[1], sign[2]*tmp[2] };
-   const real_t v2[] = { sq( v[0] )   , sq( v[1] )   , sq( v[2] )    };
+   const T v [] = { sign[0]*tmp[0], sign[1]*tmp[1], sign[2]*tmp[2] };
+   const T v2[] = { sq( v[0] )   , sq( v[1] )   , sq( v[2] )    };
 
    // Calculating the starting point of the line p1--p2 in box-relative coordinates
    tmp = p1 - c;
-   const real_t s[] = { sign[0]*( R[0]*tmp[0] + R[3]*tmp[1] + R[6]*tmp[2] ),
+   const T s[] = { sign[0]*( R[0]*tmp[0] + R[3]*tmp[1] + R[6]*tmp[2] ),
                       sign[1]*( R[1]*tmp[0] + R[4]*tmp[1] + R[7]*tmp[2] ),
                       sign[2]*( R[2]*tmp[0] + R[5]*tmp[1] + R[8]*tmp[2] ) };
 
    // Calculating the half lengths of the box
-   const real_t h[] = { real_t(0.5)*side[0], real_t(0.5)*side[1], real_t(0.5)*side[2] };
+   const T h[] = { T(0.5)*side[0], T(0.5)*side[1], T(0.5)*side[2] };
 
 
    // Estimating the region of the starting point depending on which side of the
@@ -95,10 +96,10 @@ void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>&
    // are no more. Additionally, d|d|^2/dt is computed for t=0. If it is >= 0
    // then p1 is the closest point since the line points away from the box.
    int  region [] = { 0, 0, 0 };
-   real_t tanchor[] = { 2, 2, 2 };  // Invalid t values; t cannot be greater than 1
-   real_t dd2dt( 0 );
+   T tanchor[] = { 2, 2, 2 };  // Invalid t values; t cannot be greater than 1
+   T dd2dt( 0 );
 
-   if( v[0] > Limits<real_t>::epsilon() )
+   if( v[0] > Limits<T>::epsilon() )
    {
       if( s[0] < -h[0] ) {
          region[0]  = -1;
@@ -115,7 +116,7 @@ void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>&
       }
    }
 
-   if( v[1] > Limits<real_t>::epsilon() )
+   if( v[1] > Limits<T>::epsilon() )
    {
       if( s[1] < -h[1] ) {
          region[1]  = -1;
@@ -132,7 +133,7 @@ void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>&
       }
    }
 
-   if( v[2] > Limits<real_t>::epsilon() )
+   if( v[2] > Limits<T>::epsilon() )
    {
       if( s[2] < -h[2] ) {
          region[2]  = -1;
@@ -151,26 +152,26 @@ void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>&
 
 
    // Calculating the value t for the closest point on the line
-   real_t t( 0 );
+   T t( 0 );
 
-   if( dd2dt < -Limits<real_t>::accuracy() )
+   if( dd2dt < -Limits<T>::accuracy() )
    {
       do {
          // Finding the t value for the next clip plane/line intersection
-         real_t next_t( 1 );
+         T next_t( 1 );
 
-         if( ( tanchor[0] > t ) && ( tanchor[0] < real_t(1) ) && ( tanchor[0] < next_t ) ) {
+         if( ( tanchor[0] > t ) && ( tanchor[0] < T(1) ) && ( tanchor[0] < next_t ) ) {
             next_t = tanchor[0];
          }
-         if( ( tanchor[1] > t ) && ( tanchor[1] < real_t(1) ) && ( tanchor[1] < next_t ) ) {
+         if( ( tanchor[1] > t ) && ( tanchor[1] < T(1) ) && ( tanchor[1] < next_t ) ) {
             next_t = tanchor[1];
          }
-         if( ( tanchor[2] > t ) && ( tanchor[2] < real_t(1) ) && ( tanchor[2] < next_t ) ) {
+         if( ( tanchor[2] > t ) && ( tanchor[2] < T(1) ) && ( tanchor[2] < next_t ) ) {
             next_t = tanchor[2];
          }
 
          // Computing d|d|^2/dt for the next t
-         real_t next_dd2dt( 0 );
+         T next_dd2dt( 0 );
 
          if( region[0] != 0 ) {
             next_dd2dt += v2[0] * ( next_t - tanchor[0] );
@@ -205,11 +206,11 @@ void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>&
          t = next_t;
          dd2dt = next_dd2dt;
       }
-      while( t < real_t(1) );
+      while( t < T(1) );
    }
 
-   WALBERLA_ASSERT_GREATER_EQUAL( t, real_t(0), "Invalid line point" );
-   WALBERLA_ASSERT_LESS_EQUAL( t, real_t(1), "Invalid line point" );
+   WALBERLA_ASSERT_GREATER_EQUAL( t, T(0), "Invalid line point" );
+   WALBERLA_ASSERT_LESS_EQUAL( t, T(1), "Invalid line point" );
 
    // Computing the closest point on the line
    lret = p1 + t * l;
@@ -229,6 +230,12 @@ void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>&
 
    bret = ( R * tmp ) + c;
 }
+template
+void getClosestLineBoxPoints<float>( const Vector3<float>& p1, const Vector3<float>& p2, const Vector3<float>& c, const Matrix3<float>& R,
+                                     const Vector3<float>& side, Vector3<float>& lret, Vector3<float>& bret );
+template
+void getClosestLineBoxPoints<double>( const Vector3<double>& p1, const Vector3<double>& p2, const Vector3<double>& c, const Matrix3<double>& R,
+                                      const Vector3<double>& side, Vector3<double>& lret, Vector3<double>& bret );
 //*************************************************************************************************
 
 
@@ -248,45 +255,46 @@ void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>&
  * involving the endpoint of at least one line will be returned. This will also work correctly
  * for zero length lines, e.g. if \a a1 = \a a2 and/or \a b1 = \a b2.
  */
-void getClosestLineSegmentPoints( const Vector3<real_t>& a1, const Vector3<real_t>& a2, const Vector3<real_t>& b1, const Vector3<real_t>& b2,
-                                  Vector3<real_t>& cp1, Vector3<real_t>& cp2 )
+template <typename T>
+void getClosestLineSegmentPoints( const Vector3<T>& a1, const Vector3<T>& a2, const Vector3<T>& b1, const Vector3<T>& b2,
+                                  Vector3<T>& cp1, Vector3<T>& cp2 )
 {
    using namespace walberla::math;
    //----- Checking the vertex-vertex features -----
 
-   const Vector3<real_t> a1a2( a2 - a1 );
-   const Vector3<real_t> b1b2( b2 - b1 );
-   const Vector3<real_t> a1b1( b1 - a1 );
-   const real_t da1 ( a1a2 * a1b1 );
-   const real_t db1 ( b1b2 * a1b1 );
-   if( da1 <= +Limits<real_t>::fpuAccuracy() && db1 >= -Limits<real_t>::fpuAccuracy() ) {
+   const Vector3<T> a1a2( a2 - a1 );
+   const Vector3<T> b1b2( b2 - b1 );
+   const Vector3<T> a1b1( b1 - a1 );
+   const T da1 ( a1a2 * a1b1 );
+   const T db1 ( b1b2 * a1b1 );
+   if( da1 <= +Limits<T>::fpuAccuracy() && db1 >= -Limits<T>::fpuAccuracy() ) {
       cp1 = a1;
       cp2 = b1;
       return;
    }
 
-   const Vector3<real_t> a1b2( b2 - a1 );
-   const real_t da2 ( a1a2 * a1b2 );
-   const real_t db2 ( b1b2 * a1b2 );
-   if( da2 <= +Limits<real_t>::fpuAccuracy() && db2 <= +Limits<real_t>::fpuAccuracy() ) {
+   const Vector3<T> a1b2( b2 - a1 );
+   const T da2 ( a1a2 * a1b2 );
+   const T db2 ( b1b2 * a1b2 );
+   if( da2 <= +Limits<T>::fpuAccuracy() && db2 <= +Limits<T>::fpuAccuracy() ) {
       cp1 = a1;
       cp2 = b2;
       return;
    }
 
-   const Vector3<real_t> a2b1( b1 - a2 );
-   const real_t da3 ( a1a2 * a2b1 );
-   const real_t db3 ( b1b2 * a2b1 );
-   if( da3 >= -Limits<real_t>::fpuAccuracy() && db3 >= -Limits<real_t>::fpuAccuracy() ) {
+   const Vector3<T> a2b1( b1 - a2 );
+   const T da3 ( a1a2 * a2b1 );
+   const T db3 ( b1b2 * a2b1 );
+   if( da3 >= -Limits<T>::fpuAccuracy() && db3 >= -Limits<T>::fpuAccuracy() ) {
       cp1 = a2;
       cp2 = b1;
       return;
    }
 
-   const Vector3<real_t> a2b2( b2 - a2 );
-   const real_t da4 ( a1a2 * a2b2 );
-   const real_t db4 ( b1b2 * a2b2 );
-   if( da4 >= -Limits<real_t>::fpuAccuracy() && db4 <= +Limits<real_t>::fpuAccuracy() ) {
+   const Vector3<T> a2b2( b2 - a2 );
+   const T da4 ( a1a2 * a2b2 );
+   const T db4 ( b1b2 * a2b2 );
+   if( da4 >= -Limits<T>::fpuAccuracy() && db4 <= +Limits<T>::fpuAccuracy() ) {
       cp1 = a2;
       cp2 = b2;
       return;
@@ -297,44 +305,44 @@ void getClosestLineSegmentPoints( const Vector3<real_t>& a1, const Vector3<real_
    // If one or both of the line segments have zero length, we will never get here. Therefore
    // we don't have to worry about possible divisions by zero in the following calculations.
 
-   Vector3<real_t> n, k;
+   Vector3<T> n, k;
 
-   const real_t la( a1a2 * a1a2 );
-   if( da1 >= -Limits<real_t>::fpuAccuracy() && da3 <= +Limits<real_t>::fpuAccuracy() ) {
+   const T la( a1a2 * a1a2 );
+   if( da1 >= -Limits<T>::fpuAccuracy() && da3 <= +Limits<T>::fpuAccuracy() ) {
       k = (da1 / la) * a1a2;
       n = a1b1 - k;
-      if( b1b2 * n >= -Limits<real_t>::fpuAccuracy() ) {
+      if( b1b2 * n >= -Limits<T>::fpuAccuracy() ) {
          cp1 = a1 + k;
          cp2 = b1;
          return;
       }
    }
 
-   if( da2 >= -Limits<real_t>::fpuAccuracy() && da4 <= +Limits<real_t>::fpuAccuracy() ) {
+   if( da2 >= -Limits<T>::fpuAccuracy() && da4 <= +Limits<T>::fpuAccuracy() ) {
       k = (da2 / la) * a1a2;
       n = a1b2 - k;
-      if( b1b2 * n <= +Limits<real_t>::fpuAccuracy() ) {
+      if( b1b2 * n <= +Limits<T>::fpuAccuracy() ) {
          cp1 = a1 + k;
          cp2 = b2;
          return;
       }
    }
 
-   const real_t lb( b1b2 * b1b2 );
-   if( db1 <= +Limits<real_t>::fpuAccuracy() && db2 >= -Limits<real_t>::fpuAccuracy() ) {
+   const T lb( b1b2 * b1b2 );
+   if( db1 <= +Limits<T>::fpuAccuracy() && db2 >= -Limits<T>::fpuAccuracy() ) {
       k = (-db1 / lb) * b1b2;
       n = -a1b1 - k;
-      if( a1a2 * n >= -Limits<real_t>::fpuAccuracy() ) {
+      if( a1a2 * n >= -Limits<T>::fpuAccuracy() ) {
          cp1 = a1;
          cp2= b1 + k;
          return;
       }
    }
 
-   if( db3 <= +Limits<real_t>::fpuAccuracy() && db4 >= -Limits<real_t>::fpuAccuracy() ) {
+   if( db3 <= +Limits<T>::fpuAccuracy() && db4 >= -Limits<T>::fpuAccuracy() ) {
       k = (-db3 / lb) * b1b2;
       n = -a2b1 - k;
-      if( a1a2 * n <= +Limits<real_t>::fpuAccuracy() ) {
+      if( a1a2 * n <= +Limits<T>::fpuAccuracy() ) {
          cp1 = a2;
          cp2 = b1 + k;
          return;
@@ -344,18 +352,24 @@ void getClosestLineSegmentPoints( const Vector3<real_t>& a1, const Vector3<real_
 
    //----- Checking the edge-edge features -----
 
-   const real_t scale( a1a2 * b1b2 );
-   real_t div( la * lb - math::sq(scale) );
+   const T scale( a1a2 * b1b2 );
+   T div( la * lb - math::sq(scale) );
 
-   WALBERLA_ASSERT_GREATER( div, real_t(0), std::setprecision(16) << "Invalid division\n" << a1 << "\n" << a2 << "\n" << b1 << "\n" << b2 );
-   div = real_t(1) / div;
+   WALBERLA_ASSERT_GREATER( div, T(0), std::setprecision(16) << "Invalid division\n" << a1 << "\n" << a2 << "\n" << b1 << "\n" << b2 );
+   div = T(1) / div;
 
-   const real_t s( ( lb    * da1 - scale * db1 ) * div );
-   const real_t t( ( scale * da1 - la    * db1 ) * div );
+   const T s( ( lb    * da1 - scale * db1 ) * div );
+   const T t( ( scale * da1 - la    * db1 ) * div );
 
    cp1 = a1 + s * a1a2;
    cp2 = b1 + t * b1b2;
 }
+template
+void getClosestLineSegmentPoints<float>( const Vector3<float>& a1, const Vector3<float>& a2, const Vector3<float>& b1, const Vector3<float>& b2,
+                                         Vector3<float>& cp1, Vector3<float>& cp2 );
+template
+void getClosestLineSegmentPoints<double>( const Vector3<double>& a1, const Vector3<double>& a2, const Vector3<double>& b1, const Vector3<double>& b2,
+                                          Vector3<double>& cp1, Vector3<double>& cp2 );
 //*************************************************************************************************
 
 
@@ -377,30 +391,37 @@ void getClosestLineSegmentPoints( const Vector3<real_t>& a1, const Vector3<real_
    \f[  s = \frac{\det(o_2-o_1,d_2,d_1 \times d_2)}{\left \Vert d_1 \times d_2 \right \| ^2 }  \f]
    \f[  t = \frac{\det(o_2-o_1,d_1,d_1 \times d_2)}{\left \Vert d_1 \times d_2 \right \| ^2 }  \f]
  */
-void intersectLines( const Vector3<real_t>& o1, const Vector3<real_t>& d1, const Vector3<real_t>& o2, const Vector3<real_t>& d2,
-                     real_t& s, real_t& t )
+template <typename T>
+void intersectLines( const Vector3<T>& o1, const Vector3<T>& d1, const Vector3<T>& o2, const Vector3<T>& d2,
+                     T& s, T& t )
 {
    using namespace walberla::math;
 
-   const real_t sqrlen( ( d1 % d2 ).sqrLength() );
+   const T sqrlen( ( d1 % d2 ).sqrLength() );
 
-   if( floatIsEqual(sqrlen, 0) )
+   if( floatIsEqual(sqrlen, 0.0) )
    {
-      s = real_t(0),
-      t = real_t(0);
+      s = T(0),
+      t = T(0);
    }
    else
    {
-      const real_t isqrlen( real_t(1) / sqrlen );
-      const Vector3<real_t> p( o2 - o1 );
-      const real_t dot(  d1 * d2 );
-      const real_t a  (  d1 * p  );
-      const real_t b  ( -d2 * p  );
+      const T isqrlen( T(1) / sqrlen );
+      const Vector3<T> p( o2 - o1 );
+      const T dot(  d1 * d2 );
+      const T a  (  d1 * p  );
+      const T b  ( -d2 * p  );
 
       s = ( a * ( d2 * d2 ) + dot*b ) * isqrlen;
       t = ( b * ( d1 * d1 ) + dot*a ) * isqrlen;
    }
 }
+template
+void intersectLines<float>( const Vector3<float>& o1, const Vector3<float>& d1, const Vector3<float>& o2, const Vector3<float>& d2,
+                            float& s, float& t );
+template
+void intersectLines<double>( const Vector3<double>& o1, const Vector3<double>& d1, const Vector3<double>& o2, const Vector3<double>& d2,
+                             double& s, double& t );
 //*************************************************************************************************
 
 } // namespace math
diff --git a/src/geometry/GeometricalFunctions.h b/src/geometry/GeometricalFunctions.h
index 27e1f89a786e6a8d6c54a40d68d2a303532f0c04..584d93a3cc73af59e37d16fb388a8d7d5a51cefb 100644
--- a/src/geometry/GeometricalFunctions.h
+++ b/src/geometry/GeometricalFunctions.h
@@ -47,14 +47,17 @@ namespace geometry {
 //*************************************************************************************************
 /*!\name Geometry functions */
 //@{
-void getClosestLineBoxPoints( const Vector3<real_t>& p1, const Vector3<real_t>& p2, const Vector3<real_t>& c, const Matrix3<real_t>& R,
-                              const Vector3<real_t>& side, Vector3<real_t>& lret, Vector3<real_t>& bret);
+template <typename T>
+void getClosestLineBoxPoints( const Vector3<T>& p1, const Vector3<T>& p2, const Vector3<T>& c, const Matrix3<T>& R,
+                              const Vector3<T>& side, Vector3<T>& lret, Vector3<T>& bret);
 
-void getClosestLineSegmentPoints( const Vector3<real_t>& a1, const Vector3<real_t>& a2, const Vector3<real_t>& b1, const Vector3<real_t>& b2,
-                                  Vector3<real_t>& cp1, Vector3<real_t>& cp2 );
+template <typename T>
+void getClosestLineSegmentPoints( const Vector3<T>& a1, const Vector3<T>& a2, const Vector3<T>& b1, const Vector3<T>& b2,
+                                  Vector3<T>& cp1, Vector3<T>& cp2 );
 
-void intersectLines( const Vector3<real_t>& o1, const Vector3<real_t>& d1, const Vector3<real_t>& o2, const Vector3<real_t>& d2,
-                     real_t& s, real_t& t );
+template <typename T>
+void intersectLines( const Vector3<T>& o1, const Vector3<T>& d1, const Vector3<T>& o2, const Vector3<T>& d2,
+                     T& s, T& t );
 
 inline bool originInTetrahedron( const Vector3<real_t>& A, const Vector3<real_t>& B, const Vector3<real_t>& C, const Vector3<real_t>& D );
 inline bool pointInTetrahedron ( const Vector3<real_t>& A, const Vector3<real_t>& B, const Vector3<real_t>& C, const Vector3<real_t>& D,
diff --git a/src/pe/BlockFunctions.h b/src/pe/BlockFunctions.h
index c1e8e466d6fb075480b289dbdc545b54013a9d25..1990ec0f53f1009913d39c260eaed6db78b03603 100644
--- a/src/pe/BlockFunctions.h
+++ b/src/pe/BlockFunctions.h
@@ -47,10 +47,11 @@ bool hasNeighborOwner(const BlockT& block, const Owner& owner)
  * Returns -1 if no valid block is found otherwise the process rank of the containing block is returned.
  */
 template <class BlockT>
-Owner findContainingProcess(const BlockT& block, math::Vector3<real_t> pt)
+Owner findContainingProcess(const BlockT& block, math::Vector3<pe_real_t> pt)
 {
    if (block.getAABB().contains(pt)) return Owner(int_c(block.getProcess()), block.getId().getID());
-   if (!block.getBlockStorage().getDomain().contains(pt)) block.getBlockStorage().mapToPeriodicDomain(pt);
+   Vector3<real_t> pr(real_c(pt[0]), real_c(pt[1]), real_c(pt[2]));
+   if (!block.getBlockStorage().getDomain().contains(pr)) block.getBlockStorage().mapToPeriodicDomain(pr);
    for( uint_t i = uint_t(0); i != block.getNeighborhoodSize(); ++i )
    {
       if (block.getNeighborAABB(i).contains(pt)) return Owner(int_c(block.getNeighborProcess(i)), block.getNeighborId(i).getID());
diff --git a/src/pe/CMakeLists.txt b/src/pe/CMakeLists.txt
index 1dd7edd80c06535b2df4798075355d75fa46cd90..4e376d47d7324394bb2a86b9a9921758974bc3a8 100644
--- a/src/pe/CMakeLists.txt
+++ b/src/pe/CMakeLists.txt
@@ -5,7 +5,11 @@
 #
 ###################################################################################################
 
-if(WALBERLA_DOUBLE_ACCURACY)
+if (WALBERLA_DOUBLE_ACCURACY AND NOT WALBERLA_PE_DOUBLE_ACCURACY)
+    message(FATAL_ERROR "PE cannot use double precision if waLBerla uses single precision")
+endif()
+
+if(WALBERLA_PE_DOUBLE_ACCURACY)
     set(CCD_DOUBLE ON)
     set(CCD_SINGLE OFF)
 else()
diff --git a/src/pe/Config.h b/src/pe/Config.h
index 93fde81a781689e0b748ae2be17b78956ae40624..e83f9ab6914f8a1989fd88c04cf983585e78b026 100644
--- a/src/pe/Config.h
+++ b/src/pe/Config.h
@@ -44,7 +44,7 @@ namespace pe {
  * For more details about the calculation of the motion of a rigid body, see the description of
  * the RigidBody::calcMotion() function.
  */
-const real_t sleepThreshold = real_c( 0 );
+const pe_real_t sleepThreshold = real_c( 0 );
 //*************************************************************************************************
 
 
@@ -57,7 +57,7 @@ const real_t sleepThreshold = real_c( 0 );
  * recency-weighted average equal to the current motion of the rigid body, a bias of one
  * ignores the current motion altogether.
  */
-const real_t sleepBias = real_c( 0.5 );
+const pe_real_t sleepBias = real_c( 0.5 );
 //*************************************************************************************************
 
 }  // namespace pe
diff --git a/src/pe/Materials.cpp b/src/pe/Materials.cpp
index ef789831e16d8bf53daf7aa1415ab622d8d04efa..2d92d01d87992ff47b05ec75d6c2c7f1e1d8a239 100644
--- a/src/pe/Materials.cpp
+++ b/src/pe/Materials.cpp
@@ -72,34 +72,34 @@ bool Material::activateMaterials()
 
    // Initializing the coefficients of restitution
    //                       | Iron                   | Copper                 | Granite                | Oak                    | Fir                     |
-   const real_t cor[5][5] = {
-                            { static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25) },  // Iron
-                            { static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25) },  // Copper
-                            { static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25) },  // Granite
-                            { static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25) },  // Oak
-                            { static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25), static_cast<real_t>(0.25) }   // Fir
+   const pe_real_t cor[5][5] = {
+                            { static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25) },  // Iron
+                            { static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25) },  // Copper
+                            { static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25) },  // Granite
+                            { static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25) },  // Oak
+                            { static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25), static_cast<pe_real_t>(0.25) }   // Fir
                           };
    corTable_ = cor;
 
    // Initializing the coefficients of static friction
    //                       | Iron                   | Copper                 | Granite                | Oak                    | Fir                     |
-   const real_t csf[5][5] = {
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) },  // Iron
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) },  // Copper
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) },  // Granite
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) },  // Oak
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) }   // Fir
+   const pe_real_t csf[5][5] = {
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) },  // Iron
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) },  // Copper
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) },  // Granite
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) },  // Oak
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) }   // Fir
                           };
    csfTable_ = csf;
 
    // Initializing the coefficients of dynamic friction
    //                       | Iron                   | Copper                 | Granite                | Oak                    | Fir                     |
-   const real_t cdf[5][5] = {
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) },  // Iron
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) },  // Copper
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) },  // Granite
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) },  // Oak
-                            { static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20), static_cast<real_t>(0.20) }   // Fir
+   const pe_real_t cdf[5][5] = {
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) },  // Iron
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) },  // Copper
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) },  // Granite
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) },  // Oak
+                            { static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20), static_cast<pe_real_t>(0.20) }   // Fir
                           };
    cdfTable_ = cdf;
 
@@ -158,9 +158,9 @@ bool Material::activateMaterials()
  * made of similar material. The composite coefficient of restitution \f$e_*\f$ is estimated as
  * proposed by Stronge: \f$\frac{e_*^2}{k_*} = \frac{e_1^2}{k_1} + \frac{e_2^2}{k_2}\f$.
  */
-MaterialID createMaterial( const std::string& name, real_t density, real_t cor,
-                           real_t csf, real_t cdf, real_t poisson, real_t young,
-                           real_t stiffness, real_t dampingN, real_t dampingT )
+MaterialID createMaterial( const std::string& name, pe_real_t density, pe_real_t cor,
+                           pe_real_t csf, pe_real_t cdf, pe_real_t poisson, pe_real_t young,
+                           pe_real_t stiffness, pe_real_t dampingN, pe_real_t dampingT )
 {
    typedef Material M;
 
@@ -251,8 +251,8 @@ MaterialID createMaterial( const std::string& name, real_t density, real_t cor,
 // named 'Material', followed by an incrementing number.
 // Note that the material has to be created on all processes in an MPI parallel simulation.
 */
-MaterialID createMaterial( real_t density, real_t cor, real_t csf, real_t cdf, real_t poisson, real_t young,
-                           real_t stiffness, real_t dampingN, real_t dampingT )
+MaterialID createMaterial( pe_real_t density, pe_real_t cor, pe_real_t csf, pe_real_t cdf, pe_real_t poisson, pe_real_t young,
+                           pe_real_t stiffness, pe_real_t dampingN, pe_real_t dampingT )
 {
    std::ostringstream sstr;
 
diff --git a/src/pe/Materials.h b/src/pe/Materials.h
index 355099c08a31ec9a2e347619ae9c2c28d0f921c6..51927ed28c8c22c52408c480707a60bf7337f7c0 100644
--- a/src/pe/Materials.h
+++ b/src/pe/Materials.h
@@ -83,12 +83,12 @@ namespace pe {
 
    // Getting the density, coefficient of restitution, coefficient of static and
    // dynamic friction, Poisson's ratio and Young's modulus of the material
-   real_t density = Material::getDensity( myMaterial );
-   real_t cor     = Material::getRestitution( myMaterial );
-   real_t csf     = Material::getStaticFriction( myMaterial );
-   real_t cdf     = Material::getDynamicFriction( myMaterial );
-   real_t poisson = Material::getPoissonRatio( myMaterial );
-   real_t young   = Material::getYoungModulus( myMaterial ):
+   pe_real_t density = Material::getDensity( myMaterial );
+   pe_real_t cor     = Material::getRestitution( myMaterial );
+   pe_real_t csf     = Material::getStaticFriction( myMaterial );
+   pe_real_t cdf     = Material::getDynamicFriction( myMaterial );
+   pe_real_t poisson = Material::getPoissonRatio( myMaterial );
+   pe_real_t young   = Material::getYoungModulus( myMaterial ):
    \endcode
  */
 class WALBERLA_PUBLIC Material
@@ -102,9 +102,9 @@ public:
    //**Constructor*********************************************************************************
    /*!\name Constructor */
    //@{
-   explicit inline Material( const std::string& name, real_t density, real_t cor,
-                             real_t csf, real_t cdf, real_t poisson, real_t young, real_t stiffness,
-                             real_t dampingN, real_t dampingT );
+   explicit inline Material( const std::string& name, pe_real_t density, pe_real_t cor,
+                             pe_real_t csf, pe_real_t cdf, pe_real_t poisson, pe_real_t young, pe_real_t stiffness,
+                             pe_real_t dampingN, pe_real_t dampingT );
    // No explicitly declared copy constructor.
    //@}
    //**********************************************************************************************
@@ -121,44 +121,44 @@ public:
    /*!\name Get functions */
    //@{
    inline const std::string&   getName()            const;
-   inline real_t               getDensity()         const;
-   inline real_t               getRestitution()     const;
-   inline real_t               getStaticFriction()  const;
-   inline real_t               getDynamicFriction() const;
-   inline real_t               getPoissonRatio()    const;
-   inline real_t               getYoungModulus()    const;
-   inline real_t               getStiffness()       const;
-   inline real_t               getDampingN()        const;
-   inline real_t               getDampingT()        const;
+   inline pe_real_t               getDensity()         const;
+   inline pe_real_t               getRestitution()     const;
+   inline pe_real_t               getStaticFriction()  const;
+   inline pe_real_t               getDynamicFriction() const;
+   inline pe_real_t               getPoissonRatio()    const;
+   inline pe_real_t               getYoungModulus()    const;
+   inline pe_real_t               getStiffness()       const;
+   inline pe_real_t               getDampingN()        const;
+   inline pe_real_t               getDampingT()        const;
 
    static        MaterialID         find( const std::string& name );
    static        std::vector<MaterialID> findPrefix( const std::string& prefix );
    static inline const std::string&   getName( MaterialID material );
-   static inline real_t               getDensity( MaterialID material );
-   static inline real_t               getRestitution( MaterialID material );
-   static inline real_t               getRestitution( MaterialID material1, MaterialID material2 );
-   static inline real_t               getStaticFriction( MaterialID material );
-   static inline real_t               getStaticFriction( MaterialID material1, MaterialID material2 );
-   static inline real_t               getDynamicFriction( MaterialID material );
-   static inline real_t               getDynamicFriction( MaterialID material1, MaterialID material2 );
-   static inline real_t               getPoissonRatio( MaterialID material );
-   static inline real_t               getYoungModulus( MaterialID material );
-   static inline real_t               getYoungModulus( MaterialID material1, MaterialID material2 );
-   static inline real_t               getStiffness( MaterialID material );
-   static inline real_t               getStiffness( MaterialID material1, MaterialID material2 );
-   static inline real_t               getDampingN( MaterialID material );
-   static inline real_t               getDampingN( MaterialID material1, MaterialID material2 );
-   static inline real_t               getDampingT( MaterialID material );
-   static inline real_t               getDampingT( MaterialID material1, MaterialID material2 );
+   static inline pe_real_t               getDensity( MaterialID material );
+   static inline pe_real_t               getRestitution( MaterialID material );
+   static inline pe_real_t               getRestitution( MaterialID material1, MaterialID material2 );
+   static inline pe_real_t               getStaticFriction( MaterialID material );
+   static inline pe_real_t               getStaticFriction( MaterialID material1, MaterialID material2 );
+   static inline pe_real_t               getDynamicFriction( MaterialID material );
+   static inline pe_real_t               getDynamicFriction( MaterialID material1, MaterialID material2 );
+   static inline pe_real_t               getPoissonRatio( MaterialID material );
+   static inline pe_real_t               getYoungModulus( MaterialID material );
+   static inline pe_real_t               getYoungModulus( MaterialID material1, MaterialID material2 );
+   static inline pe_real_t               getStiffness( MaterialID material );
+   static inline pe_real_t               getStiffness( MaterialID material1, MaterialID material2 );
+   static inline pe_real_t               getDampingN( MaterialID material );
+   static inline pe_real_t               getDampingN( MaterialID material1, MaterialID material2 );
+   static inline pe_real_t               getDampingT( MaterialID material );
+   static inline pe_real_t               getDampingT( MaterialID material1, MaterialID material2 );
    //@}
    //**********************************************************************************************
 
    //**Set functions*******************************************************************************
    /*!\name Set functions */
    //@{
-   static inline void setRestitution( MaterialID material1, MaterialID material2, real_t cor );
-   static inline void setStaticFriction( MaterialID material1, MaterialID material2, real_t csf );
-   static inline void setDynamicFriction( MaterialID material1, MaterialID material2, real_t cdf );
+   static inline void setRestitution( MaterialID material1, MaterialID material2, pe_real_t cor );
+   static inline void setStaticFriction( MaterialID material1, MaterialID material2, pe_real_t csf );
+   static inline void setDynamicFriction( MaterialID material1, MaterialID material2, pe_real_t cdf );
    //@}
    //**********************************************************************************************
 
@@ -174,8 +174,8 @@ private:
    /*!\name Member variables */
    //@{
    std::string name_;  //!< The name of the material.
-   real_t density_;      //!< The density of the material.
-   real_t restitution_;  //!< The coefficient of restitution (COR) of a self-similar collision \f$ [0..1] \f$.
+   pe_real_t density_;      //!< The density of the material.
+   pe_real_t restitution_;  //!< The coefficient of restitution (COR) of a self-similar collision \f$ [0..1] \f$.
                        /*!< The COR represents the energy dissipated during a collision between
                             self-similar bodies, that is bodies with similar materials. A value of
                             0 corresponds to completely inelastic collision where all energy is
@@ -187,7 +187,7 @@ private:
                             During a collision, the COR values of the two colliding
                             rigid bodies can be used by the collision response mechanism to
                             determine the restitution factor of the contact point. */
-   real_t static_;       //!< The coefficient of static friction (CSF) \f$ [0..\infty) \f$.
+   pe_real_t static_;       //!< The coefficient of static friction (CSF) \f$ [0..\infty) \f$.
                        /*!< The CSF is a dimensionless, non-negative quantity representing the
                             amount of static friction between two touching rigid bodies. Static
                             friction occurs in case the relative tangential velocity between the
@@ -196,14 +196,14 @@ private:
                             \f[ |\vec{f_t}| \leq \mu_s |\vec{f_n}| \f]
                             The direction of the friction must oppose acceleration if sliding is
                             imminent and is unresticted otherwise. */
-   real_t dynamic_;      //!< The coefficient of dynamic friction (CDF) \f$ [0..\infty) \f$.
+   pe_real_t dynamic_;      //!< The coefficient of dynamic friction (CDF) \f$ [0..\infty) \f$.
                        /*!< The CDF is a dimensionless, non-negative quantity representing the
                             amount of dynamic friction between two touching rigid bodies. Dynamic
                             friction occurs in case the relative tangential velocity between the
                             two bodies is greater than 0. Then the force magnitudes of the normal
                             and friction force are related by an inequality:
                             \f[ |\vec{f_t}| = -\mu_d |\vec{f_n}| \frac{\vec{v_t}}{|\vec{v_t}|} \f] */
-   real_t poisson_;      //!< The Poisson's ratio for the material \f$ [-1..0.5] \f$.
+   pe_real_t poisson_;      //!< The Poisson's ratio for the material \f$ [-1..0.5] \f$.
                        /*!< When a material is compressed in one direction, it usually tends to
                             expand in the other two directions perpendicular to the direction of
                             compression. This effect is called Poisson effect. In this context, the
@@ -212,22 +212,22 @@ private:
                             (in the direction of the applied load). For stable, isotropic, linear
                             elastic materials this ratio cannot be less than -1.0 nor greater than
                             0.5 due to the requirement that Young's modulus has positive values. */
-   real_t young_;        //!< The Young's modulus for the material \f$ (0..\infty) \f$.
+   pe_real_t young_;        //!< The Young's modulus for the material \f$ (0..\infty) \f$.
                        /*!< The Young's modulus is a measure for the stiffness of an isotropic
                             elastic material. It is defined as the ratio of the uniaxial stress
                             over the uniaxial strain in the range of stress in which Hooke's law
                             holds. The SI unit for Young's modulus is \f$ Pa \f$ or \f$ N/m^2 \f$. */
-   real_t stiffness_;    //!< The stiffness of the contact region \f$ (0..\infty) \f$.
+   pe_real_t stiffness_;    //!< The stiffness of the contact region \f$ (0..\infty) \f$.
                        /*!< Rigid body theory assumes that the deformation during contact is
                             localized to the contact region. This local compliance can be modelled
                             simplified as a spring-damper. The spring constant corresponds to this
                             parameter. */
-   real_t dampingN_;     //!< The damping at the contact region in normal direction \f$ [0..\infty) \f$.
+   pe_real_t dampingN_;     //!< The damping at the contact region in normal direction \f$ [0..\infty) \f$.
                        /*!< Rigid body theory assumes that the deformation during contact is
                             localized to the contact region. This local compliance in normal
                             direction can be modelled simplified as a spring-damper. The viscous
                             damping coefficient corresponds to this parameter. */
-   real_t dampingT_;     //!< The damping at the contact region in tangential direction \f$ [0..\infty) \f$.
+   pe_real_t dampingT_;     //!< The damping at the contact region in tangential direction \f$ [0..\infty) \f$.
                        /*!< Friction counteracts the tangential relative velocity and thus can be
                             modelled as a viscous damper with a limited damping force. The viscous
                             damping coefficient corresponds to this parameter.*/
@@ -243,12 +243,12 @@ private:
 
    //**Friend declarations*************************************************************************
    /*! \cond internal */
-   friend MaterialID createMaterial( const std::string& name, real_t density, real_t cor,
-                                     real_t csf, real_t cdf, real_t poisson, real_t young,
-                                     real_t stiffness, real_t dampingN, real_t dampingT );
-   friend MaterialID createMaterial( real_t density, real_t cor, real_t csf, real_t cdf,
-                                     real_t poisson, real_t young,
-                                     real_t stiffness, real_t dampingN, real_t dampingT );
+   friend MaterialID createMaterial( const std::string& name, pe_real_t density, pe_real_t cor,
+                                     pe_real_t csf, pe_real_t cdf, pe_real_t poisson, pe_real_t young,
+                                     pe_real_t stiffness, pe_real_t dampingN, pe_real_t dampingT );
+   friend MaterialID createMaterial( pe_real_t density, pe_real_t cor, pe_real_t csf, pe_real_t cdf,
+                                     pe_real_t poisson, pe_real_t young,
+                                     pe_real_t stiffness, pe_real_t dampingN, pe_real_t dampingT );
    /*! \endcond */
    //**********************************************************************************************
 };
@@ -269,9 +269,9 @@ private:
  * \param dampingN The damping coefficient in normal direction of the material's contact region.
  * \param dampingT The damping coefficient in tangential direction of the material's contact region.
  */
-inline Material::Material( const std::string& name, real_t density, real_t cor,
-                           real_t csf, real_t cdf, real_t poisson, real_t young,
-                           real_t stiffness, real_t dampingN, real_t dampingT )
+inline Material::Material( const std::string& name, pe_real_t density, pe_real_t cor,
+                           pe_real_t csf, pe_real_t cdf, pe_real_t poisson, pe_real_t young,
+                           pe_real_t stiffness, pe_real_t dampingN, pe_real_t dampingT )
    : name_       ( name )       // The name of the material
    , density_    ( density )    // The density of the material
    , restitution_( cor )        // The coefficient of restitution of the material
@@ -303,7 +303,7 @@ inline const std::string& Material::getName() const
  *
  * \return The density of the material.
  */
-inline real_t Material::getDensity() const
+inline pe_real_t Material::getDensity() const
 {
    return density_;
 }
@@ -315,7 +315,7 @@ inline real_t Material::getDensity() const
  *
  * \return The coefficient of restitution of the material.
  */
-inline real_t Material::getRestitution() const
+inline pe_real_t Material::getRestitution() const
 {
    return restitution_;
 }
@@ -327,7 +327,7 @@ inline real_t Material::getRestitution() const
  *
  * \return The coefficient of static friction of the material.
  */
-inline real_t Material::getStaticFriction() const
+inline pe_real_t Material::getStaticFriction() const
 {
    return static_;
 }
@@ -339,7 +339,7 @@ inline real_t Material::getStaticFriction() const
  *
  * \return The coefficient of dynamic friction of the material.
  */
-inline real_t Material::getDynamicFriction() const
+inline pe_real_t Material::getDynamicFriction() const
 {
    return dynamic_;
 }
@@ -351,7 +351,7 @@ inline real_t Material::getDynamicFriction() const
  *
  * \return The Poisson's ratio of the material.
  */
-inline real_t Material::getPoissonRatio() const
+inline pe_real_t Material::getPoissonRatio() const
 {
    return poisson_;
 }
@@ -363,7 +363,7 @@ inline real_t Material::getPoissonRatio() const
  *
  * \return The Young's modulus of the material.
  */
-inline real_t Material::getYoungModulus() const
+inline pe_real_t Material::getYoungModulus() const
 {
    return young_;
 }
@@ -375,7 +375,7 @@ inline real_t Material::getYoungModulus() const
  *
  * \return The stiffness in normal direction of the material's contact region.
  */
-inline real_t Material::getStiffness() const
+inline pe_real_t Material::getStiffness() const
 {
    return stiffness_;
 }
@@ -387,7 +387,7 @@ inline real_t Material::getStiffness() const
  *
  * \return The damping coefficient in normal direction of the material's contact region.
  */
-inline real_t Material::getDampingN() const
+inline pe_real_t Material::getDampingN() const
 {
    return dampingN_;
 }
@@ -399,7 +399,7 @@ inline real_t Material::getDampingN() const
  *
  * \return The damping coefficient in tangential direction of the material's contact region.
  */
-inline real_t Material::getDampingT() const
+inline pe_real_t Material::getDampingT() const
 {
    return dampingT_;
 }
@@ -426,7 +426,7 @@ inline const std::string& Material::getName( MaterialID material )
  * \param material The material to be queried.
  * \return The density of the given material.
  */
-inline real_t Material::getDensity( MaterialID material )
+inline pe_real_t Material::getDensity( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getDensity();
@@ -440,7 +440,7 @@ inline real_t Material::getDensity( MaterialID material )
  * \param material The material to be queried.
  * \return The coefficient of restitution of the given material.
  */
-inline real_t Material::getRestitution( MaterialID material )
+inline pe_real_t Material::getRestitution( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getRestitution();
@@ -455,7 +455,7 @@ inline real_t Material::getRestitution( MaterialID material )
  * \param material2 The material of the second colliding rigid body.
  * \return The resulting composite coefficient of restitution of the collision.
  */
-inline real_t Material::getRestitution( MaterialID material1, MaterialID material2 )
+inline pe_real_t Material::getRestitution( MaterialID material1, MaterialID material2 )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -470,7 +470,7 @@ inline real_t Material::getRestitution( MaterialID material1, MaterialID materia
  * \param material The material to be queried.
  * \return The coefficient of static friction of the given material.
  */
-inline real_t Material::getStaticFriction( MaterialID material )
+inline pe_real_t Material::getStaticFriction( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getStaticFriction();
@@ -485,7 +485,7 @@ inline real_t Material::getStaticFriction( MaterialID material )
  * \param material2 The material of the second colliding rigid body.
  * \return The resulting coefficient of static friction of the collision.
  */
-inline real_t Material::getStaticFriction( MaterialID material1, MaterialID material2 )
+inline pe_real_t Material::getStaticFriction( MaterialID material1, MaterialID material2 )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -500,7 +500,7 @@ inline real_t Material::getStaticFriction( MaterialID material1, MaterialID mate
  * \param material The material to be queried.
  * \return The coefficient of dynamic friction of the given material.
  */
-inline real_t Material::getDynamicFriction( MaterialID material )
+inline pe_real_t Material::getDynamicFriction( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getDynamicFriction();
@@ -515,7 +515,7 @@ inline real_t Material::getDynamicFriction( MaterialID material )
  * \param material2 The material of the second colliding rigid body.
  * \return The resulting coefficient of dynamic friction of the collision.
  */
-inline real_t Material::getDynamicFriction( MaterialID material1, MaterialID material2 )
+inline pe_real_t Material::getDynamicFriction( MaterialID material1, MaterialID material2 )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -530,7 +530,7 @@ inline real_t Material::getDynamicFriction( MaterialID material1, MaterialID mat
  * \param material The material to be queried.
  * \return The Poisson's ratio of the given material.
  */
-inline real_t Material::getPoissonRatio( MaterialID material )
+inline pe_real_t Material::getPoissonRatio( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getPoissonRatio();
@@ -544,7 +544,7 @@ inline real_t Material::getPoissonRatio( MaterialID material )
  * \param material The material to be queried.
  * \return The Young's modulus of the given material.
  */
-inline real_t Material::getYoungModulus( MaterialID material )
+inline pe_real_t Material::getYoungModulus( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getYoungModulus();
@@ -567,18 +567,18 @@ inline real_t Material::getYoungModulus( MaterialID material )
  * where \f$ E_1 \f$ and \f$ E_2 \f$ are the Young's modulus for the first and second material,
  * respectively, and \f$ \nu_1 \f$ and \f$ \nu_2 \f$ are the Poisson's ratio for the materials.
  */
-inline real_t Material::getYoungModulus( MaterialID material1, MaterialID material2 )
+inline pe_real_t Material::getYoungModulus( MaterialID material1, MaterialID material2 )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
 
-   const real_t nu1( getPoissonRatio( material1 ) );
-   const real_t nu2( getPoissonRatio( material2 ) );
-   const real_t y1 ( getYoungModulus( material1 ) );
-   const real_t y2 ( getYoungModulus( material2 ) );
+   const pe_real_t nu1( getPoissonRatio( material1 ) );
+   const pe_real_t nu2( getPoissonRatio( material2 ) );
+   const pe_real_t y1 ( getYoungModulus( material1 ) );
+   const pe_real_t y2 ( getYoungModulus( material2 ) );
 
-   const real_t tmp1( y2 * ( real_c(1) - nu1*nu1 ) );
-   const real_t tmp2( y1 * ( real_c(1) - nu2*nu2 ) );
+   const pe_real_t tmp1( y2 * ( real_c(1) - nu1*nu1 ) );
+   const pe_real_t tmp2( y1 * ( real_c(1) - nu2*nu2 ) );
 
    return ( ( y1*y2 ) / ( tmp1 + tmp2 ) );
 }
@@ -591,7 +591,7 @@ inline real_t Material::getYoungModulus( MaterialID material1, MaterialID materi
  * \param material The material to be queried.
  * \return The stiffness in normal direction of the contact region of the given material.
  */
-inline real_t Material::getStiffness( MaterialID material )
+inline pe_real_t Material::getStiffness( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getStiffness();
@@ -611,7 +611,7 @@ inline real_t Material::getStiffness( MaterialID material )
  * are in contact the spring-dampers are serially connected and thus the contact stiffness can
  * be expressed as the series connection of two springs: \f$ k_*^{-1} = k_1^{-1} + k_2^{-1}\f$.
  */
-inline real_t Material::getStiffness( MaterialID material1, MaterialID material2 )
+inline pe_real_t Material::getStiffness( MaterialID material1, MaterialID material2 )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -627,7 +627,7 @@ inline real_t Material::getStiffness( MaterialID material1, MaterialID material2
  * \param material The material to be queried.
  * \return The damping in normal direction of the contact region of the given material.
  */
-inline real_t Material::getDampingN( MaterialID material )
+inline pe_real_t Material::getDampingN( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getDampingN();
@@ -647,7 +647,7 @@ inline real_t Material::getDampingN( MaterialID material )
  * are in contact the spring-dampers are serially connected and thus the contact damping can
  * be expressed as the series connection of two viscous dampers: \f$ c_*^{-1} = c_1^{-1} + c_2^{-1}\f$.
  */
-inline real_t Material::getDampingN( MaterialID material1, MaterialID material2 )
+inline pe_real_t Material::getDampingN( MaterialID material1, MaterialID material2 )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -663,7 +663,7 @@ inline real_t Material::getDampingN( MaterialID material1, MaterialID material2
  * \param material The material to be queried.
  * \return The damping in tangential direction of the contact region of the given material.
  */
-inline real_t Material::getDampingT( MaterialID material )
+inline pe_real_t Material::getDampingT( MaterialID material )
 {
    WALBERLA_ASSERT( material < materials_.size(), "Invalid material ID" );
    return materials_[material].getDampingT();
@@ -683,7 +683,7 @@ inline real_t Material::getDampingT( MaterialID material )
  * are in contact the spring-dampers are serially connected and thus the contact damping can
  * be expressed as the series connection of two viscous dampers: \f$ c_*^{-1} = c_1^{-1} + c_2^{-1}\f$.
  */
-inline real_t Material::getDampingT( MaterialID material1, MaterialID material2 )
+inline pe_real_t Material::getDampingT( MaterialID material1, MaterialID material2 )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -701,7 +701,7 @@ inline real_t Material::getDampingT( MaterialID material1, MaterialID material2
  * \param cor The coefficient of restitution between \a material1 and \a material2.
  * \return void
  */
-inline void Material::setRestitution( MaterialID material1, MaterialID material2, real_t cor )
+inline void Material::setRestitution( MaterialID material1, MaterialID material2, pe_real_t cor )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -718,7 +718,7 @@ inline void Material::setRestitution( MaterialID material1, MaterialID material2
  * \param csf The coefficient of static friction between \a material1 and \a material2.
  * \return void
  */
-inline void Material::setStaticFriction( MaterialID material1, MaterialID material2, real_t csf )
+inline void Material::setStaticFriction( MaterialID material1, MaterialID material2, pe_real_t csf )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -735,7 +735,7 @@ inline void Material::setStaticFriction( MaterialID material1, MaterialID materi
  * \param cdf The coefficient of dynamic friction between \a material1 and \a material2.
  * \return void
  */
-inline void Material::setDynamicFriction( MaterialID material1, MaterialID material2, real_t cdf )
+inline void Material::setDynamicFriction( MaterialID material1, MaterialID material2, pe_real_t cdf )
 {
    WALBERLA_ASSERT( material1 < materials_.size(), "Invalid material ID" );
    WALBERLA_ASSERT( material2 < materials_.size(), "Invalid material ID" );
@@ -1080,10 +1080,10 @@ const MaterialID invalid_material = static_cast<MaterialID>( -1 );
 //*************************************************************************************************
 /*!\name Material functions */
 //@{
-WALBERLA_PUBLIC MaterialID createMaterial( const std::string& name, real_t density, real_t cor,
-                           real_t csf, real_t cdf, real_t poisson, real_t young, real_t stiffness, real_t dampingN, real_t dampingT );
-WALBERLA_PUBLIC MaterialID createMaterial( real_t density, real_t cor, real_t csf, real_t cdf,
-                           real_t poisson, real_t young, real_t stiffness, real_t dampingN, real_t dampingT );
+WALBERLA_PUBLIC MaterialID createMaterial( const std::string& name, pe_real_t density, pe_real_t cor,
+                           pe_real_t csf, pe_real_t cdf, pe_real_t poisson, pe_real_t young, pe_real_t stiffness, pe_real_t dampingN, pe_real_t dampingT );
+WALBERLA_PUBLIC MaterialID createMaterial( pe_real_t density, pe_real_t cor, pe_real_t csf, pe_real_t cdf,
+                           pe_real_t poisson, pe_real_t young, pe_real_t stiffness, pe_real_t dampingN, pe_real_t dampingT );
 //@}
 //*************************************************************************************************
 
diff --git a/src/pe/Thresholds.cpp b/src/pe/Thresholds.cpp
index b8edf23bd25e6d70fa9fb0397a534866540e88f1..82c19896508f2559e742450fb908d4257dcae75e 100644
--- a/src/pe/Thresholds.cpp
+++ b/src/pe/Thresholds.cpp
@@ -34,14 +34,14 @@ namespace pe {
 //*************************************************************************************************
 //! Threshold for the contact classification.
 /*! This threshold separates between separating, resting and colliding contacts. */
-real_t collisionThreshold = Thresholds<real_t>::collisionThreshold();
+pe_real_t collisionThreshold = Thresholds<pe_real_t>::collisionThreshold();
 //*************************************************************************************************
 
 
 //*************************************************************************************************
 //! Threshold for the distance between two rigid bodies.
 /*! Rigid bodies with a distance smaller than this threshold are in contact. */
-real_t contactThreshold = Thresholds<real_t>::contactThreshold();
+pe_real_t contactThreshold = Thresholds<pe_real_t>::contactThreshold();
 //*************************************************************************************************
 
 
@@ -50,14 +50,14 @@ real_t contactThreshold = Thresholds<real_t>::contactThreshold();
 /*! In case the relative velocity between two colliding rigid bodies is smaller than this
     threshold, a coefficient of restitution of 0 is used to avoid an infinite number of
     collisions during a single time step. */
-real_t restitutionThreshold = Thresholds<real_t>::restitutionThreshold();
+pe_real_t restitutionThreshold = Thresholds<pe_real_t>::restitutionThreshold();
 //*************************************************************************************************
 
 
 //*************************************************************************************************
 //! Threshold for the separation between static and dynamic friction.
 /*! This threshold represents the boundary between static and dynamic friction. */
-real_t frictionThreshold = Thresholds<real_t>::frictionThreshold();
+pe_real_t frictionThreshold = Thresholds<pe_real_t>::frictionThreshold();
 //*************************************************************************************************
 
 
@@ -65,7 +65,7 @@ real_t frictionThreshold = Thresholds<real_t>::frictionThreshold();
 //! Threshold for surface points/checks.
 /*! Only points with a distance to the surface smaller than this threshold are considered
     surface point. */
-real_t surfaceThreshold = Thresholds<real_t>::surfaceThreshold();
+pe_real_t surfaceThreshold = Thresholds<pe_real_t>::surfaceThreshold();
 //*************************************************************************************************
 
 } // namespace pe
diff --git a/src/pe/Thresholds.h b/src/pe/Thresholds.h
index bea31db50803601c89c1d7d0043780a2d0decafc..0022ef9ec212c4a1195dcaa3ea7e2d407f91db7a 100644
--- a/src/pe/Thresholds.h
+++ b/src/pe/Thresholds.h
@@ -222,14 +222,14 @@ public:
 //*************************************************************************************************
 //! Threshold for the contact classification.
 /*! This threshold separates between separating, resting and colliding contacts. */
-extern real_t collisionThreshold;
+extern pe_real_t collisionThreshold;
 //*************************************************************************************************
 
 
 //*************************************************************************************************
 //! Threshold for the distance between two rigid bodies.
 /*! Rigid bodies with a distance smaller than this threshold are in contact. */
-extern real_t contactThreshold;
+extern pe_real_t contactThreshold;
 //*************************************************************************************************
 
 
@@ -238,14 +238,14 @@ extern real_t contactThreshold;
 /*! In case the relative velocity between two colliding rigid bodies is smaller than this
     threshold, a coefficient of restitution of 0 is used to avoid an infinite number of
     collisions during a single time step. */
-extern real_t restitutionThreshold;
+extern pe_real_t restitutionThreshold;
 //*************************************************************************************************
 
 
 //*************************************************************************************************
 //! Threshold for the separation between static and dynamic friction.
 /*! This threshold represents the boundary between static and dynamic friction. */
-extern real_t frictionThreshold;
+extern pe_real_t frictionThreshold;
 //*************************************************************************************************
 
 
@@ -253,14 +253,14 @@ extern real_t frictionThreshold;
 //! Threshold for surface points/checks.
 /*! Only points with a distance to the surface smaller than this threshold are considered
     surface point. */
-extern real_t surfaceThreshold;
+extern pe_real_t surfaceThreshold;
 //*************************************************************************************************
 
 
 //*************************************************************************************************
 //! Threshold for parallelism checks.
 /*! Scalar products smaller than this threshold value indicate parallel vectors. */
-//const real_t parallelThreshold = Thresholds<real_t>::parallelThreshold();
+//const pe_real_t parallelThreshold = Thresholds<pe_real_t>::parallelThreshold();
 //*************************************************************************************************
 
 } // namespace pe
diff --git a/src/pe/Types.h b/src/pe/Types.h
index d37661d54fb2d76466a4ae9b3f4cc8fe608456c2..3c389732c6346e830a8d173e2218cb0c99116bda 100644
--- a/src/pe/Types.h
+++ b/src/pe/Types.h
@@ -42,14 +42,14 @@ template<typename T> class MatrixMxN;
 }
 namespace pe{
 
-typedef math::Vector2<real_t> Vec2;
-typedef math::Vector3<real_t> Vec3;
-typedef math::Matrix2<real_t> Mat2;
-typedef math::Matrix3<real_t> Mat3;
-typedef math::Quaternion<real_t>  Quat;
-typedef math::MatrixMxN<real_t> MatN;
-
-using math::AABB;
+typedef math::Vector2<pe_real_t> Vec2;
+typedef math::Vector3<pe_real_t> Vec3;
+typedef math::Matrix2<pe_real_t> Mat2;
+typedef math::Matrix3<pe_real_t> Mat3;
+typedef math::Quaternion<pe_real_t>  Quat;
+typedef math::MatrixMxN<pe_real_t> MatN;
+
+typedef math::GenericAABB<pe_real_t> AABB;
 
 //=================================================================================================
 //
diff --git a/src/pe/ccd/HashGrids.cpp b/src/pe/ccd/HashGrids.cpp
index e126e554d56db11e2325c9d5ea8e7860c55ce2c4..89b2e39c1a82865ee3762ac9afebfb8c0a3d644e 100644
--- a/src/pe/ccd/HashGrids.cpp
+++ b/src/pe/ccd/HashGrids.cpp
@@ -43,7 +43,7 @@ namespace ccd {
 //*************************************************************************************************
 /*!\brief Constructor for the HashGrid class.
  */
-HashGrids::HashGrid::HashGrid( real_t cellSpan )
+HashGrids::HashGrid::HashGrid( pe_real_t cellSpan )
 {
    // Initialization of all member variables and ...
    xCellCount_   = powerOfTwo( xCellCount ) ? xCellCount : 16;
@@ -326,38 +326,38 @@ void HashGrids::HashGrid::initializeNeighborOffsets()
  */
 size_t HashGrids::HashGrid::hash( BodyID body ) const
 {
-   real_t x = body->getAABB().xMin();
-   real_t y = body->getAABB().yMin();
-   real_t z = body->getAABB().zMin();
+   pe_real_t x = body->getAABB().xMin();
+   pe_real_t y = body->getAABB().yMin();
+   pe_real_t z = body->getAABB().zMin();
 
    size_t xHash;
    size_t yHash;
    size_t zHash;
 
    if( x < 0 ) {
-      real_t i = ( -x ) * inverseCellSpan_;
+      pe_real_t i = ( -x ) * inverseCellSpan_;
       xHash  = xCellCount_ - 1 - ( static_cast<size_t>( i ) & xHashMask_ );
    }
    else {
-      real_t i = x * inverseCellSpan_;
+      pe_real_t i = x * inverseCellSpan_;
       xHash  = static_cast<size_t>( i ) & xHashMask_;
    }
 
    if( y < 0 ) {
-      real_t i = ( -y ) * inverseCellSpan_;
+      pe_real_t i = ( -y ) * inverseCellSpan_;
       yHash  = yCellCount_ - 1 - ( static_cast<size_t>( i ) & yHashMask_ );
    }
    else {
-      real_t i = y * inverseCellSpan_;
+      pe_real_t i = y * inverseCellSpan_;
       yHash  = static_cast<size_t>( i ) & yHashMask_;
    }
 
    if( z < 0 ) {
-      real_t i = ( -z ) * inverseCellSpan_;
+      pe_real_t i = ( -z ) * inverseCellSpan_;
       zHash  = zCellCount_ - 1 - ( static_cast<size_t>( i ) & zHashMask_ );
    }
    else {
-      real_t i = z * inverseCellSpan_;
+      pe_real_t i = z * inverseCellSpan_;
       zHash  = static_cast<size_t>( i ) & zHashMask_;
    }
 
@@ -825,8 +825,8 @@ PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt )
       //
       //       if( grid != NULL ) {
       //
-      //          real_t size     = body->getAABBSize();
-      //          real_t cellSpan = grid->getCellSpan();
+      //          pe_real_t size     = body->getAABBSize();
+      //          pe_real_t cellSpan = grid->getCellSpan();
       //
       //          if( size >= cellSpan || size < ( cellSpan / hierarchyFactor ) ) {
       //             addGrid( body );
@@ -847,8 +847,8 @@ PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt )
       //
       //       if( grid != NULL ) {
       //
-      //          real_t size     = body->getAABBSize();
-      //          real_t cellSpan = grid->getCellSpan();
+      //          pe_real_t size     = body->getAABBSize();
+      //          pe_real_t cellSpan = grid->getCellSpan();
       //
       //          if( size >= cellSpan || size < ( cellSpan / hierarchyFactor ) ) {
       //             addGrid( body );
@@ -883,8 +883,8 @@ PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt )
 
             if( grid != NULL )
             {
-               real_t size     = body->getAABBSize();
-               real_t cellSpan = grid->getCellSpan();
+               pe_real_t size     = body->getAABBSize();
+               pe_real_t cellSpan = grid->getCellSpan();
 
                if( size >= cellSpan || size < ( cellSpan / hierarchyFactor ) ) {
                   grid->remove( body );
@@ -906,8 +906,8 @@ PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt )
 
             if( grid != NULL )
             {
-               real_t size     = body->getAABBSize();
-               real_t cellSpan = grid->getCellSpan();
+               pe_real_t size     = body->getAABBSize();
+               pe_real_t cellSpan = grid->getCellSpan();
 
                if( size >= cellSpan || size < ( cellSpan / hierarchyFactor ) ) {
                   grid->remove( body );
@@ -1007,7 +1007,7 @@ PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt )
  */
 void HashGrids::addGrid( BodyID body )
 {
-   real_t size = ( body->isFinite() ) ? body->getAABBSize() : real_c( -1 );
+   pe_real_t size = ( body->isFinite() ) ? body->getAABBSize() : real_c( -1 );
 
    // If the body is finite in size, it must be assigned to a grid with suitably sized cells.
    if( size > 0 )
@@ -1026,7 +1026,7 @@ void HashGrids::addGrid( BodyID body )
          // Check the hierarchy for a hash grid with suitably sized cells - if such a grid does not
          // yet exist, it will be created.
 
-         real_t cellSpan = 0;
+         pe_real_t cellSpan = 0;
          for( auto gIt = gridList_.begin(); gIt != gridList_.end(); ++gIt )
          {
             grid     = *gIt;
@@ -1313,7 +1313,7 @@ const size_t HashGrids::gridActivationThreshold = 32;
  *
  * Possible settings: any floating point value that is greater than 1.0.
  */
-const real_t HashGrids::hierarchyFactor = real_c(2);
+const pe_real_t HashGrids::hierarchyFactor = real_c(2);
 //*************************************************************************************************
 
 }  // namespace ccd
diff --git a/src/pe/ccd/HashGrids.h b/src/pe/ccd/HashGrids.h
index 060be9447c6cf4e5163da18f503dcdf446cf7c73..93c79892ca0476e96242d8672de1a302f7233f3a 100644
--- a/src/pe/ccd/HashGrids.h
+++ b/src/pe/ccd/HashGrids.h
@@ -91,7 +91,7 @@ public:
    static const size_t occupiedCellsVectorSize;
    static const size_t minimalGridDensity;
    static const size_t gridActivationThreshold;
-   static const real_t hierarchyFactor;
+   static const pe_real_t hierarchyFactor;
    //**********************************************************************************************
 
 private:
@@ -140,7 +140,7 @@ private:
       //**Constructor******************************************************************************
       /*!\name Constructor */
       //@{
-      explicit HashGrid( real_t cellSpan );
+      explicit HashGrid( pe_real_t cellSpan );
       //@}
       //*******************************************************************************************
 
@@ -154,7 +154,7 @@ private:
       //**Getter functions*************************************************************************
       /*!\name Getter functions */
       //@{
-      real_t getCellSpan() const { return cellSpan_; }  //!< Getter for \a cellSpan_.
+      pe_real_t getCellSpan() const { return cellSpan_; }  //!< Getter for \a cellSpan_.
       //@}
       //*******************************************************************************************
 
@@ -217,8 +217,8 @@ private:
                                                  of assigned bodies exceeds this threshold, the
                                                  size of this hash grid is increased. */
 
-      real_t cellSpan_;         //!< The grid's cell size (edge length of the underlying cubic grid cells).
-      real_t inverseCellSpan_;  //!< The inverse cell size.
+      pe_real_t cellSpan_;         //!< The grid's cell size (edge length of the underlying cubic grid cells).
+      pe_real_t inverseCellSpan_;  //!< The inverse cell size.
                               /*!< Required for replacing floating point divisions with multiplications
                                    during the hash computation. */
 
diff --git a/src/pe/collision/GJKEPAHelper.cpp b/src/pe/collision/GJKEPAHelper.cpp
index d119ed751c55885eb09881aa5a3f67270dd2364b..15a2c36f19651f563617b46561adfe12a6e4c134 100644
--- a/src/pe/collision/GJKEPAHelper.cpp
+++ b/src/pe/collision/GJKEPAHelper.cpp
@@ -51,9 +51,9 @@ bool collideGJK( ConstGeomID bd1,
                  ConstGeomID bd2,
                  Vec3& contactPoint,
                  Vec3& contactNormal,
-                 real_t& penetrationDepth,
+                 pe_real_t& penetrationDepth,
                  const unsigned long numIterations,
-                 const real_t epaTol )
+                 const pe_real_t epaTol )
 {
     ccd_t ccd;
     CCD_INIT(&ccd); // initialize ccd_t struct
diff --git a/src/pe/collision/GJKEPAHelper.h b/src/pe/collision/GJKEPAHelper.h
index b1d73b1a19584a53449034529163c9247a5f230c..56451225597920a7f0b50b7f91f4f49139f8719c 100644
--- a/src/pe/collision/GJKEPAHelper.h
+++ b/src/pe/collision/GJKEPAHelper.h
@@ -33,7 +33,7 @@ namespace walberla {
 namespace pe {
 
 static unsigned long maxGJKIterations = 100ul;
-static real_t epaTolerance = real_t(0.000001);
+static pe_real_t epaTolerance = pe_real_t(0.000001);
 
 inline
 void setMaxGJKIterations(const unsigned long& iter)
@@ -47,12 +47,12 @@ unsigned long getMaxGJKIterations()
 }
 
 inline
-void setEPATolerance(const real_t& tol)
+void setEPATolerance(const pe_real_t& tol)
 {
    epaTolerance = tol;
 }
 inline
-real_t getEPATolerance()
+pe_real_t getEPATolerance()
 {
    return epaTolerance;
 }
@@ -61,18 +61,18 @@ bool collideGJK( ConstGeomID bd1,
                  ConstGeomID bd2,
                  Vec3& contactPoint,
                  Vec3& contactNormal,
-                 real_t& penetrationDepth,
+                 pe_real_t& penetrationDepth,
                  const unsigned long numIterations = maxGJKIterations,
-                 const real_t epaTol = epaTolerance );
+                 const pe_real_t epaTol = epaTolerance );
 
 template <typename Container>
 bool collideGJK( GeomID bd1,
                  GeomID bd2,
                  Container& container,
                  const unsigned long numIterations = maxGJKIterations,
-                 const real_t epaTol = epaTolerance )
+                 const pe_real_t epaTol = epaTolerance )
 {
-   real_t penetrationDepth;
+   pe_real_t penetrationDepth;
    Vec3   contactPoint;
    Vec3   contactNormal;
    bool retVal = collideGJK(bd1, bd2, contactPoint, contactNormal, penetrationDepth, numIterations, epaTol);
diff --git a/src/pe/communication/DynamicMarshalling.h b/src/pe/communication/DynamicMarshalling.h
index 73f222c15c55051d33474390cc6df2512193f2f6..cd878fa15194821694bd72a356a2f5a1250e4337 100644
--- a/src/pe/communication/DynamicMarshalling.h
+++ b/src/pe/communication/DynamicMarshalling.h
@@ -81,10 +81,10 @@ private:
    struct UnmarshalFunctor
    {
       mpi::RecvBuffer& buffer_;
-      const math::AABB& domain_;
-      const math::AABB& block_;
+      const AABB& domain_;
+      const AABB& block_;
 
-      UnmarshalFunctor(mpi::RecvBuffer& buffer, const math::AABB& domain, const math::AABB& block)
+      UnmarshalFunctor(mpi::RecvBuffer& buffer, const AABB& domain, const AABB& block)
          : buffer_(buffer)
          , domain_(domain)
          , block_(block) {}
@@ -104,7 +104,7 @@ public:
     * The rigid body is casted dynamically to its original type and then marshalled. For recognition
     * an identifying tag is prepended.
     */
-   static BodyID execute(mpi::RecvBuffer& buffer, const id_t typeID, const math::AABB& domain, const math::AABB& block)
+   static BodyID execute(mpi::RecvBuffer& buffer, const id_t typeID, const AABB& domain, const AABB& block)
    {
       UnmarshalFunctor func(buffer, domain, block);
       return SingleCast<BodyTypeTuple, UnmarshalFunctor, BodyID>::execute (typeID, func);
diff --git a/src/pe/communication/Instantiate.h b/src/pe/communication/Instantiate.h
index 6096c6552d3e21e63ec29a99efbefcfc0cfb20c3..10b5f5a0c5a96bca905fb3b7a554d34eed90466f 100644
--- a/src/pe/communication/Instantiate.h
+++ b/src/pe/communication/Instantiate.h
@@ -38,7 +38,7 @@ namespace pe {
 namespace communication {
 
 inline
-void correctBodyPosition(const math::AABB& domain, const Vec3& center, Vec3& pos)
+void correctBodyPosition(const AABB& domain, const Vec3& center, Vec3& pos)
 {
    Vec3 dis = pos - center;
 
@@ -55,7 +55,7 @@ void correctBodyPosition(const math::AABB& domain, const Vec3& center, Vec3& pos
 }
 
 template < class BodyT >
-BodyT* instantiate( mpi::RecvBuffer& /*buffer*/, const math::AABB& /*domain*/, const math::AABB& /*block*/, BodyT*& /*newBody*/ )
+BodyT* instantiate( mpi::RecvBuffer& /*buffer*/, const AABB& /*domain*/, const AABB& /*block*/, BodyT*& /*newBody*/ )
 {
    WALBERLA_ABORT( "Body instantiation not implemented! (" << demangle(typeid(BodyT).name()) << ")" );
 }
diff --git a/src/pe/communication/rigidbody/Box.h b/src/pe/communication/rigidbody/Box.h
index 3a4c35a20e31b259cddd3fc0cfea4bf1d87d95d8..18b7b54ac22bbed97c9ee7622293b07471160d46 100644
--- a/src/pe/communication/rigidbody/Box.h
+++ b/src/pe/communication/rigidbody/Box.h
@@ -59,7 +59,7 @@ void marshal( mpi::SendBuffer& buffer, const Box& obj );
  */
 void unmarshal( mpi::RecvBuffer& buffer, BoxParameters& objparam );
 //*************************************************************************************************
-inline BoxID instantiate( mpi::RecvBuffer& buffer, const math::AABB& domain, const math::AABB& block, BoxID& newBody )
+inline BoxID instantiate( mpi::RecvBuffer& buffer, const AABB& domain, const AABB& block, BoxID& newBody )
 {
    BoxParameters subobjparam;
    unmarshal( buffer, subobjparam );
diff --git a/src/pe/communication/rigidbody/Capsule.h b/src/pe/communication/rigidbody/Capsule.h
index 7f99b1d1d47d7fb4e96713213f3ecababd718915..f386edfc5b1cd7192565e832452728d5cf833d00 100644
--- a/src/pe/communication/rigidbody/Capsule.h
+++ b/src/pe/communication/rigidbody/Capsule.h
@@ -36,7 +36,7 @@ namespace pe {
 namespace communication {
 
 struct CapsuleParameters : public GeomPrimitiveParameters {
-   real_t radius_, length_;
+   pe_real_t radius_, length_;
 };
 
 //*************************************************************************************************
@@ -61,7 +61,7 @@ void unmarshal( mpi::RecvBuffer& buffer, CapsuleParameters& objparam );
 //*************************************************************************************************
 
 
-inline CapsuleID instantiate( mpi::RecvBuffer& buffer, const math::AABB& domain, const math::AABB& block, CapsuleID& newBody )
+inline CapsuleID instantiate( mpi::RecvBuffer& buffer, const AABB& domain, const AABB& block, CapsuleID& newBody )
 {
    CapsuleParameters subobjparam;
    unmarshal( buffer, subobjparam );
diff --git a/src/pe/communication/rigidbody/Sphere.h b/src/pe/communication/rigidbody/Sphere.h
index 55881f65aa0e3c5e02cd0ea099093dd16ef45379..0792594fcf5ddacad96e94f78e5b993d970b78ed 100644
--- a/src/pe/communication/rigidbody/Sphere.h
+++ b/src/pe/communication/rigidbody/Sphere.h
@@ -36,7 +36,7 @@ namespace pe {
 namespace communication {
 
 struct SphereParameters : public GeomPrimitiveParameters {
-   real_t radius_;
+   pe_real_t radius_;
 };
 
 //*************************************************************************************************
@@ -61,7 +61,7 @@ void unmarshal( mpi::RecvBuffer& buffer, SphereParameters& objparam );
 //*************************************************************************************************
 
 
-inline SphereID instantiate( mpi::RecvBuffer& buffer, const math::AABB& domain, const math::AABB& block, SphereID& newBody )
+inline SphereID instantiate( mpi::RecvBuffer& buffer, const AABB& domain, const AABB& block, SphereID& newBody )
 {
    SphereParameters subobjparam;
    unmarshal( buffer, subobjparam );
diff --git a/src/pe/communication/rigidbody/Squirmer.h b/src/pe/communication/rigidbody/Squirmer.h
index 9029c93586fa36c5d3b4e29d2aaefe74a4d5a4d1..afd609ae7462b7a1c65f668ac96875b886d23aa6 100644
--- a/src/pe/communication/rigidbody/Squirmer.h
+++ b/src/pe/communication/rigidbody/Squirmer.h
@@ -36,8 +36,8 @@ namespace pe {
 namespace communication {
 
 struct SquirmerParameters : public SphereParameters {
-   real_t squirmerVelocity_;
-   real_t squirmerBeta_;
+   pe_real_t squirmerVelocity_;
+   pe_real_t squirmerBeta_;
 };
 
 //*************************************************************************************************
@@ -61,7 +61,7 @@ void unmarshal( mpi::RecvBuffer& buffer, SquirmerParameters& objparam );
 //*************************************************************************************************
 
 
-inline SquirmerID instantiate( mpi::RecvBuffer& buffer, const math::AABB& domain, const math::AABB& block, SquirmerID& newBody )
+inline SquirmerID instantiate( mpi::RecvBuffer& buffer, const AABB& domain, const AABB& block, SquirmerID& newBody )
 {
    SquirmerParameters subobjparam;
    unmarshal( buffer, subobjparam );
diff --git a/src/pe/communication/rigidbody/Union.h b/src/pe/communication/rigidbody/Union.h
index 69c2d6bb172ac8589b56f68e7ecc2946ac0b471f..aabd6d64782257ba1a9c8f5e8871de39b15a4d40 100644
--- a/src/pe/communication/rigidbody/Union.h
+++ b/src/pe/communication/rigidbody/Union.h
@@ -44,9 +44,9 @@ template < typename BodyTypeTuple >
 class UnmarshalDynamically;
 
 struct UnionParameters : public GeomPrimitiveParameters {
-   real_t         m_;
+   pe_real_t         m_;
    Mat3           I_;
-   math::AABB     aabb_;
+   AABB     aabb_;
    size_t         size_;
 };
 
@@ -110,7 +110,7 @@ void unmarshal( mpi::RecvBuffer& buffer, UnionParameters& objparam )
 
 
 template <typename BodyTypeTuple>
-inline Union<BodyTypeTuple>* instantiate( mpi::RecvBuffer& buffer, const math::AABB& domain, const math::AABB& block, Union<BodyTypeTuple>*& newBody )
+inline Union<BodyTypeTuple>* instantiate( mpi::RecvBuffer& buffer, const AABB& domain, const AABB& block, Union<BodyTypeTuple>*& newBody )
 {
    UnionParameters subobjparam;
    unmarshal( buffer, subobjparam );
diff --git a/src/pe/contact/Contact.cpp b/src/pe/contact/Contact.cpp
index ed9e68e28cc7bff136a697d4b1716f3421f92a23..9ed2cbfddddad3fd27568a1952ea319fff8ce652 100644
--- a/src/pe/contact/Contact.cpp
+++ b/src/pe/contact/Contact.cpp
@@ -50,7 +50,7 @@ namespace pe {
  * \param normal The global normal of the contact (running from body 2 to body 1).
  * \param dist The distance between the surfaces of the contacting rigid bodies.
  */
-Contact::Contact( GeomID g1, GeomID g2, const Vec3& gpos, const Vec3& normal, real_t dist )
+Contact::Contact( GeomID g1, GeomID g2, const Vec3& gpos, const Vec3& normal, pe_real_t dist )
    : b1_( g1 )  // The first contacting rigid body
    , b2_( g2 )  // The second contacting rigid body
    , gpos_(gpos)                   // Global position
@@ -100,7 +100,7 @@ Contact::~Contact()
  *
  * \return The relative acceleration in normal direction.
  */
-//real_t Contact::getNormalRelAcc() const
+//pe_real_t Contact::getNormalRelAcc() const
 //{
 //   return normal_ * ( b1_->accFromWF( gpos_ ) - b2_->accFromWF( gpos_ ) ) +
 //          real_c(2) *  getNDot()  * ( b1_->velFromWF( gpos_ ) - b2_->velFromWF( gpos_ ) );
diff --git a/src/pe/contact/Contact.h b/src/pe/contact/Contact.h
index 51adfc7c3ed7f46c9f2983b33abad630936bcb20..1d1b94d09f0b58a95eb2fc5aa285c1f38c2dc296 100644
--- a/src/pe/contact/Contact.h
+++ b/src/pe/contact/Contact.h
@@ -88,7 +88,7 @@ public:
    //**Constructors********************************************************************************
    /*!\name Constructors */
    //@{
-   Contact( GeomID g1, GeomID g2, const Vec3& gpos, const Vec3& normal, real_t dist );
+   Contact( GeomID g1, GeomID g2, const Vec3& gpos, const Vec3& normal, pe_real_t dist );
    //@}
    //**********************************************************************************************
 
@@ -113,14 +113,14 @@ public:
    inline const Vec3&    getPosition()       const;
    inline const Vec3&    getNormal()         const;
 //   inline const Vec3     getNDot()           const;
-   inline real_t         getDistance()       const;
+   inline pe_real_t         getDistance()       const;
 
    inline ContactType    getType()           const;
 
-   inline real_t         getNormalRelVel()   const;
+   inline pe_real_t         getNormalRelVel()   const;
    inline const Vec3     getRelVel()         const;
-//          real_t         getNormalRelAcc()   const;
-          real_t         getNormalRelForce() const;
+//          pe_real_t         getNormalRelAcc()   const;
+          pe_real_t         getNormalRelForce() const;
    //@}
    //**********************************************************************************************
 
@@ -138,7 +138,7 @@ protected:
                             from body 2 to body 1. */
    Vec3 e1_;           //!< Edge direction of the colliding edge of body 1.
    Vec3 e2_;           //!< Edge direction of the colliding edge of body 2.
-   real_t dist_;         //!< Distance between the surfaces of the contacting rigid bodies.
+   pe_real_t dist_;         //!< Distance between the surfaces of the contacting rigid bodies.
                        /*!< A negative distance means penetration of the two bodies. */
    //@}
    //**********************************************************************************************
@@ -267,7 +267,7 @@ inline const Vec3& Contact::getNormal() const
  *
  * \return Distance between the surfaces of the contacting rigid bodies.
  */
-inline real_t Contact::getDistance() const
+inline pe_real_t Contact::getDistance() const
 {
    return dist_;
 }
@@ -291,7 +291,7 @@ inline real_t Contact::getDistance() const
  */
 inline Contact::ContactType Contact::getType() const
 {
-   real_t vrel = normal_ * ( b1_->velFromWF( gpos_ ) - b2_->velFromWF( gpos_ ) );
+   pe_real_t vrel = normal_ * ( b1_->velFromWF( gpos_ ) - b2_->velFromWF( gpos_ ) );
 
    if( vrel > collisionThreshold ) return Contact::separating;
    else if( vrel > -collisionThreshold ) return Contact::resting;
@@ -305,7 +305,7 @@ inline Contact::ContactType Contact::getType() const
  *
  * \return The relative velocity in normal direction.
  */
-inline real_t Contact::getNormalRelVel() const
+inline pe_real_t Contact::getNormalRelVel() const
 {
    return normal_ * ( b1_->velFromWF( gpos_ ) - b2_->velFromWF( gpos_ ) );
 }
diff --git a/src/pe/contact/ContactFunctions.h b/src/pe/contact/ContactFunctions.h
index 141ee743556edfb836c10755a77735ca04b46471..033688ef48bf1f556fd2510dfd8cd70b6161ec18 100644
--- a/src/pe/contact/ContactFunctions.h
+++ b/src/pe/contact/ContactFunctions.h
@@ -29,13 +29,13 @@
 namespace walberla {
 namespace pe {
 
-inline bool shouldContactBeTreated( ContactID c, const math::AABB& blkAABB );
-inline real_t         getRestitution( ConstContactID c );
-inline real_t         getStiffness(ConstContactID c);
-inline real_t         getDampingN(ConstContactID c);
-inline real_t         getDampingT(ConstContactID c);
-//   inline real_t         getCorParam(ConstContactID c);
-inline real_t         getFriction(ConstContactID c);
+inline bool shouldContactBeTreated( ContactID c, const AABB& blkAABB );
+inline pe_real_t         getRestitution( ConstContactID c );
+inline pe_real_t         getStiffness(ConstContactID c);
+inline pe_real_t         getDampingN(ConstContactID c);
+inline pe_real_t         getDampingT(ConstContactID c);
+//   inline pe_real_t         getCorParam(ConstContactID c);
+inline pe_real_t         getFriction(ConstContactID c);
 
 } // namespace pe
 } // namespace walberla
diff --git a/src/pe/contact/ContactFunctions.impl.h b/src/pe/contact/ContactFunctions.impl.h
index f48b0328124c735e4c003f50e7cec475449c6edf..67423927601e0a59f8dcfdffe971b0080703e8c9 100644
--- a/src/pe/contact/ContactFunctions.impl.h
+++ b/src/pe/contact/ContactFunctions.impl.h
@@ -27,7 +27,7 @@ namespace walberla {
 namespace pe {
 
 inline
-bool shouldContactBeTreated( ContactID c, const math::AABB& blkAABB )
+bool shouldContactBeTreated( ContactID c, const AABB& blkAABB )
 {
    const int myRank( mpi::MPIManager::instance()->rank() );
 
@@ -114,28 +114,28 @@ bool shouldContactBeTreated( ContactID c, const math::AABB& blkAABB )
 // In case the normal relative velocity between the two colliding rigid bodies is smaller than the
 // restitution threshold, a coefficient of restitution of 0 is used to prevent an infinite number
 // of collisions during a single time step.
-inline real_t         getRestitution(ConstContactID c)
+inline pe_real_t         getRestitution(ConstContactID c)
 {
    // Calculating the relative velocity
    const Vec3 rvel( c->getBody1()->velFromWF( c->getPosition() ) - c->getBody2()->velFromWF( c->getPosition() ) );  // Relative velocity
-   const real_t nvel( c->getNormal() * rvel );                              // Normal relative velocity
+   const pe_real_t nvel( c->getNormal() * rvel );                              // Normal relative velocity
    if( std::fabs( nvel ) > restitutionThreshold )
    {
       return Material::getRestitution( c->getBody1()->getMaterial(), c->getBody1()->getMaterial() );
    }
-   return real_t(0.0);
+   return pe_real_t(0.0);
 }
 
 // Calculate the stiffness and damping parameters
-inline real_t         getStiffness(ConstContactID c)
+inline pe_real_t         getStiffness(ConstContactID c)
 {
    return Material::getStiffness( c->getBody1()->getMaterial(), c->getBody2()->getMaterial() );
 }
-inline real_t         getDampingN(ConstContactID c)
+inline pe_real_t         getDampingN(ConstContactID c)
 {
    return Material::getDampingN ( c->getBody1()->getMaterial(), c->getBody2()->getMaterial() );
 }
-inline real_t         getDampingT(ConstContactID c)
+inline pe_real_t         getDampingT(ConstContactID c)
 {
    return Material::getDampingT ( c->getBody1()->getMaterial(), c->getBody2()->getMaterial() );
 }
@@ -144,12 +144,12 @@ inline real_t         getDampingT(ConstContactID c)
 // In case the tangential relative velocity between the two colliding rigid bodies is smaller than
 // the friction threshold, the coefficient of static friction is used. Otherwise, the coefficient
 // of dynamic friction is used.
-inline real_t         getFriction(ConstContactID c)
+inline pe_real_t         getFriction(ConstContactID c)
 {
    // Calculating the relative velocity
    const Vec3 rvel( c->getBody1()->velFromWF( c->getPosition() ) - c->getBody2()->velFromWF( c->getPosition() ) );  // Relative velocity
-   const real_t nvel( c->getNormal() * rvel );                              // Normal relative velocity
-   const real_t tvel( c->getNormal() * ( rvel - c->getNormal() * nvel ) );         // Tangential relative velocity
+   const pe_real_t nvel( c->getNormal() * rvel );                              // Normal relative velocity
+   const pe_real_t tvel( c->getNormal() * ( rvel - c->getNormal() * nvel ) );         // Tangential relative velocity
 
    if( std::fabs( tvel ) > frictionThreshold )
       return Material::getDynamicFriction( c->getBody1()->getMaterial(), c->getBody2()->getMaterial() );
diff --git a/src/pe/cr/ContactResolvers.h b/src/pe/cr/ContactResolvers.h
index d90b6783559c68628ca8f0d91f8b5288a7129d56..149f8b6ccef327fe3042ac98c7ccbd5f3da69c3f 100644
--- a/src/pe/cr/ContactResolvers.h
+++ b/src/pe/cr/ContactResolvers.h
@@ -21,16 +21,16 @@ public:
       const Vec3 gpos( c->getPosition() );
 
       // The absolute value of the penetration length
-      real_t delta( -c->getDistance() );
+      pe_real_t delta( -c->getDistance() );
 
       // Calculating the relative velocity in normal and tangential direction
       // The negative signs result from the different definition of the relative
       // normal velocity of the pe (see Contact::getType)
-      const real_t relVelN( -c->getNormalRelVel() );
+      const pe_real_t relVelN( -c->getNormalRelVel() );
       const Vec3   relVel ( -c->getRelVel() );
       const Vec3   relVelT( relVel - ( relVelN * c->getNormal() ) );
 
-      real_t fNabs( 0 );
+      pe_real_t fNabs( 0 );
       Vec3   fN;
 
       // Calculating the normal force based on a linear spring-dashpot force model
@@ -39,7 +39,7 @@ public:
       fN = fNabs * c->getNormal();
 
       // Calculating the tangential force based on the model by Haff and Werner
-      const real_t fTabs( std::min( getDampingT(c) * relVelT.length(), getFriction(c) * fNabs ) );
+      const pe_real_t fTabs( std::min( getDampingT(c) * relVelT.length(), getFriction(c) * fNabs ) );
       const Vec3   fT   ( fTabs * relVelT.getNormalizedOrZero() );
 
       // Add normal force at contact point
diff --git a/src/pe/cr/DEM.h b/src/pe/cr/DEM.h
index f5269b06fa53a1fae90b286532429f0720507c5e..249a0e949ab2f37339daf64ac2359326eaf28241 100644
--- a/src/pe/cr/DEM.h
+++ b/src/pe/cr/DEM.h
@@ -55,11 +55,11 @@ public:
 
    /// forwards to timestep
    /// Convenience operator to make class a functor.
-   void operator()(const real_t dt) { timestep(dt); }
+   void operator()(const pe_real_t dt) { timestep(dt); }
    /// Advances the simulation dt seconds.
-   void timestep( const real_t dt );
+   void timestep( const pe_real_t dt );
 
-   virtual inline real_t            getMaximumPenetration()        const WALBERLA_OVERRIDE { return maxPenetration_; }
+   virtual inline pe_real_t            getMaximumPenetration()        const WALBERLA_OVERRIDE { return maxPenetration_; }
    virtual inline size_t            getNumberOfContacts()          const WALBERLA_OVERRIDE { return numberOfContacts_; }
    virtual inline size_t            getNumberOfContactsTreated()   const WALBERLA_OVERRIDE { return numberOfContactsTreated_; }
 private:
@@ -72,7 +72,7 @@ private:
    domain_decomposition::BlockDataID fcdID_;
    WcTimingTree*                     tt_;
 
-   real_t                            maxPenetration_;
+   pe_real_t                            maxPenetration_;
    size_t                            numberOfContacts_;
    size_t                            numberOfContactsTreated_;
 };
diff --git a/src/pe/cr/DEM.impl.h b/src/pe/cr/DEM.impl.h
index 3a910f72cacde157d4d50cbbba716b43e32f5aed..3da7fd0833ab817951b39953e9df8116bfcd913b 100644
--- a/src/pe/cr/DEM.impl.h
+++ b/src/pe/cr/DEM.impl.h
@@ -65,7 +65,7 @@ DEMSolver<Integrator,ContactResolver>::DEMSolver(
 }
 
 template< typename Integrator, typename ContactResolver >
-void DEMSolver<Integrator,ContactResolver>::timestep( real_t dt )
+void DEMSolver<Integrator,ContactResolver>::timestep( pe_real_t dt )
 {
    maxPenetration_          = real_c(0.0);
    numberOfContacts_        = 0;
@@ -82,7 +82,7 @@ void DEMSolver<Integrator,ContactResolver>::timestep( real_t dt )
       if (tt_ != NULL) tt_->stop("FCD");
 
       for (auto cIt = cont.begin(); cIt != cont.end(); ++cIt){
-         const real_t overlap( -cIt->getDistance() );
+         const pe_real_t overlap( -cIt->getDistance() );
          if( overlap > maxPenetration_ )
             maxPenetration_ = overlap;
          if (shouldContactBeTreated( &(*cIt), currentBlock.getAABB() ))
diff --git a/src/pe/cr/HCSITS.h b/src/pe/cr/HCSITS.h
index d5fc5075f72016fac8f9131fd702b9d0bf7cdc1a..7d9a419d5e76c8dcd30a67cd23a455b707a44c75 100644
--- a/src/pe/cr/HCSITS.h
+++ b/src/pe/cr/HCSITS.h
@@ -87,12 +87,12 @@ private:
       std::vector<Vec3>   r1_, r2_;
       std::vector<BodyID> body1_, body2_;
       std::vector<Vec3>   n_, t_, o_;
-      std::vector<real_t> dist_;
-      std::vector<real_t> mu_;
+      std::vector<pe_real_t> dist_;
+      std::vector<pe_real_t> mu_;
       std::vector<Mat3>   diag_nto_;
       std::vector<Mat3>   diag_nto_inv_;
       std::vector<Mat2>   diag_to_inv_;
-      std::vector<real_t> diag_n_inv_;
+      std::vector<pe_real_t> diag_n_inv_;
       std::vector<Vec3>   p_;
    };
    std::map<IBlockID::IDType, ContactCache> blockToContactCache_;
@@ -130,14 +130,14 @@ public:
    //**Get functions*******************************************************************************
    /*!\name Get functions */
    //@{
-   virtual inline real_t            getMaximumPenetration()        const WALBERLA_OVERRIDE;
+   virtual inline pe_real_t            getMaximumPenetration()        const WALBERLA_OVERRIDE;
    virtual inline size_t            getNumberOfContacts()          const WALBERLA_OVERRIDE;
    virtual inline size_t            getNumberOfContactsTreated()   const WALBERLA_OVERRIDE;
    inline const std::map<IBlockID::IDType, ContactCache> getContactCache() const { return blockToContactCache_; }
-   inline real_t                    getSpeedLimitFactor() const;
+   inline pe_real_t                    getSpeedLimitFactor() const;
    inline size_t                    getMaxIterations() const { return maxIterations_; }
-   inline real_t                    getRelaxationParameter() const { return relaxationParam_; }
-   inline real_t                    getErrorReductionParameter() const { return erp_; }
+   inline pe_real_t                    getRelaxationParameter() const { return relaxationParam_; }
+   inline pe_real_t                    getErrorReductionParameter() const { return erp_; }
    inline RelaxationModel           getRelaxationModel() const { return relaxationModel_; }
    //@}
    //**********************************************************************************************
@@ -145,12 +145,12 @@ public:
    //**Set functions*******************************************************************************
    /*!\name Set functions */
    //@{
-   inline void            setRelaxationParameter( real_t f );
+   inline void            setRelaxationParameter( pe_real_t f );
    inline void            setMaxIterations( size_t n );
    inline void            setRelaxationModel( RelaxationModel relaxationModel );
-   inline void            setErrorReductionParameter( real_t erp );
-   inline void            setAbortThreshold( real_t threshold );
-   inline void            setSpeedLimiter( bool active, const real_t speedLimitFactor = real_t(0.0) );
+   inline void            setErrorReductionParameter( pe_real_t erp );
+   inline void            setAbortThreshold( pe_real_t threshold );
+   inline void            setSpeedLimiter( bool active, const pe_real_t speedLimitFactor = pe_real_t(0.0) );
    //@}
    //**********************************************************************************************
 
@@ -165,30 +165,30 @@ public:
 
    /// forwards to timestep
    /// Convenience operator to make class a functor.
-   void operator()(const real_t dt) { timestep(dt); }
+   void operator()(const pe_real_t dt) { timestep(dt); }
    /// Advances the simulation dt seconds.
-   void timestep( const real_t dt );
+   void timestep( const pe_real_t dt );
 
 private:
 
    //**Simulation functions************************************************************************
    /*!\name Simulation functions */
    //@{
-   void resolveContacts( const Contacts& contacts, real_t dt );
-   real_t relaxInelasticFrictionlessContacts( real_t dtinv,
+   void resolveContacts( const Contacts& contacts, pe_real_t dt );
+   pe_real_t relaxInelasticFrictionlessContacts( pe_real_t dtinv,
                                               HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                               HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache );
-   real_t relaxApproximateInelasticCoulombContactsByDecoupling( real_t dtinv,
+   pe_real_t relaxApproximateInelasticCoulombContactsByDecoupling( pe_real_t dtinv,
                                                                 HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                                 HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache );
-   real_t relaxInelasticCoulombContactsByDecoupling( real_t dtinv,
+   pe_real_t relaxInelasticCoulombContactsByDecoupling( pe_real_t dtinv,
                                                      HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                      HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache );
-   real_t relaxInelasticCoulombContactsByOrthogonalProjections( real_t dtinv,
+   pe_real_t relaxInelasticCoulombContactsByOrthogonalProjections( pe_real_t dtinv,
                                                                 bool approximate,
                                                                 HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                                 HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache );
-   real_t relaxInelasticGeneralizedMaximumDissipationContacts( real_t dtinv,
+   pe_real_t relaxInelasticGeneralizedMaximumDissipationContacts( pe_real_t dtinv,
                                                                HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                                HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache );
    //@}
@@ -206,8 +206,8 @@ private:
    //**Time-integration functions******************************************************************
    /*!\name Time-integration functions */
    //@{
-   void initializeVelocityCorrections( BodyID body, Vec3& dv, Vec3& dw, real_t dt ) const;
-   void integratePositions( BodyID body, Vec3 v, Vec3 w, real_t dt ) const;
+   void initializeVelocityCorrections( BodyID body, Vec3& dv, Vec3& dw, pe_real_t dt ) const;
+   void integratePositions( BodyID body, Vec3 v, Vec3 w, pe_real_t dt ) const;
    //@}
    //**********************************************************************************************
 
@@ -231,19 +231,19 @@ private:
    mpi::BufferSystem                 syncVelBS_;
 
 
-   real_t erp_;                       //!< The error reduction parameter (0 <= erp_ <= 1).
+   pe_real_t erp_;                       //!< The error reduction parameter (0 <= erp_ <= 1).
    size_t maxIterations_;             //!< Maximum number of iterations.
    size_t iteration_;
    size_t maxSubIterations_;          //!< Maximum number of iterations of iterative solvers in the one-contact problem.
-   real_t abortThreshold_;            //!< If L-infinity iterate difference drops below this threshold the iteration is aborted.
+   pe_real_t abortThreshold_;            //!< If L-infinity iterate difference drops below this threshold the iteration is aborted.
    RelaxationModel relaxationModel_;  //!< The method used to relax unilateral contacts
-   real_t relaxationParam_;           //!< Parameter specifying underrelaxation of velocity corrections for boundary bodies.
-   real_t maximumPenetration_;
+   pe_real_t relaxationParam_;           //!< Parameter specifying underrelaxation of velocity corrections for boundary bodies.
+   pe_real_t maximumPenetration_;
    size_t numContacts_;
    size_t numContactsTreated_;
 
    bool   speedLimiterActive_;        //!< is the speed limiter active?
-   real_t speedLimitFactor_;          //!< what multiple of boundingbox edge length is the body allowed to travel in one timestep
+   pe_real_t speedLimitFactor_;          //!< what multiple of boundingbox edge length is the body allowed to travel in one timestep
 
    //**********************************************************************************************
    /*! \cond WALBERLA_INTERNAL */
@@ -263,7 +263,7 @@ private:
    };
    /*! \endcond */
    //**********************************************************************************************
-   std::vector<real_t> reductionBuffer_;                    //!< Buffer for the reduction of forces and torques acting on global non-fixed bodies.
+   std::vector<pe_real_t> reductionBuffer_;                    //!< Buffer for the reduction of forces and torques acting on global non-fixed bodies.
    bool requireSync_;         //!< Flag indicating whether this process requires a synchronization prior to the next time step.
    //@}
    //**********************************************************************************************
@@ -286,7 +286,7 @@ typedef HardContactSemiImplicitTimesteppingSolvers HCSITS;
  *
  * Only contacts treated on the local process are considered.
  */
-inline real_t HardContactSemiImplicitTimesteppingSolvers::getMaximumPenetration() const
+inline pe_real_t HardContactSemiImplicitTimesteppingSolvers::getMaximumPenetration() const
 {
    return maximumPenetration_;
 }
@@ -310,7 +310,7 @@ inline size_t HardContactSemiImplicitTimesteppingSolvers::getNumberOfContactsTre
    return numContactsTreated_;
 }
 
-inline real_t HardContactSemiImplicitTimesteppingSolvers::getSpeedLimitFactor() const
+inline pe_real_t HardContactSemiImplicitTimesteppingSolvers::getSpeedLimitFactor() const
 {
    return speedLimitFactor_;
 }
@@ -335,7 +335,7 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::getSpeedLimitFactor()
  * require underrelaxation. The parameter must be positive. Note that for dilute systems the
  * solver might need stronger underrelaxation (smaller \a f) than for dense systems.
  */
-inline void HardContactSemiImplicitTimesteppingSolvers::setRelaxationParameter( real_t f )
+inline void HardContactSemiImplicitTimesteppingSolvers::setRelaxationParameter( pe_real_t f )
 {
    WALBERLA_ASSERT_GREATER( f, 0, "Relaxation parameter must be positive." );
 
@@ -382,7 +382,7 @@ inline void HardContactSemiImplicitTimesteppingSolvers::setRelaxationModel( Rela
  * reduction and is the default. 1 corresponds to full error reduction. Note that error reduction
  * (constraint stabilization) introduces additional energy to the system.
  */
-inline void HardContactSemiImplicitTimesteppingSolvers::setErrorReductionParameter( real_t erp )
+inline void HardContactSemiImplicitTimesteppingSolvers::setErrorReductionParameter( pe_real_t erp )
 {
    WALBERLA_ASSERT_GREATER_EQUAL( erp, 0, "Error reduction parameter out of range." );
    WALBERLA_ASSERT_LESS_EQUAL( erp, 1, "Error reduction parameter out of range." );
@@ -399,7 +399,7 @@ inline void HardContactSemiImplicitTimesteppingSolvers::setErrorReductionParamet
 * \param threshold If movement is smaller than threshold, col. resolution is stopped.
 * \return void
 */
-inline void HardContactSemiImplicitTimesteppingSolvers::setAbortThreshold( real_t threshold )
+inline void HardContactSemiImplicitTimesteppingSolvers::setAbortThreshold( pe_real_t threshold )
 {
    abortThreshold_ = threshold;
 }
@@ -415,7 +415,7 @@ inline void HardContactSemiImplicitTimesteppingSolvers::setAbortThreshold( real_
 * \param speedLimitFactor size of bounding box will be multiplied by this factor to get the maximal distance a body is allowed to travel within one timestep
 * \return void
 */
-inline void HardContactSemiImplicitTimesteppingSolvers::setSpeedLimiter( bool active, const real_t speedLimitFactor )
+inline void HardContactSemiImplicitTimesteppingSolvers::setSpeedLimiter( bool active, const pe_real_t speedLimitFactor )
 {
    speedLimiterActive_ = active;
    speedLimitFactor_   = speedLimitFactor;
diff --git a/src/pe/cr/HCSITS.impl.h b/src/pe/cr/HCSITS.impl.h
index 75dbab023e36a123be78b32ffaadd392db29fd84..0af761c76cd1e68f51105e4525e6b4501a0a6e99 100644
--- a/src/pe/cr/HCSITS.impl.h
+++ b/src/pe/cr/HCSITS.impl.h
@@ -146,12 +146,12 @@ inline HardContactSemiImplicitTimesteppingSolvers::~HardContactSemiImplicitTimes
  * \return void
  *
  */
-inline void HardContactSemiImplicitTimesteppingSolvers::timestep( const real_t dt )
+inline void HardContactSemiImplicitTimesteppingSolvers::timestep( const pe_real_t dt )
 {
    //WALBERLA_LOG_DETAIL( "New timestep!" );
    WALBERLA_ASSERT( !requireSync_, "Simulation requires synchronization before continuing." );
 
-   const real_t dtinv( real_c(1) / dt );
+   const pe_real_t dtinv( real_c(1) / dt );
 
    numContacts_        = 0;
    numContactsTreated_ = 0;
@@ -322,12 +322,12 @@ inline void HardContactSemiImplicitTimesteppingSolvers::timestep( const real_t d
 
          // Velocities of shadow copies will be initialized by velocity synchronization.
 #ifndef NDEBUG
-         bodyCache.v_[j] = Vec3( std::numeric_limits<real_t>::quiet_NaN(),
-                                 std::numeric_limits<real_t>::quiet_NaN(),
-                                 std::numeric_limits<real_t>::quiet_NaN() );
-         bodyCache.w_[j] = Vec3( std::numeric_limits<real_t>::quiet_NaN(),
-                                 std::numeric_limits<real_t>::quiet_NaN(),
-                                 std::numeric_limits<real_t>::quiet_NaN() );
+         bodyCache.v_[j] = Vec3( std::numeric_limits<pe_real_t>::quiet_NaN(),
+                                 std::numeric_limits<pe_real_t>::quiet_NaN(),
+                                 std::numeric_limits<pe_real_t>::quiet_NaN() );
+         bodyCache.w_[j] = Vec3( std::numeric_limits<pe_real_t>::quiet_NaN(),
+                                 std::numeric_limits<pe_real_t>::quiet_NaN(),
+                                 std::numeric_limits<pe_real_t>::quiet_NaN() );
 #endif
       }
 
@@ -335,7 +335,7 @@ inline void HardContactSemiImplicitTimesteppingSolvers::timestep( const real_t d
    }
 
    if (tt_ != NULL) tt_->start("Collision Response Resolution");
-   const real_t rp = relaxationParam_;
+   const pe_real_t rp = relaxationParam_;
    relaxationParam_ = real_c(1); // must be set to 1.0 such that dv and dw caused by external forces and torques are not falsely altered
    synchronizeVelocities( );
    relaxationParam_ = rp;
@@ -345,7 +345,7 @@ inline void HardContactSemiImplicitTimesteppingSolvers::timestep( const real_t d
    {
       WALBERLA_LOG_DETAIL( "Iteration #" << it << "");
 
-      real_t delta_max( 0 );
+      pe_real_t delta_max( 0 );
 
       iteration_ = it;
 
@@ -498,11 +498,11 @@ inline void HardContactSemiImplicitTimesteppingSolvers::timestep( const real_t d
  * This function is to be called from resolveContacts(). Separating contacts are preferred over
  * persisting solutions if valid.
  */
-inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticFrictionlessContacts( real_t dtinv,
+inline pe_real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticFrictionlessContacts( pe_real_t dtinv,
                                                                                               HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                                                               HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache )
 {
-   real_t delta_max( 0 );
+   pe_real_t delta_max( 0 );
    size_t numContactsMasked( contactCache.p_.size() );
 
    // Relax contacts
@@ -570,11 +570,11 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticFriction
  * components. The determination of the frictional components does not perform any subiterations
  * and guarantees that the friction partially opposes slip.
  */
-inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxApproximateInelasticCoulombContactsByDecoupling( real_t dtinv,
+inline pe_real_t HardContactSemiImplicitTimesteppingSolvers::relaxApproximateInelasticCoulombContactsByDecoupling( pe_real_t dtinv,
                                                                                                                 HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                                                                                 HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache )
 {
-   real_t delta_max( 0 );
+   pe_real_t delta_max( 0 );
    size_t numContactsMasked( contactCache.p_.size() );
 
    // Relax contacts
@@ -592,9 +592,9 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxApproximateInelas
       Mat3 contactframe( contactCache.n_[i], contactCache.t_[i], contactCache.o_[i] );
       Vec3 gdot_nto( contactframe.getTranspose() * gdot );
 
-      //real_t gdot_n  ( trans( contactCache.n_[i] ) * gdot );  // The component of gdot along the contact normal n
+      //pe_real_t gdot_n  ( trans( contactCache.n_[i] ) * gdot );  // The component of gdot along the contact normal n
       //Vec3 gdot_t  ( gdot - gdot_n * contactCache.n_[i] );  // The components of gdot tangential to the contact normal n
-      //real_t g_n     ( gdot_n * dt /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] );  // The gap in normal direction
+      //pe_real_t g_n     ( gdot_n * dt /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] );  // The gap in normal direction
 
       // The constraint in normal direction is actually a positional constraint but instead of g_n we use g_n/dt equivalently and call it gdot_n
       gdot_nto[0] += ( /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] ) * dtinv;
@@ -619,8 +619,8 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxApproximateInelas
          // A\b    \approx [-0.19 -2.28 -1.21]'
          // eig(A) \approx [ 0.40  0.56  1.04]'
 
-         real_t flimit( contactCache.mu_[i] * p_cf[0] );
-         real_t fsq( p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2] );
+         pe_real_t flimit( contactCache.mu_[i] * p_cf[0] );
+         pe_real_t fsq( p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2] );
          if( fsq > flimit * flimit || p_cf[0] < 0 ) {
             // Contact cannot be static so it must be dynamic.
             // => Complementarity condition on normal reaction now turns into an equation since we know that the normal reaction is definitely not zero.
@@ -640,14 +640,14 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxApproximateInelas
 
             //      |<-- This should vanish below since p_cf[0] = 0          -->|
             //gdot += ( contactCache.body1_[i]->getInvMass() + contactCache.body2_[i]->getInvMass() ) * p_tmp + ( contactCache.body1_[i]->getInvInertia() * ( contactCache.r1_[i] % p_tmp] ) ) % contactCache.r1_[i] + ( contactCache.body2_[i]->getInvInertia() * ( contactCache.r2_[i] % p_tmp ) ) % contactCache.r2_[i] /* + diag_[i] * p */;
-            //real_t gdot_n = trans( contactCache.n_[i] ) * gdot;
+            //pe_real_t gdot_n = trans( contactCache.n_[i] ) * gdot;
             //gdot_n += ( /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] ) * dtinv;
 
-            real_t gdot_n = gdot_nto[0] + contactCache.n_[i] * ( ( contactCache.body1_[i]->getInvInertia() * ( contactCache.r1_[i] % p_tmp ) ) % contactCache.r1_[i] + ( contactCache.body2_[i]->getInvInertia() * ( contactCache.r2_[i] % p_tmp ) ) % contactCache.r2_[i] /* + diag_[i] * p */ );
+            pe_real_t gdot_n = gdot_nto[0] + contactCache.n_[i] * ( ( contactCache.body1_[i]->getInvInertia() * ( contactCache.r1_[i] % p_tmp ) ) % contactCache.r1_[i] + ( contactCache.body2_[i]->getInvInertia() * ( contactCache.r2_[i] % p_tmp ) ) % contactCache.r2_[i] /* + diag_[i] * p */ );
             p_cf[0] = -( contactCache.diag_n_inv_[i] * gdot_n );
 
             // We cannot be sure that gdot_n <= 0 here and thus p_cf[0] >= 0 since we just modified it with the old values of the tangential reactions! => Project
-            p_cf[0] = std::max( real_c( 0 ), p_cf[0] );
+            p_cf[0] = std::max( real_c( 0 ), real_c( p_cf[0] ) );
 
             // Now add the action of the normal reaction to the relative contact velocity in the tangential directions so we can relax the frictional components separately.
             p_tmp = contactCache.n_[i] * p_cf[0];
@@ -663,7 +663,7 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxApproximateInelas
             flimit = contactCache.mu_[i] * p_cf[0];
             fsq = p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2];
             if( fsq > flimit * flimit ) {
-               const real_t f( flimit / std::sqrt( fsq ) );
+               const pe_real_t f( flimit / std::sqrt( fsq ) );
                p_cf[1] *= f;
                p_cf[2] *= f;
             }
@@ -748,11 +748,11 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxApproximateInelas
  * friction model depends on the number of subiterations performed. If no subiterations are
  * performed the friction is guaranteed to be at least partially dissipative.
  */
-inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombContactsByDecoupling( real_t dtinv,
+inline pe_real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombContactsByDecoupling( pe_real_t dtinv,
                                                                                                      HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                                                                      HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache )
 {
-   real_t delta_max( 0 );
+   pe_real_t delta_max( 0 );
    size_t numContactsMasked( contactCache.p_.size() );
 
    // Relax contacts
@@ -770,9 +770,9 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
       Mat3 contactframe( contactCache.n_[i], contactCache.t_[i], contactCache.o_[i] );
       Vec3 gdot_nto( contactframe.getTranspose() * gdot );
 
-      //real_t gdot_n  ( trans( contactCache.n_[i] ) * gdot );  // The component of gdot along the contact normal n
+      //pe_real_t gdot_n  ( trans( contactCache.n_[i] ) * gdot );  // The component of gdot along the contact normal n
       //Vec3 gdot_t  ( gdot - gdot_n * contactCache.n_[i] );  // The components of gdot tangential to the contact normal n
-      //real_t g_n     ( gdot_n * dt /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] );  // The gap in normal direction
+      //pe_real_t g_n     ( gdot_n * dt /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] );  // The gap in normal direction
 
       // The constraint in normal direction is actually a positional constraint but instead of g_n we use g_n/dt equivalently and call it gdot_n
       gdot_nto[0] += ( /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] ) * dtinv;
@@ -800,8 +800,8 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
          // A\b    \approx [-0.19 -2.28 -1.21]'
          // eig(A) \approx [ 0.40  0.56  1.04]'
 
-         real_t flimit( contactCache.mu_[i] * p_cf[0] );
-         real_t fsq( p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2] );
+         pe_real_t flimit( contactCache.mu_[i] * p_cf[0] );
+         pe_real_t fsq( p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2] );
          if( fsq > flimit * flimit || p_cf[0] < 0 ) {
             // Contact cannot be static so it must be dynamic.
             // => Complementarity condition on normal reaction now turns into an equation since we know that the normal reaction is definitely not zero.
@@ -814,7 +814,7 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
                // Warning: Simply projecting the frictional components is wrong since then the normal action is no longer 0 and simulations break.
 
                Vec3 gdotCorrected;
-               real_t gdotCorrected_n;
+               pe_real_t gdotCorrected_n;
                Vec2 gdotCorrected_to;
 
                // Calculate the relative contact velocity in the global world frame (if no normal contact reaction is present at contact i)
@@ -824,7 +824,7 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
                gdotCorrected_n = contactCache.n_[i] * gdotCorrected + contactCache.dist_[i] * dtinv;
 
                // Relax normal component.
-               p_cf[0] = std::max( real_c( 0 ), -( contactCache.diag_n_inv_[i] * gdotCorrected_n ) );
+               p_cf[0] = std::max( real_c( 0 ), -real_c( contactCache.diag_n_inv_[i] * gdotCorrected_n ) );
 
                // Calculate the relative contact velocity in the global world frame (if no frictional contact reaction is present at contact i)
                p_cf[1] = p_cf[2] = real_c( 0 );
@@ -847,34 +847,34 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
                   // Determine \tilde{A}
                   Mat2 diag_to( contactCache.diag_nto_[i](1, 1), contactCache.diag_nto_[i](1, 2), contactCache.diag_nto_[i](2, 1), contactCache.diag_nto_[i](2, 2) );
 
-                        const real_t f( flimit / std::sqrt( fsq ) );
+                        const pe_real_t f( flimit / std::sqrt( fsq ) );
                   //p_cf[1] *= f;
                   //p_cf[2] *= f;
 
                   // Determine search interval for Golden Section Search
-                  const real_t phi( real_c(0.5) * ( real_c(1) + std::sqrt( real_c( 5 ) ) ) );
-                  real_t shift( std::atan2( -p_cf[2], p_cf[1] ) );
-                  real_t acos_f( std::acos( f ) );
+                  const pe_real_t phi( real_c(0.5) * ( real_c(1) + std::sqrt( real_c( 5 ) ) ) );
+                  pe_real_t shift( std::atan2( -p_cf[2], p_cf[1] ) );
+                  pe_real_t acos_f( std::acos( f ) );
 
                   //WALBERLA_LOG_WARNING( acos_f << " " << shift );
 
-                  real_t alpha_left( -acos_f - shift );
+                  pe_real_t alpha_left( -acos_f - shift );
                   //Vec2 x_left( flimit * std::cos( alpha_left ), flimit * std::sin( alpha_left ) );
-                  //real_t f_left( 0.5 * trans( x_left ) * ( diag_to * x_left ) - trans( x_left ) * ( -gdot_to ) );
+                  //pe_real_t f_left( 0.5 * trans( x_left ) * ( diag_to * x_left ) - trans( x_left ) * ( -gdot_to ) );
 
-                  real_t alpha_right( acos_f - shift );
+                  pe_real_t alpha_right( acos_f - shift );
                   //Vec2 x_right( flimit * std::cos( alpha_right ), flimit * std::sin( alpha_right ) );
-                  //real_t f_right( 0.5 * trans( x_right ) * ( diag_to * x_right ) - trans( x_right ) * ( -gdot_to ) );
+                  //pe_real_t f_right( 0.5 * trans( x_right ) * ( diag_to * x_right ) - trans( x_right ) * ( -gdot_to ) );
 
-                  real_t alpha_mid( ( alpha_right + alpha_left * phi ) / ( 1 + phi ) );
+                  pe_real_t alpha_mid( ( alpha_right + alpha_left * phi ) / ( 1 + phi ) );
                   Vec2 x_mid( flimit * std::cos( alpha_mid ), flimit * std::sin( alpha_mid ) );
-                  real_t f_mid( real_c(0.5) * x_mid * ( diag_to * x_mid ) - x_mid * ( -gdotCorrected_to ) );
+                  pe_real_t f_mid( real_c(0.5) * x_mid * ( diag_to * x_mid ) - x_mid * ( -gdotCorrected_to ) );
 
                   bool leftlarger = false;
                   for( size_t k = 0; k < maxSubIterations_; ++k ) {
-                     real_t alpha_next( alpha_left + ( alpha_right - alpha_mid ) );
+                     pe_real_t alpha_next( alpha_left + ( alpha_right - alpha_mid ) );
                      Vec2 x_next( flimit * std::cos( alpha_next ), flimit * std::sin( alpha_next ) );
-                     real_t f_next( real_c(0.5) * x_next * ( diag_to * x_next ) - x_next * ( -gdotCorrected_to ) );
+                     pe_real_t f_next( real_c(0.5) * x_next * ( diag_to * x_next ) - x_next * ( -gdotCorrected_to ) );
                      //WALBERLA_LOG_WARNING( "[(" << alpha_left << ", ?); (" << alpha_mid << ", " << f_mid << "); (" << alpha_right << ", ?)] <- (" << alpha_next << ", " << f_next << ")" );
                      //WALBERLA_LOG_WARNING( "left: " << alpha_mid - alpha_left << "  right: " << alpha_right - alpha_mid << "  ll: " << leftlarger );
                      //WALBERLA_ASSERT(leftlarger ? (alpha_mid - alpha_left > alpha_right - alpha_mid) : (alpha_mid - alpha_left < alpha_right - alpha_mid), "ll inconsistent!" );
@@ -1010,12 +1010,12 @@ return delta_max;
  * Modelling (Volume 28, Issue 4, 1998, Pages 225-245). Which iteration is used is controlled with
  * the approximate parameter.
  */
-inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombContactsByOrthogonalProjections( real_t dtinv,
+inline pe_real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombContactsByOrthogonalProjections( pe_real_t dtinv,
                                                                                                                 bool approximate,
                                                                                                                 HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                                                                                 HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache )
 {
-   real_t delta_max( 0 );
+   pe_real_t delta_max( 0 );
    size_t numContactsMasked( contactCache.p_.size() );
 
    // Relax contacts
@@ -1033,14 +1033,14 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
       Mat3 contactframe( contactCache.n_[i], contactCache.t_[i], contactCache.o_[i] );
       Vec3 gdot_nto( contactframe.getTranspose() * gdot );
 
-      //real_t gdot_n  ( trans( contactCache.n_[i] ) * gdot );  // The component of gdot along the contact normal n
+      //pe_real_t gdot_n  ( trans( contactCache.n_[i] ) * gdot );  // The component of gdot along the contact normal n
       //Vec3 gdot_t  ( gdot - gdot_n * contactCache.n_[i] );  // The components of gdot tangential to the contact normal n
-      //real_t g_n     ( gdot_n * dt /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] );  // The gap in normal direction
+      //pe_real_t g_n     ( gdot_n * dt /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] );  // The gap in normal direction
 
       // The constraint in normal direction is actually a positional constraint but instead of g_n we use g_n/dt equivalently and call it gdot_n
       gdot_nto[0] += ( /* + trans( contactCache.n_[i] ) * ( contactCache.body1_[i]->getPosition() + contactCache.r1_[i] ) - ( contactCache.body2_[i]->getPosition() + contactCache.r2_[i] ) */ + contactCache.dist_[i] ) * dtinv;
 
-      const real_t w( 1 ); // w > 0
+      const pe_real_t w( 1 ); // w > 0
       Vec3 p_cf( contactframe.getTranspose() * contactCache.p_[i] );
       if( approximate ) {
          // Calculate next iterate (Anitescu/Tasora).
@@ -1054,8 +1054,8 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
       }
 
       // Project.
-      real_t flimit( contactCache.mu_[i] * p_cf[0] );
-      real_t fsq( p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2] );
+      pe_real_t flimit( contactCache.mu_[i] * p_cf[0] );
+      pe_real_t fsq( p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2] );
       if( p_cf[0] > 0 && fsq < flimit * flimit ) {
          // Unconstrained minimum is in cone leading to a static contact and no projection
          // is necessary.
@@ -1068,9 +1068,9 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
       }
       else {
          // The contact is dynamic.
-         real_t f( std::sqrt( fsq ) );
+         pe_real_t f( std::sqrt( fsq ) );
          p_cf[0] = ( f * contactCache.mu_[i] + p_cf[0] ) / ( math::sq( contactCache.mu_[i] ) + 1 );
-         real_t factor( contactCache.mu_[i] * p_cf[0] / f );
+         pe_real_t factor( contactCache.mu_[i] * p_cf[0] / f );
          p_cf[1] *= factor;
          p_cf[2] *= factor;
       }
@@ -1103,11 +1103,11 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticCoulombC
  * minimizing the kinetic energy along the intersection of the plane of maximum compression and
  * the friction cone.
  */
-inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticGeneralizedMaximumDissipationContacts( real_t dtinv,
+inline pe_real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticGeneralizedMaximumDissipationContacts( pe_real_t dtinv,
                                                                                                                HardContactSemiImplicitTimesteppingSolvers::ContactCache& contactCache,
                                                                                                                HardContactSemiImplicitTimesteppingSolvers::BodyCache& bodyCache )
 {
-   real_t delta_max( 0 );
+   pe_real_t delta_max( 0 );
    size_t numContactsMasked( contactCache.p_.size() );
 
    // Relax contacts
@@ -1152,8 +1152,8 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticGenerali
          // A\b    \approx [-0.19 -2.28 -1.21]'
          // eig(A) \approx [ 0.40  0.56  1.04]'
 
-         real_t flimit( contactCache.mu_[i] * p_cf[0] );
-         real_t fsq( p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2] );
+         pe_real_t flimit( contactCache.mu_[i] * p_cf[0] );
+         pe_real_t fsq( p_cf[1] * p_cf[1] + p_cf[2] * p_cf[2] );
          if( fsq > flimit * flimit || p_cf[0] < 0 ) {
             // Contact cannot be static so it must be dynamic.
             // => Complementarity condition on normal reaction now turns into an equation since we know that the normal reaction is definitely not zero.
@@ -1161,22 +1161,22 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticGenerali
             // \breve{x}^0 = p_cf[1..2]
 
             // Eliminate normal component from 3x3 system: contactCache.diag_nto_[i]*p_cf + gdot_nto => \breve{A} \breve{x} - \breve{b}
-            const real_t invA_nn( math::inv( contactCache.diag_nto_[i](0, 0) ) );
-                                  const real_t offdiag( contactCache.diag_nto_[i](1, 2) - invA_nn * contactCache.diag_nto_[i](0, 1) * contactCache.diag_nto_[i](0, 2) );
+            const pe_real_t invA_nn( math::inv( contactCache.diag_nto_[i](0, 0) ) );
+                                  const pe_real_t offdiag( contactCache.diag_nto_[i](1, 2) - invA_nn * contactCache.diag_nto_[i](0, 1) * contactCache.diag_nto_[i](0, 2) );
                                   Mat2 A_breve( contactCache.diag_nto_[i](1, 1) - invA_nn *math::sq( contactCache.diag_nto_[i](0, 1) ), offdiag, offdiag, contactCache.diag_nto_[i](2, 2) - invA_nn *math::sq( contactCache.diag_nto_[i](0, 2) ) );
                                                                                                      Vec2 b_breve( -gdot_nto[1] + invA_nn * contactCache.diag_nto_[i](0, 1) * gdot_nto[0], -gdot_nto[2] + invA_nn * contactCache.diag_nto_[i](0, 2) * gdot_nto[0] );
 
-                                                const real_t shiftI( std::atan2( -contactCache.diag_nto_[i](0, 2), contactCache.diag_nto_[i](0, 1) ) );
-                                                                     const real_t shiftJ( std::atan2( -p_cf[2], p_cf[1] ) );
-                                  const real_t a3( std::sqrt(math::sq( contactCache.diag_nto_[i](0, 1) ) +math::sq( contactCache.diag_nto_[i](0, 2) ) ) );
-                                                                       const real_t fractionI( -contactCache.diag_nto_[i](0, 0) / ( contactCache.mu_[i] * a3 ) );
-                                                                       const real_t fractionJ( std::min( invA_nn * contactCache.mu_[i] * ( ( -gdot_nto[0] ) / std::sqrt( fsq ) - a3 * std::cos( shiftI - shiftJ ) ), real_c( 1 ) ) );
+                                                const pe_real_t shiftI( std::atan2( -contactCache.diag_nto_[i](0, 2), contactCache.diag_nto_[i](0, 1) ) );
+                                                                     const pe_real_t shiftJ( std::atan2( -p_cf[2], p_cf[1] ) );
+                                  const pe_real_t a3( std::sqrt(math::sq( contactCache.diag_nto_[i](0, 1) ) +math::sq( contactCache.diag_nto_[i](0, 2) ) ) );
+                                                                       const pe_real_t fractionI( -contactCache.diag_nto_[i](0, 0) / ( contactCache.mu_[i] * a3 ) );
+                                                                       const pe_real_t fractionJ( std::min( real_c( invA_nn * contactCache.mu_[i] * ( ( -gdot_nto[0] ) / std::sqrt( fsq ) - a3 * std::cos( shiftI - shiftJ ) ) ), real_c( 1 ) ) );
 
                                                              // Search interval determination.
-                                                             real_t alpha_left, alpha_right;
+                                                             pe_real_t alpha_left, alpha_right;
                                                    if( fractionJ < -1 ) {
                                                       // J is complete
-                                                      const real_t angleI( std::acos( fractionI ) );
+                                                      const pe_real_t angleI( std::acos( fractionI ) );
                                                       alpha_left = -angleI - shiftI;
                                                       alpha_right = +angleI - shiftI;
                                                       if( alpha_left < 0 ) {
@@ -1186,7 +1186,7 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticGenerali
                                                    }
                                                    else if( contactCache.diag_nto_[i](0, 0) > contactCache.mu_[i] * a3 ) {
                // I is complete
-               const real_t angleJ( std::acos( fractionJ ) );
+               const pe_real_t angleJ( std::acos( fractionJ ) );
                alpha_left = -angleJ - shiftJ;
                alpha_right = +angleJ - shiftJ;
                if( alpha_left < 0 ) {
@@ -1196,16 +1196,16 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticGenerali
             }
             else {
                // neither I nor J is complete
-               const real_t angleJ( std::acos( fractionJ ) );
-               real_t alpha1_left( -angleJ - shiftJ );
-               real_t alpha1_right( +angleJ - shiftJ );
+               const pe_real_t angleJ( std::acos( fractionJ ) );
+               pe_real_t alpha1_left( -angleJ - shiftJ );
+               pe_real_t alpha1_right( +angleJ - shiftJ );
                if( alpha1_left < 0 ) {
                   alpha1_left += 2 * math::M_PI;
                   alpha1_right += 2 * math::M_PI;
                }
-               const real_t angleI( std::acos( fractionI ) );
-               real_t alpha2_left( -angleI - shiftI );
-               real_t alpha2_right( +angleI - shiftI );
+               const pe_real_t angleI( std::acos( fractionI ) );
+               pe_real_t alpha2_left( -angleI - shiftI );
+               pe_real_t alpha2_right( +angleI - shiftI );
                if( alpha2_left < 0 ) {
                   alpha2_left += 2 * math::M_PI;
                   alpha2_right += 2 * math::M_PI;
@@ -1242,27 +1242,27 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticGenerali
                alpha_right = alpha1_right;
             }
 
-            const real_t phi( real_c(0.5) * ( real_c(1) + std::sqrt( real_c( 5 ) ) ) );
-                                                   real_t alpha_mid( ( alpha_right + alpha_left * phi ) / ( 1 + phi ) );
+            const pe_real_t phi( real_c(0.5) * ( real_c(1) + std::sqrt( real_c( 5 ) ) ) );
+                                                   pe_real_t alpha_mid( ( alpha_right + alpha_left * phi ) / ( 1 + phi ) );
                                   Vec2 x_mid;
-                  real_t f_mid;
+                  pe_real_t f_mid;
 
             {
-               real_t r_ub = contactCache.mu_[i] * ( -gdot_nto[0] ) / ( contactCache.diag_nto_[i](0, 0) + contactCache.mu_[i] * a3 * std::cos( alpha_mid + shiftI ) );
+               pe_real_t r_ub = contactCache.mu_[i] * ( -gdot_nto[0] ) / ( contactCache.diag_nto_[i](0, 0) + contactCache.mu_[i] * a3 * std::cos( alpha_mid + shiftI ) );
                      if( r_ub < 0 )
-                     r_ub = math::Limits<real_t>::inf();
+                     r_ub = math::Limits<pe_real_t>::inf();
                x_mid = Vec2( r_ub * std::cos( alpha_mid ), r_ub * std::sin( alpha_mid ) );
                f_mid = real_c(0.5) * x_mid * ( A_breve * x_mid ) - x_mid * b_breve;
             }
 
             bool leftlarger = false;
             for( size_t k = 0; k < maxSubIterations_; ++k ) {
-               real_t alpha_next( alpha_left + ( alpha_right - alpha_mid ) );
-               real_t r_ub = contactCache.mu_[i] * ( -gdot_nto[0] ) / ( contactCache.diag_nto_[i](0, 0) + contactCache.mu_[i] * a3 * std::cos( alpha_next + shiftI ) );
+               pe_real_t alpha_next( alpha_left + ( alpha_right - alpha_mid ) );
+               pe_real_t r_ub = contactCache.mu_[i] * ( -gdot_nto[0] ) / ( contactCache.diag_nto_[i](0, 0) + contactCache.mu_[i] * a3 * std::cos( alpha_next + shiftI ) );
                      if( r_ub < 0 )
-                     r_ub = math::Limits<real_t>::inf();
+                     r_ub = math::Limits<pe_real_t>::inf();
                Vec2 x_next( r_ub * std::cos( alpha_next ), r_ub * std::sin( alpha_next ) );
-               real_t f_next( real_c(0.5) * x_next * ( A_breve * x_next ) - x_next * b_breve );
+               pe_real_t f_next( real_c(0.5) * x_next * ( A_breve * x_next ) - x_next * b_breve );
 
                //WALBERLA_LOG_WARNING( "[(" << alpha_left << ", ?); (" << alpha_mid << ", " << f_mid << "); (" << alpha_right << ", ?)] <- (" << alpha_next << ", " << f_next << ")" );
                //WALBERLA_LOG_WARNING( "left: " << alpha_mid - alpha_left << "  right: " << alpha_right - alpha_mid << "  ll: " << leftlarger );
@@ -1299,12 +1299,12 @@ inline real_t HardContactSemiImplicitTimesteppingSolvers::relaxInelasticGenerali
             }
             //WALBERLA_LOG_DETAIL( "dalpha = " << alpha_right - alpha_left << "\n");
             {
-               real_t alpha_init( std::atan2( p_cf[2], p_cf[1] ) );
-               real_t r_ub = contactCache.mu_[i] * ( -gdot_nto[0] ) / ( contactCache.diag_nto_[i](0, 0) + contactCache.mu_[i] * a3 * std::cos( alpha_init + shiftI ) );
+               pe_real_t alpha_init( std::atan2( p_cf[2], p_cf[1] ) );
+               pe_real_t r_ub = contactCache.mu_[i] * ( -gdot_nto[0] ) / ( contactCache.diag_nto_[i](0, 0) + contactCache.mu_[i] * a3 * std::cos( alpha_init + shiftI ) );
                      if( r_ub < 0 )
-                     r_ub = math::Limits<real_t>::inf();
+                     r_ub = math::Limits<pe_real_t>::inf();
                Vec2 x_init( r_ub * std::cos( alpha_init ), r_ub * std::sin( alpha_init ) );
-               real_t f_init( real_c(0.5) * x_init * ( A_breve * x_init ) - x_init * b_breve );
+               pe_real_t f_init( real_c(0.5) * x_init * ( A_breve * x_init ) - x_init * b_breve );
 
                if( f_init < f_mid )
                {
@@ -1670,7 +1670,7 @@ inline void HardContactSemiImplicitTimesteppingSolvers::synchronizeVelocities( )
    /*
    {
       size_t i;
-      std::vector<real_t> reductionBuffer( globalBodyStorage_->size() * 6, real_c(0) );
+      std::vector<pe_real_t> reductionBuffer( globalBodyStorage_->size() * 6, real_c(0) );
 
       for (auto blockIt = blockStorage_->begin(); blockIt != blockStorage_->end(); ++blockIt)
       {
@@ -1729,7 +1729,7 @@ inline void HardContactSemiImplicitTimesteppingSolvers::synchronizeVelocities( )
  * time integration of the velocities of the given body. For fixed objects the velocity corrections
  * are set to zero. External forces and torques are reset if indicated by the settings.
  */
-inline void HardContactSemiImplicitTimesteppingSolvers::initializeVelocityCorrections( BodyID body, Vec3& dv, Vec3& dw, real_t dt ) const
+inline void HardContactSemiImplicitTimesteppingSolvers::initializeVelocityCorrections( BodyID body, Vec3& dv, Vec3& dw, pe_real_t dt ) const
 {
    if( body->isAwake() ) {
       if( !body->hasInfiniteMass() )
@@ -1766,7 +1766,7 @@ inline void HardContactSemiImplicitTimesteppingSolvers::initializeVelocityCorrec
  * recalculated and it is redetermined whether the body is awake or not. Also the data
  * structure tracking the contacts attached to the body are cleared and
  */
-inline void HardContactSemiImplicitTimesteppingSolvers::integratePositions( BodyID body, Vec3 v, Vec3 w, real_t dt ) const
+inline void HardContactSemiImplicitTimesteppingSolvers::integratePositions( BodyID body, Vec3 v, Vec3 w, pe_real_t dt ) const
 {
    if ( body->isFixed() )
       return;
@@ -1822,10 +1822,10 @@ void configure( const Config::BlockHandle& config, pe::cr::HCSITS& cr )
    int HCSITSmaxIterations = config.getParameter<int>("HCSITSmaxIterations", 10);
    WALBERLA_LOG_INFO_ON_ROOT("HCSITSmaxIterations: " << HCSITSmaxIterations);
 
-   real_t HCSITSRelaxationParameter = config.getParameter<real_t>("HCSITSRelaxationParameter", real_t(0.75) );
+   pe_real_t HCSITSRelaxationParameter = config.getParameter<pe_real_t>("HCSITSRelaxationParameter", pe_real_t(0.75) );
    WALBERLA_LOG_INFO_ON_ROOT("HCSITSRelaxationParameter: " << HCSITSRelaxationParameter);
 
-   real_t HCSITSErrorReductionParameter = config.getParameter<real_t>("HCSITSErrorReductionParameter", real_t(0.8) );
+   pe_real_t HCSITSErrorReductionParameter = config.getParameter<pe_real_t>("HCSITSErrorReductionParameter", pe_real_t(0.8) );
    WALBERLA_LOG_INFO_ON_ROOT("HCSITSErrorReductionParameter: " << HCSITSErrorReductionParameter);
 
    std::string HCSITSRelaxationModelStr = config.getParameter<std::string>("HCSITSRelaxationModelStr", "ApproximateInelasticCoulombContactByDecoupling" );
diff --git a/src/pe/cr/ICR.h b/src/pe/cr/ICR.h
index 73d1868d3be50e43269ce044052bc32fedcadacd..994fbe9c9f42e8b96983579d734dd2b932a1af08 100644
--- a/src/pe/cr/ICR.h
+++ b/src/pe/cr/ICR.h
@@ -33,32 +33,32 @@ public:
    ICR() : /*globalLinearDrag_(0),*/ globalLinearAcceleration_(0) {}
    virtual ~ICR() {}
 
-   virtual void timestep( const real_t dt ) = 0;
+   virtual void timestep( const pe_real_t dt ) = 0;
 
 //   /// Sets the global drag coefficient.
 //   /// During the integration of the linear velocity of a rigid body
 //   /// a force equal to \code - drag * RigidBody::getLinearVel() \endcode is applied!
 //   /// \attention In contrast to the former Settings::damping() this will result in different
 //   /// final positions when the timestep length is changed!
-//   inline void        setGlobalLinearDrag(const real_t drag) { globalLinearDrag_ = drag;}
+//   inline void        setGlobalLinearDrag(const pe_real_t drag) { globalLinearDrag_ = drag;}
 //   /// Gets the global drag coefficient.
 //   /// \see setGlobalLinearDrag
-//   inline real_t      getGlobalLinearDrag() { return globalLinearDrag_; }
+//   inline pe_real_t      getGlobalLinearDrag() { return globalLinearDrag_; }
 
    /// Sets the global linear acceleration.
    /// This can be used for example to set a gravitational force.
    inline void        setGlobalLinearAcceleration(const Vec3& acc) { globalLinearAcceleration_ = acc; }
    inline const Vec3& getGlobalLinearAcceleration() const { return globalLinearAcceleration_; }
 
-   virtual inline real_t            getMaximumPenetration()        const;
+   virtual inline pe_real_t            getMaximumPenetration()        const;
    virtual inline size_t            getNumberOfContacts()          const;
    virtual inline size_t            getNumberOfContactsTreated()   const;
 private:
-//   real_t globalLinearDrag_;
+//   pe_real_t globalLinearDrag_;
    Vec3   globalLinearAcceleration_;
 };
 
-inline real_t ICR::getMaximumPenetration()        const
+inline pe_real_t ICR::getMaximumPenetration()        const
 {
    static bool warned = false;
    if (!warned) {
diff --git a/src/pe/cr/Integrators.h b/src/pe/cr/Integrators.h
index 7675caf6d51f7ce27b6f015e68bafdb14654ac9d..d57cf03ce723fcaad05072f6e658f566aa8999cd 100644
--- a/src/pe/cr/Integrators.h
+++ b/src/pe/cr/Integrators.h
@@ -20,7 +20,7 @@ namespace cr {
 */
 class IntegrateImplictEuler {
 public:
-   void operator()( BodyID id, real_t dt, ICR & solver ) const
+   void operator()( BodyID id, pe_real_t dt, ICR & solver ) const
    {
       // Calculating the linear acceleration by the equation
       //   force * m^(-1) + gravity
@@ -43,7 +43,7 @@ public:
       const Vec3 phi( id->getAngularVel() * dt );
 
       // Calculating the new orientation
-      if (!floatIsEqual(phi.length(), 0))
+      if (!floatIsEqual(phi.length(), 0.0))
          id->rotate( Quat( phi, phi.length() ) );
       WALBERLA_ASSERT_FLOAT_EQUAL( id->getRotation().getDeterminant(), real_c(1 ), "Corrupted rotation matrix determinant" );
 
@@ -68,7 +68,7 @@ public:
 */
 class IntegrateExplictEuler {
 public:
-   void operator()( BodyID id, real_t dt, ICR & solver ) const
+   void operator()( BodyID id, pe_real_t dt, ICR & solver ) const
    {
       // Calculating the linear acceleration by the equation
       //   force * m^(-1) + gravity
@@ -85,7 +85,7 @@ public:
       const Vec3 phi( id->getAngularVel() * dt + 0.5 * wdot * dt * dt);
 
       // Calculating the new orientation
-      if (!floatIsEqual(phi.length(), 0))
+      if (!floatIsEqual(phi.length(), 0.0))
          id->rotate( Quat( phi, phi.length() ) );
       WALBERLA_ASSERT_FLOAT_EQUAL( id->getRotation().getDeterminant(), real_c(1 ), "Corrupted rotation matrix determinant" );
 
diff --git a/src/pe/cr/PlainIntegrator.h b/src/pe/cr/PlainIntegrator.h
index 271847f5d3d9b601452553d08d4a85bae8a4eb71..d05e2236904c2228424b6f9e5b7f060c6de892ac 100644
--- a/src/pe/cr/PlainIntegrator.h
+++ b/src/pe/cr/PlainIntegrator.h
@@ -50,9 +50,9 @@ public:
 
    /// forwards to timestep
    /// Convenience operator to make class a functor.
-   void operator()(const real_t dt) { timestep(dt); }
+   void operator()(const pe_real_t dt) { timestep(dt); }
    /// Advances the simulation dt seconds.
-   void timestep( const real_t dt );
+   void timestep( const pe_real_t dt );
 private:
    const Integrator                  integrate_;
    shared_ptr<BodyStorage>           globalBodyStorage_;
diff --git a/src/pe/cr/PlainIntegrator.impl.h b/src/pe/cr/PlainIntegrator.impl.h
index 7b9c4ce45101e774ed936da68e81caab088f1f95..1240fb5a0d87d1494de8542c5daea17f9175108a 100644
--- a/src/pe/cr/PlainIntegrator.impl.h
+++ b/src/pe/cr/PlainIntegrator.impl.h
@@ -55,7 +55,7 @@ PlainIntegratorSolver<Integrator>::PlainIntegratorSolver( const Integrator & int
 }
 
 template< typename Integrator >
-void PlainIntegratorSolver<Integrator>::timestep( const real_t dt )
+void PlainIntegratorSolver<Integrator>::timestep( const pe_real_t dt )
 {
    if (tt_!=NULL) tt_->start("PlainIntegrator");
    if (tt_!=NULL) tt_->start("Integrate Bodies");
diff --git a/src/pe/fcd/AnalyticCollisionDetection.h b/src/pe/fcd/AnalyticCollisionDetection.h
index 4777794366f6d6cd9eda691b45b187785ed1da01..ab7cbe654d1d487ba22179ec6990703e54a199f3 100644
--- a/src/pe/fcd/AnalyticCollisionDetection.h
+++ b/src/pe/fcd/AnalyticCollisionDetection.h
@@ -167,11 +167,11 @@ bool collide( SphereID s1, SphereID s2, Container& container )
    WALBERLA_ASSERT_UNEQUAL(s1->getSystemID(), s2->getSystemID(), "colliding with itself!\n" << s1 << "\n" << s2);
 
    Vec3 contactNormal = ( s1->getPosition() - s2->getPosition() );
-   real_t penetrationDepth = ( contactNormal.length() - s1->getRadius() - s2->getRadius() );
+   pe_real_t penetrationDepth = ( contactNormal.length() - s1->getRadius() - s2->getRadius() );
 
    if( penetrationDepth < contactThreshold ) {
       normalize(contactNormal);
-      const real_t k( s2->getRadius() + real_c(0.5) * penetrationDepth );
+      const pe_real_t k( s2->getRadius() + real_c(0.5) * penetrationDepth );
       Vec3 contactPoint = ( s2->getPosition() + contactNormal * k );
 
 //      if ((-penetrationDepth > s1->getRadius()) || (-penetrationDepth > s2->getRadius()))
@@ -195,8 +195,8 @@ template <typename Container>
 inline
 bool collide( SphereID s, PlaneID p, Container& container )
 {
-   const real_t k( p->getNormal() * s->getPosition() );
-   real_t penetrationDepth = ( k - s->getRadius() - p->getDisplacement() );
+   const pe_real_t k( p->getNormal() * s->getPosition() );
+   pe_real_t penetrationDepth = ( k - s->getRadius() - p->getDisplacement() );
 
    if( penetrationDepth < contactThreshold ) {
       Vec3 contactPoint = ( s->getPosition() - ( s->getRadius() + penetrationDepth ) * p->getNormal() );
@@ -239,7 +239,7 @@ inline
 bool collide( SphereID s, BoxID b, Container& container )
 {
    //WALBERLA_ABORT(s << b);
-   const Vec3 l( real_t(0.5)*b->getLengths() );  // Box half side lengths
+   const Vec3 l( pe_real_t(0.5)*b->getLengths() );  // Box half side lengths
    const Vec3& spos( s->getPosition() );       // Global position of the sphere
    const Vec3& bpos( b->getPosition() );       // Global position of the box
    const Mat3& R( b->getRotation() );          // Rotation of the box
@@ -271,11 +271,11 @@ bool collide( SphereID s, BoxID b, Container& container )
    // the closest face of the box is generated.
    if( !outside )
    {
-      real_t dist( std::fabs(p[0]) - l[0] );
+      pe_real_t dist( std::fabs(p[0]) - l[0] );
       size_t face( 0 );
 
       for( size_t i=1; i<3; ++i ) {
-         const real_t tmp( std::fabs(p[i]) - l[i] );
+         const pe_real_t tmp( std::fabs(p[i]) - l[i] );
          if( dist < tmp ) {
             dist = tmp;
             face = i;
@@ -302,7 +302,7 @@ bool collide( SphereID s, BoxID b, Container& container )
    const Vec3 q( R * p );  // Transformation from the projection to the global world frame
    const Vec3 n( d - q );  // Normal direction of the contact (pointing from the box to the sphere)
 
-   const real_t dist( n.length() - s->getRadius() );  // Distance between the sphere and the box
+   const pe_real_t dist( n.length() - s->getRadius() );  // Distance between the sphere and the box
 
    // Creating a single contact between the sphere and the box
    if( dist < contactThreshold )
@@ -350,7 +350,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
 
    WALBERLA_LOG_DETAIL( "      Fine collision detection between box " << b1->getID() << " and box " << b2->getID() );
 
-   real_t maxDepth( -Limits<real_t>::inf() );
+   pe_real_t maxDepth( -Limits<pe_real_t>::inf() );
    bool invertNormal( false );
    unsigned int contactCase( 0 );
    Vec3 contactNormal;
@@ -368,17 +368,17 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    const Vec3 b2_rPos( b1->getRotation().getTranspose() * ( b2->getPosition() - b1->getPosition() ) );
 
    // Calculating the half Lengths of both boxes
-   const real_t hl1[] = { real_t(0.5) * b1->getLengths()[0],
-                        real_t(0.5) * b1->getLengths()[1],
-                        real_t(0.5) * b1->getLengths()[2] };
-   const real_t hl2[] = { real_t(0.5) * b2->getLengths()[0],
-                        real_t(0.5) * b2->getLengths()[1],
-                        real_t(0.5) * b2->getLengths()[2] };
+   const pe_real_t hl1[] = { pe_real_t(0.5) * b1->getLengths()[0],
+                        pe_real_t(0.5) * b1->getLengths()[1],
+                        pe_real_t(0.5) * b1->getLengths()[2] };
+   const pe_real_t hl2[] = { pe_real_t(0.5) * b2->getLengths()[0],
+                        pe_real_t(0.5) * b2->getLengths()[1],
+                        pe_real_t(0.5) * b2->getLengths()[2] };
 
 
    //----- Testing the three axes of box 1 -----
 
-   real_t term1;
+   pe_real_t term1;
 
    // l = au
    term1 = std::fabs(b2_rPos[0]) - ( hl1[0] + hl2[0]*b2_rQ[0] + hl2[1]*b2_rQ[1] + hl2[2]*b2_rQ[2] );
@@ -391,7 +391,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
       maxDepth      = term1;
       contactNormal = Vec3( R1[0], R1[3], R1[6] );
       contactCase   = 1;
-      invertNormal  = ( b2_rPos[0] < real_t(0) );
+      invertNormal  = ( b2_rPos[0] < pe_real_t(0) );
 
       WALBERLA_LOG_DETAIL(
                 "         Contact test 1 succeeded!\n" <<
@@ -409,7 +409,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
       maxDepth      = term1;
       contactNormal = Vec3( R1[1], R1[4], R1[7] );
       contactCase   = 2;
-      invertNormal  = ( b2_rPos[1] < real_t(0) );
+      invertNormal  = ( b2_rPos[1] < pe_real_t(0) );
 
       WALBERLA_LOG_DETAIL(
                 "         Contact test 2 succeeded!\n" <<
@@ -427,7 +427,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
       maxDepth      = term1;
       contactNormal = Vec3( R1[2], R1[5], R1[8] );
       contactCase   = 3;
-      invertNormal  = ( b2_rPos[2] < real_t(0) );
+      invertNormal  = ( b2_rPos[2] < pe_real_t(0) );
 
       WALBERLA_LOG_DETAIL(
                 "         Contact test 3 succeeded!\n" <<
@@ -437,7 +437,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
 
    //----- Testing the three axes of box 2 -----
 
-   real_t term2;
+   pe_real_t term2;
 
    // l = bu
    term1 = b2_rPos[0]*b2_rR[0] + b2_rPos[1]*b2_rR[3] + b2_rPos[2]*b2_rR[6];
@@ -451,7 +451,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
       maxDepth      = term2;
       contactNormal = Vec3( R2[0], R2[3], R2[6] );
       contactCase   = 4;
-      invertNormal  = ( term1 < real_t(0) );
+      invertNormal  = ( term1 < pe_real_t(0) );
 
       WALBERLA_LOG_DETAIL(
                 "         Contact test 4 succeeded!\n" <<
@@ -470,7 +470,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
       maxDepth      = term2;
       contactNormal = Vec3( R2[1], R2[4], R2[7] );
       contactCase   = 5;
-      invertNormal  = ( term1 < real_t(0) );
+      invertNormal  = ( term1 < pe_real_t(0) );
 
       WALBERLA_LOG_DETAIL(
                 "         Contact test 5 succeeded!\n" <<
@@ -489,7 +489,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
       maxDepth      = term2;
       contactNormal = Vec3( R2[2], R2[5], R2[8] );
       contactCase   = 6;
-      invertNormal  = ( term1 < real_t(0) );
+      invertNormal  = ( term1 < pe_real_t(0) );
 
       WALBERLA_LOG_DETAIL(
                 "         Contact test 6 succeeded!\n" <<
@@ -499,9 +499,9 @@ bool collide( BoxID b1, BoxID b2, Container& container )
 
    //----- Testing the all nine combinations of the axes of the two boxes -----
 
-   real_t term3;
-   real_t sum;
-   real_t length;
+   pe_real_t term3;
+   pe_real_t sum;
+   pe_real_t length;
    Vec3 normal_c;
 
    // l = au x bu
@@ -516,13 +516,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[6]) + sq(b2_rR[3]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( 0, -b2_rR[6]/length, b2_rR[3]/length );
             contactCase  = 7;
-            invertNormal = ( term1 < real_t(0) );
+            invertNormal = ( term1 < pe_real_t(0) );
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 7 succeeded!\n" <<
@@ -543,13 +543,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[7]) + sq(b2_rR[4]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( 0, -b2_rR[7]/length, b2_rR[4]/length );
             contactCase  = 8;
-            invertNormal = ( term1 < real_t(0) );
+            invertNormal = ( term1 < pe_real_t(0) );
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 8 succeeded!\n" <<
@@ -570,13 +570,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[8]) + sq(b2_rR[5]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( 0, -b2_rR[8]/length, b2_rR[5]/length );
             contactCase  = 9;
-            invertNormal = ( term1 < real_t(0) );
+            invertNormal = ( term1 < pe_real_t(0) );
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 9 succeeded!\n" <<
@@ -597,13 +597,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[6]) + sq(b2_rR[0]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( b2_rR[6]/length, 0, -b2_rR[0]/length );
             contactCase  = 10;
-            invertNormal = ( term1 < real_t(0) ) ;
+            invertNormal = ( term1 < pe_real_t(0) ) ;
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 10 succeeded!\n" <<
@@ -624,13 +624,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[7]) + sq(b2_rR[1]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( b2_rR[7]/length, 0, -b2_rR[1]/length );
             contactCase  = 11;
-            invertNormal = ( term1 < real_t(0) );
+            invertNormal = ( term1 < pe_real_t(0) );
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 11 succeeded!\n" <<
@@ -651,13 +651,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[8]) + sq(b2_rR[2]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( b2_rR[8]/length, 0, -b2_rR[2]/length );
             contactCase  = 12;
-            invertNormal = ( term1 < real_t(0) );
+            invertNormal = ( term1 < pe_real_t(0) );
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 12 succeeded!\n" <<
@@ -678,13 +678,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[3]) + sq(b2_rR[0]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( -b2_rR[3]/length, b2_rR[0]/length, 0 );
             contactCase  = 13;
-            invertNormal = ( term1 < real_t(0) );
+            invertNormal = ( term1 < pe_real_t(0) );
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 13 succeeded!\n" <<
@@ -705,13 +705,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[4]) + sq(b2_rR[1]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( -b2_rR[4]/length, b2_rR[1]/length, 0 );
             contactCase  = 14;
-            invertNormal = ( term1 < real_t(0) );
+            invertNormal = ( term1 < pe_real_t(0) );
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 14 succeeded!\n" <<
@@ -732,13 +732,13 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    }
    else {
       length = std::sqrt( sq(b2_rR[5]) + sq(b2_rR[2]) );
-      if( length > Limits<real_t>::epsilon() ) {
+      if( length > Limits<pe_real_t>::epsilon() ) {
          sum /= length;
-         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<real_t>::accuracy() ) {
+         if( sum > maxDepth && std::fabs( sum - maxDepth ) > Limits<pe_real_t>::accuracy() ) {
             maxDepth     = sum;
             normal_c     = Vec3( -b2_rR[5]/length, b2_rR[2]/length, 0 );
             contactCase  = 15;
-            invertNormal = ( term1 < real_t(0) );
+            invertNormal = ( term1 < pe_real_t(0) );
 
             WALBERLA_LOG_DETAIL(
                       "         Contact test 15 succeeded!\n" <<
@@ -799,11 +799,11 @@ bool collide( BoxID b1, BoxID b2, Container& container )
          ub[i] = R2[(contactCase-7)%3 + i*3];
       }
 
-      real_t s, t;
+      pe_real_t s, t;
       geometry::intersectLines( pB1, ua, pB2, ub, s, t );
       pB1 += s * ua;
       pB2 += t * ub;
-      Vec3 gpos = real_t(0.5) * ( pB1 + pB2 );
+      Vec3 gpos = pe_real_t(0.5) * ( pB1 + pB2 );
       Vec3 normal = ( ua % ub ).getNormalized();
 
       WALBERLA_LOG_DETAIL(
@@ -823,7 +823,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
              << "            normal = " << normal << "\n\n" );
 
       // TEST
-      if( normal*contactNormal < real_t(0) ) {
+      if( normal*contactNormal < pe_real_t(0) ) {
          WALBERLA_LOG_DETAIL(
                    "         Inverting ub!\n"
                 << "         ua = " << ua << "\n"
@@ -844,8 +844,8 @@ bool collide( BoxID b1, BoxID b2, Container& container )
 
    WALBERLA_LOG_DETAIL( "         Treating vertex/face collision..." );
 
-   const real_t* hla( hl1 );
-   const real_t* hlb( hl2 );
+   const pe_real_t* hla( hl1 );
+   const pe_real_t* hlb( hl2 );
 
    if( contactCase > 3 ) {
       std::swap( b1, b2 );
@@ -919,19 +919,19 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    // Calculating the four vertices of the colliding face of box B in the frame of box B
    Vec3 vertexb[4];
 
-   vertexb[0][xb] = ( normalb[xb] > real_t(0) )?( -hlb[xb] ):( hlb[xb] );
+   vertexb[0][xb] = ( normalb[xb] > pe_real_t(0) )?( -hlb[xb] ):( hlb[xb] );
    vertexb[0][yb] = -hlb[yb];
    vertexb[0][zb] = -hlb[zb];
 
-   vertexb[1][xb] = ( normalb[xb] > real_t(0) )?( -hlb[xb] ):( hlb[xb] );
+   vertexb[1][xb] = ( normalb[xb] > pe_real_t(0) )?( -hlb[xb] ):( hlb[xb] );
    vertexb[1][yb] = hlb[yb];
    vertexb[1][zb] = -hlb[zb];
 
-   vertexb[2][xb] = ( normalb[xb] > real_t(0) )?( -hlb[xb] ):( hlb[xb] );
+   vertexb[2][xb] = ( normalb[xb] > pe_real_t(0) )?( -hlb[xb] ):( hlb[xb] );
    vertexb[2][yb] = -hlb[yb];
    vertexb[2][zb] = hlb[zb];
 
-   vertexb[3][xb] = ( normalb[xb] > real_t(0) )?( -hlb[xb] ):( hlb[xb] );
+   vertexb[3][xb] = ( normalb[xb] > pe_real_t(0) )?( -hlb[xb] ):( hlb[xb] );
    vertexb[3][yb] = hlb[yb];
    vertexb[3][zb] = hlb[zb];
 
@@ -947,8 +947,8 @@ bool collide( BoxID b1, BoxID b2, Container& container )
 
    //----- Calculating the line/line intersections between the two colliding faces -----
 
-   const real_t offseta( ( normala[xa] > real_t(0) )?( hla[xa] ):( -hla[xa] ) );
-   real_t s, dist, tmp;
+   const pe_real_t offseta( ( normala[xa] > pe_real_t(0) )?( hla[xa] ):( -hla[xa] ) );
+   pe_real_t s, dist, tmp;
 
    // Intersection between v0--v1 with hla[ya]
    if( ( vertexba[0][ya] > hla[ya] ) ^ ( vertexba[1][ya] > hla[ya] ) )
@@ -959,7 +959,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 1\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[0][za] + s*( vertexba[1][za] - vertexba[0][za] ) ) < hla[za] )
       {
          dist = std::fabs( vertexba[0][xa] + s*( vertexba[1][xa] - vertexba[0][xa] ) ) - hla[xa];
@@ -990,7 +990,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 2\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[0][za] + s*( vertexba[1][za] - vertexba[0][za] ) ) < hla[za] )
       {
          dist = std::fabs( vertexba[0][xa] + s*( vertexba[1][xa] - vertexba[0][xa] ) ) - hla[xa];
@@ -1021,7 +1021,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 3\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[0][ya] + s*( vertexba[1][ya] - vertexba[0][ya] ) ) < hla[ya] )
       {
          dist = std::fabs( vertexba[0][xa] + s*( vertexba[1][xa] - vertexba[0][xa] ) ) - hla[xa];
@@ -1052,7 +1052,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 4\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[0][ya] + s*( vertexba[1][ya] - vertexba[0][ya] ) ) < hla[ya] )
       {
          dist = std::fabs( vertexba[0][xa] + s*( vertexba[1][xa] - vertexba[0][xa] ) ) - hla[xa];
@@ -1084,7 +1084,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 5\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[0][za] + s*( vertexba[2][za] - vertexba[0][za] ) ) < hla[za] )
       {
          dist = std::fabs( vertexba[0][xa] + s*( vertexba[2][xa] - vertexba[0][xa] ) ) - hla[xa];
@@ -1115,7 +1115,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 6\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[0][za] + s*( vertexba[2][za] - vertexba[0][za] ) ) < hla[za] )
       {
          dist = std::fabs( vertexba[0][xa] + s*( vertexba[2][xa] - vertexba[0][xa] ) ) - hla[xa];
@@ -1146,7 +1146,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 7\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[0][ya] + s*( vertexba[2][ya] - vertexba[0][ya] ) ) < hla[ya] )
       {
          dist = std::fabs( vertexba[0][xa] + s*( vertexba[2][xa] - vertexba[0][xa] ) ) - hla[xa];
@@ -1177,7 +1177,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 8\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[0][ya] + s*( vertexba[2][ya] - vertexba[0][ya] ) ) < hla[ya] )
       {
          dist = std::fabs( vertexba[0][xa] + s*( vertexba[2][xa] - vertexba[0][xa] ) ) - hla[xa];
@@ -1209,7 +1209,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 9\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[3][za] + s*( vertexba[1][za] - vertexba[3][za] ) ) < hla[za] )
       {
          dist = std::fabs( vertexba[3][xa] + s*( vertexba[1][xa] - vertexba[3][xa] ) ) - hla[xa];
@@ -1240,7 +1240,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 10\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[3][za] + s*( vertexba[1][za] - vertexba[3][za] ) ) < hla[za] )
       {
          dist = std::fabs( vertexba[3][xa] + s*( vertexba[1][xa] - vertexba[3][xa] ) ) - hla[xa];
@@ -1271,7 +1271,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 11\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[3][ya] + s*( vertexba[1][ya] - vertexba[3][ya] ) ) < hla[ya] )
       {
          dist = std::fabs( vertexba[3][xa] + s*( vertexba[1][xa] - vertexba[3][xa] ) ) - hla[xa];
@@ -1302,7 +1302,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 12\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[3][ya] + s*( vertexba[1][ya] - vertexba[3][ya] ) ) < hla[ya] )
       {
          dist = std::fabs( vertexba[3][xa] + s*( vertexba[1][xa] - vertexba[3][xa] ) ) - hla[xa];
@@ -1334,7 +1334,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 13\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[3][za] + s*( vertexba[2][za] - vertexba[3][za] ) ) < hla[za] )
       {
          dist = std::fabs( vertexba[3][xa] + s*( vertexba[2][xa] - vertexba[3][xa] ) ) - hla[xa];
@@ -1365,7 +1365,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 14\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[3][za] + s*( vertexba[2][za] - vertexba[3][za] ) ) < hla[za] )
       {
          dist = std::fabs( vertexba[3][xa] + s*( vertexba[2][xa] - vertexba[3][xa] ) ) - hla[xa];
@@ -1396,7 +1396,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 15\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[3][ya] + s*( vertexba[2][ya] - vertexba[3][ya] ) ) < hla[ya] )
       {
          dist = std::fabs( vertexba[3][xa] + s*( vertexba[2][xa] - vertexba[3][xa] ) ) - hla[xa];
@@ -1427,7 +1427,7 @@ bool collide( BoxID b1, BoxID b2, Container& container )
                 "            Treating case 16\n" <<
                 "               s = " << s );
 
-      if( s > real_t(0) && s < real_t(1) &&
+      if( s > pe_real_t(0) && s < pe_real_t(1) &&
           std::fabs( tmp = vertexba[3][ya] + s*( vertexba[2][ya] - vertexba[3][ya] ) ) < hla[ya] )
       {
          dist = std::fabs( vertexba[3][xa] + s*( vertexba[2][xa] - vertexba[3][xa] ) ) - hla[xa];
@@ -1518,19 +1518,19 @@ bool collide( BoxID b1, BoxID b2, Container& container )
    // Calculating the four vertices of the colliding face of box B in the frame of box B
    Vec3 vertexa[4];
 
-   vertexa[0][xa] = ( normala[xa] > real_t(0) )?( hla[xa] ):( -hla[xa] );
+   vertexa[0][xa] = ( normala[xa] > pe_real_t(0) )?( hla[xa] ):( -hla[xa] );
    vertexa[0][ya] = -hla[ya];
    vertexa[0][za] = -hla[za];
 
-   vertexa[1][xa] = ( normala[xa] > real_t(0) )?( hla[xa] ):( -hla[xa] );
+   vertexa[1][xa] = ( normala[xa] > pe_real_t(0) )?( hla[xa] ):( -hla[xa] );
    vertexa[1][ya] = hla[ya];
    vertexa[1][za] = -hla[za];
 
-   vertexa[2][xa] = ( normala[xa] > real_t(0) )?( hla[xa] ):( -hla[xa] );
+   vertexa[2][xa] = ( normala[xa] > pe_real_t(0) )?( hla[xa] ):( -hla[xa] );
    vertexa[2][ya] = -hla[ya];
    vertexa[2][za] = hla[za];
 
-   vertexa[3][xa] = ( normala[xa] > real_t(0) )?( hla[xa] ):( -hla[xa] );
+   vertexa[3][xa] = ( normala[xa] > pe_real_t(0) )?( hla[xa] ):( -hla[xa] );
    vertexa[3][ya] = hla[ya];
    vertexa[3][za] = hla[za];
 
@@ -1631,16 +1631,16 @@ bool collide( BoxID b, PlaneID p, Container& container )
 {
    bool collision = false;
 
-   real_t dist, k;
+   pe_real_t dist, k;
    Vec3 pos;
    const Vec3& bpos( b->getPosition() );
    const Vec3& lengths( b->getLengths() );
    const Mat3& R( b->getRotation() );
-   const real_t xrange( static_cast<real_t>( 0.5 )*lengths[0] );
-   const real_t yrange( static_cast<real_t>( 0.5 )*lengths[1] );
-   const real_t zrange( static_cast<real_t>( 0.5 )*lengths[2] );
+   const pe_real_t xrange( static_cast<pe_real_t>( 0.5 )*lengths[0] );
+   const pe_real_t yrange( static_cast<pe_real_t>( 0.5 )*lengths[1] );
+   const pe_real_t zrange( static_cast<pe_real_t>( 0.5 )*lengths[2] );
    const Vec3 nrel( b->getRotation().getTranspose() * p->getNormal() );
-   const real_t minlength( -static_cast<real_t>( 0.99 ) * std::min( xrange, std::min(yrange, zrange) ) );
+   const pe_real_t minlength( -static_cast<pe_real_t>( 0.99 ) * std::min( xrange, std::min(yrange, zrange) ) );
 
    // Test of lower-left-front corner
    if( -xrange*nrel[0] - yrange*nrel[1] - zrange*nrel[2] < minlength )
@@ -1817,31 +1817,31 @@ bool collide( CapsuleID c1, CapsuleID c2, Container& container )
    const Vec3 c2_up_dir( R2[0], R2[3], R2[6] );
 
    // Calculating the displacement of the center of the upper cap-spheres in world space coordinates
-   const Vec3 c1_up( real_t(0.5) * c1->getLength() * c1_up_dir );
-   const Vec3 c2_up( real_t(0.5) * c2->getLength() * c2_up_dir );
+   const Vec3 c1_up( pe_real_t(0.5) * c1->getLength() * c1_up_dir );
+   const Vec3 c2_up( pe_real_t(0.5) * c2->getLength() * c2_up_dir );
 
    // calculate the closest points of the two center lines
    Vec3 cp1, cp2;
-   geometry::getClosestLineSegmentPoints( c1->getPosition()+c1_up, c1->getPosition()-c1_up,
-                                          c2->getPosition()+c2_up, c2->getPosition()-c2_up, cp1, cp2);
+   geometry::getClosestLineSegmentPoints<pe_real_t>( c1->getPosition()+c1_up, c1->getPosition()-c1_up,
+                                                     c2->getPosition()+c2_up, c2->getPosition()-c2_up, cp1, cp2);
 
    Vec3 normal( cp1 - cp2 );
-   const real_t dist( normal.length() - c1->getRadius() - c2->getRadius() );
+   const pe_real_t dist( normal.length() - c1->getRadius() - c2->getRadius() );
 
    if( dist < contactThreshold )
    {
       normalize(normal);
 
       // Calculating the relative x-position of the second capsule in the frame of the first capsule
-      const real_t c2x( c1_up_dir * ( c2->getPosition() - c1->getPosition() ) );
+      const pe_real_t c2x( c1_up_dir * ( c2->getPosition() - c1->getPosition() ) );
 
       // Creating two contact points if the capsules are parallel to each other
-      if ( floatIsEqual(std::fabs( c1_up_dir * c2_up_dir ), real_t(1) ) &&
+      if ( floatIsEqual(std::fabs( c1_up_dir * c2_up_dir ), pe_real_t(1) ) &&
           c2x > -c1->getLength() && c2x < c1->getLength() )
       {
-         const real_t k( c1->getRadius() + real_t(0.5) * dist );
-         const real_t hl1( real_t(0.5) * c1->getLength() );
-         const real_t hl2( real_t(0.5) * c2->getLength() );
+         const pe_real_t k( c1->getRadius() + pe_real_t(0.5) * dist );
+         const pe_real_t hl1( pe_real_t(0.5) * c1->getLength() );
+         const pe_real_t hl2( pe_real_t(0.5) * c2->getLength() );
 
          WALBERLA_LOG_DETAIL(
                    "      First contact created between capsule " << c1->getID()
@@ -1883,7 +1883,7 @@ bool collide( CapsuleID c1, CapsuleID c2, Container& container )
       // Creating a single contact point
       else
       {
-         const real_t k( c2->getRadius() + real_t(0.5) * dist );
+         const pe_real_t k( c2->getRadius() + pe_real_t(0.5) * dist );
          const Vec3 gPos( cp2 + normal * k );
 
          WALBERLA_LOG_DETAIL(
@@ -1922,13 +1922,13 @@ bool collide( CapsuleID c, PlaneID p, Container& container )
    const Mat3& R( c->getRotation() );
 
    // Computing the location of the sphere caps of the capsule
-   const Vec3 c_up ( real_t(0.5) * c->getLength() * Vec3( R[0], R[3], R[6] ) );
+   const Vec3 c_up ( pe_real_t(0.5) * c->getLength() * Vec3( R[0], R[3], R[6] ) );
    const Vec3 posUp( c->getPosition() + c_up );
    const Vec3 posDn( c->getPosition() - c_up );
 
    // Computing the distance between the sphere caps and the plane
-   const real_t distUp( posUp * p->getNormal() - p->getDisplacement() - c->getRadius() );
-   const real_t distDn( posDn * p->getNormal() - p->getDisplacement() - c->getRadius() );
+   const pe_real_t distUp( posUp * p->getNormal() - p->getDisplacement() - c->getRadius() );
+   const pe_real_t distDn( posDn * p->getNormal() - p->getDisplacement() - c->getRadius() );
 
    // Collision of the upper sphere with the plane
    if( distUp < contactThreshold )
@@ -1966,13 +1966,13 @@ template <typename Container>
 inline
 bool collide( SphereID s, CapsuleID c, Container& container )
 {
-   const real_t length( real_t(0.5)*c->getLength() );  // Half cylinder length
+   const pe_real_t length( pe_real_t(0.5)*c->getLength() );  // Half cylinder length
    const Vec3& spos( s->getPosition() );             // Global position of the sphere
    const Vec3& cpos( c->getPosition() );             // Global position of the capsule
    const Mat3& R( c->getRotation() );                // Rotation of the capsule
 
    // Calculating the relative x-position of the sphere in the frame of the capsule
-   real_t sx( R[0]*(spos[0]-cpos[0]) + R[3]*(spos[1]-cpos[1]) + R[6]*(spos[2]-cpos[2]) );
+   pe_real_t sx( R[0]*(spos[0]-cpos[0]) + R[3]*(spos[1]-cpos[1]) + R[6]*(spos[2]-cpos[2]) );
 
    // Calculation the center of the sphere representing the capsule
    if( sx > length ) {
@@ -1987,11 +1987,11 @@ bool collide( SphereID s, CapsuleID c, Container& container )
    // Performing a sphere-sphere collision between the colliding sphere and the
    // capsule representation
    Vec3 normal( spos - spos2 );
-   const real_t dist( normal.length() - s->getRadius() - c->getRadius() );
+   const pe_real_t dist( normal.length() - s->getRadius() - c->getRadius() );
 
    if( dist < contactThreshold ) {
       normal = normal.getNormalized();
-      const real_t k( c->getRadius() + real_t(0.5) * dist );
+      const pe_real_t k( c->getRadius() + pe_real_t(0.5) * dist );
       const Vec3 gPos( spos2 + normal * k );
 
       WALBERLA_LOG_DETAIL(
@@ -2022,9 +2022,9 @@ bool collide( BoxID b, CapsuleID c, Container& container )
    //----- Calculating the first contact point between the capsule and the box -----
 
    // Computing the displacement of the spherical caps of the capsule in world space coordinates
-   const Vec3 c_up( real_t(0.5)*c->getLength()*R[0],
-                    real_t(0.5)*c->getLength()*R[3],
-                    real_t(0.5)*c->getLength()*R[6] );
+   const Vec3 c_up( pe_real_t(0.5)*c->getLength()*R[0],
+                    pe_real_t(0.5)*c->getLength()*R[3],
+                    pe_real_t(0.5)*c->getLength()*R[6] );
 
    // Computing the centers of the spherical caps in world space coordinates
    const Vec3 up  ( c->getPosition()+c_up );
@@ -2035,14 +2035,14 @@ bool collide( BoxID b, CapsuleID c, Container& container )
    geometry::getClosestLineBoxPoints( up, down, b->getPosition(), b->getRotation(), b->getLengths(), cp1, bp1 );
 
    Vec3 normal1( bp1 - cp1 );
-   real_t dist1( normal1.length() - c->getRadius() );
+   pe_real_t dist1( normal1.length() - c->getRadius() );
 
    // Checking the distance between the capsule and the box
    if( dist1 > contactThreshold ) return false;
 
    // Calculating the contact normal and the position of the closest contact point
    normalize(normal1);
-   const Vec3 gpos1( bp1 - real_t(0.5)*dist1*normal1 );
+   const Vec3 gpos1( bp1 - pe_real_t(0.5)*dist1*normal1 );
 
    WALBERLA_LOG_DETAIL(
              "      Contact created between box " << b->getID() << " and capsule " << c->getID()
@@ -2060,11 +2060,11 @@ bool collide( BoxID b, CapsuleID c, Container& container )
    if( cp1 == cp2 ) return true;
 
    Vec3 normal2( bp2 - cp2 );
-   real_t dist2( normal2.length() - c->getRadius() );
+   pe_real_t dist2( normal2.length() - c->getRadius() );
 
    // Calculating the contact normal and the position of the closest contact point
    normalize(normal2);
-   const Vec3 gpos2( bp2 - real_t(0.5)*dist2*normal2 );
+   const Vec3 gpos2( bp2 - pe_real_t(0.5)*dist2*normal2 );
 
    WALBERLA_LOG_DETAIL(
              "      Contact created between box " << b->getID() << " and capsule " << c->getID()
diff --git a/src/pe/rigidbody/Box.cpp b/src/pe/rigidbody/Box.cpp
index 417af0f24293989aee22a9f84499cde30f8d8a6e..f7df6f345e082b32daa0ffc34c87940631216ded 100644
--- a/src/pe/rigidbody/Box.cpp
+++ b/src/pe/rigidbody/Box.cpp
@@ -65,9 +65,9 @@ Box::Box( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
    // Since the box constructor is never directly called but only used in a small number
    // of functions that already check the box arguments, only asserts are used here to
    // double check the arguments.
-   WALBERLA_ASSERT_GREATER( lengths[0], real_t(0), "Invalid side length in x-dimension" );
-   WALBERLA_ASSERT_GREATER( lengths[1], real_t(0), "Invalid side length in y-dimension" );
-   WALBERLA_ASSERT_GREATER( lengths[2], real_t(0), "Invalid side length in z-dimension" );
+   WALBERLA_ASSERT_GREATER( lengths[0], pe_real_t(0), "Invalid side length in x-dimension" );
+   WALBERLA_ASSERT_GREATER( lengths[1], pe_real_t(0), "Invalid side length in y-dimension" );
+   WALBERLA_ASSERT_GREATER( lengths[2], pe_real_t(0), "Invalid side length in z-dimension" );
 
    // Initializing the instantiated box
    gpos_   = gpos;
@@ -127,11 +127,11 @@ Box::~Box()
  * \param pz The z-component of the relative coordinate.
  * \return \a true if the point lies inside the box, \a false if not.
  */
-bool Box::containsRelPointImpl( real_t px, real_t py, real_t pz ) const
+bool Box::containsRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
-   return std::fabs(px) <= real_t(0.5)*lengths_[0] &&
-          std::fabs(py) <= real_t(0.5)*lengths_[1] &&
-          std::fabs(pz) <= real_t(0.5)*lengths_[2];
+   return std::fabs(px) <= pe_real_t(0.5)*lengths_[0] &&
+          std::fabs(py) <= pe_real_t(0.5)*lengths_[1] &&
+          std::fabs(pz) <= pe_real_t(0.5)*lengths_[2];
 }
 //*************************************************************************************************
 
@@ -146,24 +146,24 @@ bool Box::containsRelPointImpl( real_t px, real_t py, real_t pz ) const
  *
  * The tolerance level of the check is pe::surfaceThreshold.
  */
-bool Box::isSurfaceRelPointImpl( real_t px, real_t py, real_t pz ) const
+bool Box::isSurfaceRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    // Checking if the body relative point lies on one of the x-faces
-   if( std::fabs( real_t(0.5)*lengths_[0] - std::fabs(px) ) <= surfaceThreshold &&
-       std::fabs(py) < real_t(0.5)*lengths_[1] + surfaceThreshold &&
-       std::fabs(pz) < real_t(0.5)*lengths_[2] + surfaceThreshold ) {
+   if( std::fabs( pe_real_t(0.5)*lengths_[0] - std::fabs(px) ) <= surfaceThreshold &&
+       std::fabs(py) < pe_real_t(0.5)*lengths_[1] + surfaceThreshold &&
+       std::fabs(pz) < pe_real_t(0.5)*lengths_[2] + surfaceThreshold ) {
       return true;
    }
    // Checking if the body relative point lies on one of the y-faces
-   else if( std::fabs( real_t(0.5)*lengths_[1] - std::fabs(py) ) <= surfaceThreshold &&
-            std::fabs(pz) < real_t(0.5)*lengths_[2] + surfaceThreshold &&
-            std::fabs(px) < real_t(0.5)*lengths_[0] + surfaceThreshold ) {
+   else if( std::fabs( pe_real_t(0.5)*lengths_[1] - std::fabs(py) ) <= surfaceThreshold &&
+            std::fabs(pz) < pe_real_t(0.5)*lengths_[2] + surfaceThreshold &&
+            std::fabs(px) < pe_real_t(0.5)*lengths_[0] + surfaceThreshold ) {
       return true;
    }
    // Checking if the body relative point lies on one of the z-faces
-   else if( std::fabs( real_t(0.5)*lengths_[2] - std::fabs(pz) ) <= surfaceThreshold &&
-            std::fabs(px) < real_t(0.5)*lengths_[0] + surfaceThreshold &&
-            std::fabs(py) < real_t(0.5)*lengths_[1] + surfaceThreshold ) {
+   else if( std::fabs( pe_real_t(0.5)*lengths_[2] - std::fabs(pz) ) <= surfaceThreshold &&
+            std::fabs(px) < pe_real_t(0.5)*lengths_[0] + surfaceThreshold &&
+            std::fabs(py) < pe_real_t(0.5)*lengths_[1] + surfaceThreshold ) {
       return true;
    }
    else return false;
@@ -182,32 +182,32 @@ bool Box::isSurfaceRelPointImpl( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies inside the box and a negative value, if the point
  * lies outside the box. The returned depth is calculated relative to the closest side of the box.
  */
-real_t Box::getRelDepth( real_t px, real_t py, real_t pz ) const
+pe_real_t Box::getRelDepth( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
-   const real_t xdepth( std::fabs(px)-real_t(0.5)*lengths_[0] );
-   const real_t ydepth( std::fabs(py)-real_t(0.5)*lengths_[1] );
-   const real_t zdepth( std::fabs(pz)-real_t(0.5)*lengths_[2] );
+   const pe_real_t xdepth( std::fabs(px)-pe_real_t(0.5)*lengths_[0] );
+   const pe_real_t ydepth( std::fabs(py)-pe_real_t(0.5)*lengths_[1] );
+   const pe_real_t zdepth( std::fabs(pz)-pe_real_t(0.5)*lengths_[2] );
 
    // Calculating the depth for relative points outside the box
-   if( xdepth >= real_t(0) ) {
-      if( ydepth >= real_t(0) ) {
-         if( zdepth >= real_t(0) ) {
+   if( xdepth >= pe_real_t(0) ) {
+      if( ydepth >= pe_real_t(0) ) {
+         if( zdepth >= pe_real_t(0) ) {
             return -std::sqrt( math::sq(xdepth) + math::sq(ydepth) + math::sq(zdepth) );
          }
          else return -std::sqrt( math::sq(xdepth) + math::sq(ydepth) );
       }
-      else if( zdepth >= real_t(0) ) {
+      else if( zdepth >= pe_real_t(0) ) {
          return -std::sqrt( math::sq(xdepth) + math::sq(zdepth) );
       }
       else return -xdepth;
    }
-   else if( ydepth >= real_t(0) ) {
-      if( zdepth >= real_t(0) ) {
+   else if( ydepth >= pe_real_t(0) ) {
+      if( zdepth >= pe_real_t(0) ) {
          return -std::sqrt( math::sq(ydepth) + math::sq(zdepth) );
       }
       else return -ydepth;
    }
-   else if( zdepth >= real_t(0) ) {
+   else if( zdepth >= pe_real_t(0) ) {
       return -zdepth;
    }
 
@@ -227,7 +227,7 @@ real_t Box::getRelDepth( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies inside the box and a negative value, if the point
  * lies outside the box. The returned depth is calculated relative to the closest side of the box.
  */
-real_t Box::getRelDepth( const Vec3& rpos ) const
+pe_real_t Box::getRelDepth( const Vec3& rpos ) const
 {
    return getRelDepth(rpos[0], rpos[1], rpos[2]);
 }
@@ -303,10 +303,10 @@ void Box::calcBoundingBox()
 {
    using std::fabs;
 
-   const real_t xlength( real_t(0.5) * ( fabs(R_[0]*lengths_[0]) + fabs(R_[1]*lengths_[1]) + fabs(R_[2]*lengths_[2]) ) + contactThreshold );
-   const real_t ylength( real_t(0.5) * ( fabs(R_[3]*lengths_[0]) + fabs(R_[4]*lengths_[1]) + fabs(R_[5]*lengths_[2]) ) + contactThreshold );
-   const real_t zlength( real_t(0.5) * ( fabs(R_[6]*lengths_[0]) + fabs(R_[7]*lengths_[1]) + fabs(R_[8]*lengths_[2]) ) + contactThreshold );
-   aabb_ = math::AABB(
+   const pe_real_t xlength( pe_real_t(0.5) * ( fabs(R_[0]*lengths_[0]) + fabs(R_[1]*lengths_[1]) + fabs(R_[2]*lengths_[2]) ) + contactThreshold );
+   const pe_real_t ylength( pe_real_t(0.5) * ( fabs(R_[3]*lengths_[0]) + fabs(R_[4]*lengths_[1]) + fabs(R_[5]*lengths_[2]) ) + contactThreshold );
+   const pe_real_t zlength( pe_real_t(0.5) * ( fabs(R_[6]*lengths_[0]) + fabs(R_[7]*lengths_[1]) + fabs(R_[8]*lengths_[2]) ) + contactThreshold );
+   aabb_ = AABB(
          gpos_[0] - xlength,
          gpos_[1] - ylength,
          gpos_[2] - zlength,
@@ -328,9 +328,9 @@ void Box::calcBoundingBox()
  */
 void Box::calcInertia()
 {
-   I_[0] = mass_/static_cast<real_t>( 12 ) * ( lengths_[1]*lengths_[1] + lengths_[2]*lengths_[2] );
-   I_[4] = mass_/static_cast<real_t>( 12 ) * ( lengths_[0]*lengths_[0] + lengths_[2]*lengths_[2] );
-   I_[8] = mass_/static_cast<real_t>( 12 ) * ( lengths_[0]*lengths_[0] + lengths_[1]*lengths_[1] );
+   I_[0] = mass_/static_cast<pe_real_t>( 12 ) * ( lengths_[1]*lengths_[1] + lengths_[2]*lengths_[2] );
+   I_[4] = mass_/static_cast<pe_real_t>( 12 ) * ( lengths_[0]*lengths_[0] + lengths_[2]*lengths_[2] );
+   I_[8] = mass_/static_cast<pe_real_t>( 12 ) * ( lengths_[0]*lengths_[0] + lengths_[1]*lengths_[1] );
    Iinv_ = I_.getInverse();
 }
 //*************************************************************************************************
diff --git a/src/pe/rigidbody/Box.h b/src/pe/rigidbody/Box.h
index 427c5ea2a9aa79e6c32866779b4315056171fd88..2ccd247867e4388d6072fdd03a7df5038ab8900c 100644
--- a/src/pe/rigidbody/Box.h
+++ b/src/pe/rigidbody/Box.h
@@ -89,26 +89,26 @@ public:
    //**Volume, mass and density functions**********************************************************
    /*!\name Volume, mass and density functions */
    //@{
-   static inline real_t calcVolume( real_t x, real_t y, real_t z );
-   static inline real_t calcVolume( const Vec3& l );
-   static inline real_t calcMass( real_t x, real_t y, real_t z, real_t density );
-   static inline real_t calcMass( const Vec3& l, real_t density );
-   static inline real_t calcDensity( real_t x, real_t y, real_t z, real_t mass );
-   static inline real_t calcDensity( const Vec3& l, real_t mass );
+   static inline pe_real_t calcVolume( pe_real_t x, pe_real_t y, pe_real_t z );
+   static inline pe_real_t calcVolume( const Vec3& l );
+   static inline pe_real_t calcMass( pe_real_t x, pe_real_t y, pe_real_t z, pe_real_t density );
+   static inline pe_real_t calcMass( const Vec3& l, pe_real_t density );
+   static inline pe_real_t calcDensity( pe_real_t x, pe_real_t y, pe_real_t z, pe_real_t mass );
+   static inline pe_real_t calcDensity( const Vec3& l, pe_real_t mass );
    //@}
    //**********************************************************************************************
 
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-          real_t getRelDepth   ( real_t px, real_t py, real_t pz ) const;
-          real_t getRelDepth   ( const Vec3& rpos )          const;
-   inline real_t getDepth      ( real_t px, real_t py, real_t pz ) const;
-   inline real_t getDepth      ( const Vec3& gpos )          const;
-   inline real_t getRelDistance( real_t px, real_t py, real_t pz ) const;
-   inline real_t getRelDistance( const Vec3& rpos )          const;
-   inline real_t getDistance   ( real_t px, real_t py, real_t pz ) const;
-   inline real_t getDistance   ( const Vec3& gpos )          const;
+          pe_real_t getRelDepth   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+          pe_real_t getRelDepth   ( const Vec3& rpos )          const;
+   inline pe_real_t getDepth      ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getDepth      ( const Vec3& gpos )          const;
+   inline pe_real_t getRelDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getRelDistance( const Vec3& rpos )          const;
+   inline pe_real_t getDistance   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getDistance   ( const Vec3& gpos )          const;
 
    static inline id_t getStaticTypeID();
    //@}
@@ -133,8 +133,8 @@ protected:
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-   virtual bool containsRelPointImpl ( real_t px, real_t py, real_t pz ) const;
-   virtual bool isSurfaceRelPointImpl( real_t px, real_t py, real_t pz ) const;
+   virtual bool containsRelPointImpl ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   virtual bool isSurfaceRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    //@}
    //**********************************************************************************************
 
@@ -185,7 +185,7 @@ private:
  * Returns a positive value, if the point lies inside the box and a negative value, if the point
  * lies outside the box. The returned depth is calculated relative to the closest side of the box.
  */
-inline real_t Box::getDepth( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Box::getDepth( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return getRelDepth( pointFromWFtoBF( px, py, pz ) );
 }
@@ -201,7 +201,7 @@ inline real_t Box::getDepth( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies inside the box and a negative value, if the point
  * lies outside the box. The returned depth is calculated relative to the closest side of the box.
  */
-inline real_t Box::getDepth( const Vec3& gpos ) const
+inline pe_real_t Box::getDepth( const Vec3& gpos ) const
 {
    return getDepth( gpos[0], gpos[1], gpos[2] );
 }
@@ -220,7 +220,7 @@ inline real_t Box::getDepth( const Vec3& gpos ) const
  * point lies inside the box. The returned distance is calculated relative to the closest
  * side of the box.
  */
-inline real_t Box::getRelDistance( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Box::getRelDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return -getRelDepth( px, py, pz );
 }
@@ -237,7 +237,7 @@ inline real_t Box::getRelDistance( real_t px, real_t py, real_t pz ) const
  * point lies inside the box. The returned distance is calculated relative to the closest
  * side of the box.
  */
-inline real_t Box::getRelDistance( const Vec3& rpos ) const
+inline pe_real_t Box::getRelDistance( const Vec3& rpos ) const
 {
    return getRelDistance( rpos[0], rpos[1], rpos[2] );
 }
@@ -256,7 +256,7 @@ inline real_t Box::getRelDistance( const Vec3& rpos ) const
  * point lies inside the box. The returned distance is calculated relative to the closest
  * side of the box.
  */
-inline real_t Box::getDistance( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Box::getDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return -getRelDepth( pointFromWFtoBF( px, py, pz ) );
 }
@@ -273,7 +273,7 @@ inline real_t Box::getDistance( real_t px, real_t py, real_t pz ) const
  * point lies inside the box. The returned distance is calculated relative to the closest
  * side of the box.
  */
-inline real_t Box::getDistance( const Vec3& gpos ) const
+inline pe_real_t Box::getDistance( const Vec3& gpos ) const
 {
    return getDistance( gpos[0], gpos[1], gpos[2] );
 }
@@ -323,7 +323,7 @@ inline const Vec3& Box::getLengths() const
  * \param z The z-length of the box.
  * \return The volume of the box.
  */
-inline real_t Box::calcVolume( real_t x, real_t y, real_t z )
+inline pe_real_t Box::calcVolume( pe_real_t x, pe_real_t y, pe_real_t z )
 {
    return x * y * z;
 }
@@ -336,7 +336,7 @@ inline real_t Box::calcVolume( real_t x, real_t y, real_t z )
  * \param l The side lengths of the box.
  * \return The volume of the box.
  */
-inline real_t Box::calcVolume( const Vec3& l )
+inline pe_real_t Box::calcVolume( const Vec3& l )
 {
    return calcVolume(l[0], l[1], l[2]);
 }
@@ -352,7 +352,7 @@ inline real_t Box::calcVolume( const Vec3& l )
  * \param density The density of the box.
  * \return The total mass of the box.
  */
-inline real_t Box::calcMass( real_t x, real_t y, real_t z, real_t density )
+inline pe_real_t Box::calcMass( pe_real_t x, pe_real_t y, pe_real_t z, pe_real_t density )
 {
    return x * y * z * density;
 }
@@ -366,7 +366,7 @@ inline real_t Box::calcMass( real_t x, real_t y, real_t z, real_t density )
  * \param density The density of the box.
  * \return The total mass of the box.
  */
-inline real_t Box::calcMass( const Vec3& l, real_t density )
+inline pe_real_t Box::calcMass( const Vec3& l, pe_real_t density )
 {
    return calcMass(l[0], l[1], l[2], density);
 }
@@ -382,7 +382,7 @@ inline real_t Box::calcMass( const Vec3& l, real_t density )
  * \param mass The total mass of the box.
  * \return The density of the box.
  */
-inline real_t Box::calcDensity( real_t x, real_t y, real_t z, real_t mass )
+inline pe_real_t Box::calcDensity( pe_real_t x, pe_real_t y, pe_real_t z, pe_real_t mass )
 {
    return mass / ( x * y * z );
 }
@@ -396,7 +396,7 @@ inline real_t Box::calcDensity( real_t x, real_t y, real_t z, real_t mass )
  * \param mass The total mass of the box.
  * \return The density of the box.
  */
-inline real_t Box::calcDensity( const Vec3& l, real_t mass )
+inline pe_real_t Box::calcDensity( const Vec3& l, pe_real_t mass )
 {
    return mass / ( l[0] * l[1] * l[2] );
 }
@@ -412,7 +412,7 @@ inline real_t Box::calcDensity( const Vec3& l, real_t mass )
 inline Vec3 Box::support( const Vec3& d ) const
 {
    auto len = d.sqrLength();
-   if (math::equal(len, real_t(0)))
+   if (math::equal(len, pe_real_t(0)))
       return Vec3(0,0,0);
 
    const Vec3 bfD = vectorFromWFtoBF(d / sqrt(len)); //d in body frame coordinates
@@ -426,9 +426,9 @@ inline Vec3 Box::support( const Vec3& d ) const
    */
 
    //As it is save to say we have atleast one component of the d-vector != 0 we can use
-   Vec3 relativSupport = Vec3( math::sign(bfD[0])*lengths_[0]*real_t(0.5),
-                               math::sign(bfD[1])*lengths_[1]*real_t(0.5),
-                               math::sign(bfD[2])*lengths_[2]*real_t(0.5) );
+   Vec3 relativSupport = Vec3( math::sign(bfD[0])*lengths_[0]*pe_real_t(0.5),
+                               math::sign(bfD[1])*lengths_[1]*pe_real_t(0.5),
+                               math::sign(bfD[2])*lengths_[2]*pe_real_t(0.5) );
 
    return gpos_ + vectorFromBFtoWF(relativSupport);
 }
@@ -445,7 +445,7 @@ inline Vec3 Box::support( const Vec3& d ) const
 inline Vec3 Box::supportContactThreshold( const Vec3& d ) const
 {
    auto len = d.sqrLength();
-   if (math::equal(len, real_t(0)))
+   if (math::equal(len, pe_real_t(0)))
       return Vec3(0,0,0);
 
    return support(d) + d*contactThreshold / sqrt(len);
diff --git a/src/pe/rigidbody/BoxFactory.cpp b/src/pe/rigidbody/BoxFactory.cpp
index 6473eaa18e60f971b71d31614cdd3cb13b82889e..d641f16a48e6df4fe3b2ac89d0091c5fa5cb4a09 100644
--- a/src/pe/rigidbody/BoxFactory.cpp
+++ b/src/pe/rigidbody/BoxFactory.cpp
@@ -37,7 +37,7 @@ BoxID createBox(       BodyStorage& globalStorage, BlockStorage& blocks, BlockDa
    WALBERLA_ASSERT_UNEQUAL( Box::getStaticTypeID(), std::numeric_limits<id_t>::max(), "Box TypeID not initalized!");
 
    // Checking the side lengths
-   if( lengths[0] <= real_t(0) || lengths[1] <= real_t(0) || lengths[2] <= real_t(0) )
+   if( lengths[0] <= pe_real_t(0) || lengths[1] <= pe_real_t(0) || lengths[2] <= pe_real_t(0) )
       throw std::invalid_argument( "Invalid side length" );
 
    BoxID box = NULL;
diff --git a/src/pe/rigidbody/Capsule.cpp b/src/pe/rigidbody/Capsule.cpp
index 0a99487ef92f44a3b7b25134765727dfc994d501..a870a80bdd99b5fee47b7ee1c920fc6546cb0065 100644
--- a/src/pe/rigidbody/Capsule.cpp
+++ b/src/pe/rigidbody/Capsule.cpp
@@ -56,7 +56,7 @@ namespace pe {
  * The capsule is created lying along the x-axis.
  */
 Capsule::Capsule( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
-                  real_t  radius, real_t  length, MaterialID material,
+                  pe_real_t  radius, pe_real_t  length, MaterialID material,
                   const bool global, const bool communicating, const bool infiniteMass )
    : GeomPrimitive( getStaticTypeID(), sid, uid, material )           // Initializing the base object
    , radius_(radius)                                                  // Radius of the capsule
@@ -66,8 +66,8 @@ Capsule::Capsule( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const
    // Since the capsule constructor is never directly called but only used in a small number
    // of functions that already check the capsule arguments, only asserts are used here to
    // double check the arguments.
-   WALBERLA_ASSERT_GREATER( radius, real_t(0), "Invalid capsule radius"  );
-   WALBERLA_ASSERT_GREATER( length, real_t(0), "Invalid capsule length"  );
+   WALBERLA_ASSERT_GREATER( radius, pe_real_t(0), "Invalid capsule radius"  );
+   WALBERLA_ASSERT_GREATER( length, pe_real_t(0), "Invalid capsule length"  );
 
    // Initializing the instantiated capsule
    gpos_   = gpos;
@@ -76,8 +76,8 @@ Capsule::Capsule( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const
    R_      = q_.toRotationMatrix();  // Setting the rotation matrix
 
    // Calculating the capsule mass
-   mass_ = radius*radius * math::M_PI * ( real_t(4)/real_t(3) * radius + length ) * Material::getDensity( material );
-   invMass_ = real_t(1) / mass_;
+   mass_ = radius*radius * math::M_PI * ( pe_real_t(4)/pe_real_t(3) * radius + length ) * Material::getDensity( material );
+   invMass_ = pe_real_t(1) / mass_;
 
    // Calculating the moment of inertia
    calcInertia();
@@ -121,10 +121,10 @@ Capsule::~Capsule()
  * \param pz The z-component of the relative coordinate.
  * \return \a true if the point lies inside the capsule, \a false if not.
  */
-bool Capsule::containsRelPointImpl( real_t px, real_t py, real_t pz ) const
+bool Capsule::containsRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
-   const real_t xabs( std::fabs( px ) );         // Absolute x-distance
-   const real_t hlength( real_t(0.5) * length_ );  // Capsule half length
+   const pe_real_t xabs( std::fabs( px ) );         // Absolute x-distance
+   const pe_real_t hlength( pe_real_t(0.5) * length_ );  // Capsule half length
 
    if( xabs > hlength ) {
       return ( ( math::sq(xabs-hlength) + math::sq(py) + math::sq(pz) ) <= ( radius_ * radius_ ) );
@@ -145,10 +145,10 @@ bool Capsule::containsRelPointImpl( real_t px, real_t py, real_t pz ) const
  *
  * The tolerance level of the check is pe::surfaceThreshold.
  */
-bool Capsule::isSurfaceRelPointImpl( real_t px, real_t py, real_t  pz ) const
+bool Capsule::isSurfaceRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t  pz ) const
 {
-   const real_t  xabs( std::fabs( px ) );         // Absolute x-distance
-   const real_t  hlength( real_t(0.5) * length_ );  // Capsule half length
+   const pe_real_t  xabs( std::fabs( px ) );         // Absolute x-distance
+   const pe_real_t  hlength( pe_real_t(0.5) * length_ );  // Capsule half length
 
    if( xabs > hlength ) {
       return ( std::fabs( math::sq(xabs-hlength) + math::sq(py) + math::sq(pz) - radius_*radius_ ) <= surfaceThreshold*surfaceThreshold );
@@ -171,10 +171,10 @@ bool Capsule::isSurfaceRelPointImpl( real_t px, real_t py, real_t  pz ) const
  */
 void Capsule::calcBoundingBox()
 {
-   const real_t  xlength( std::fabs( R_[0]*length_ )*real_t (0.5) + radius_ + contactThreshold );
-   const real_t  ylength( std::fabs( R_[3]*length_ )*real_t (0.5) + radius_ + contactThreshold );
-   const real_t  zlength( std::fabs( R_[6]*length_ )*real_t (0.5) + radius_ + contactThreshold );
-   aabb_ = math::AABB(
+   const pe_real_t  xlength( std::fabs( R_[0]*length_ )*pe_real_t (0.5) + radius_ + contactThreshold );
+   const pe_real_t  ylength( std::fabs( R_[3]*length_ )*pe_real_t (0.5) + radius_ + contactThreshold );
+   const pe_real_t  zlength( std::fabs( R_[6]*length_ )*pe_real_t (0.5) + radius_ + contactThreshold );
+   aabb_ = AABB(
             gpos_[0] - xlength,
          gpos_[1] - ylength,
          gpos_[2] - zlength,
@@ -194,21 +194,21 @@ void Capsule::calcBoundingBox()
  */
 void Capsule::calcInertia()
 {
-   const real_t  density( calcDensity( radius_, length_, mass_ ) );
-   const real_t  sphereMass( real_t (4)/real_t (3) * math::M_PI * radius_*radius_*radius_ * density );
-   const real_t  cylinderMass( math::M_PI * radius_*radius_ * length_ * density );
+   const pe_real_t  density( calcDensity( radius_, length_, mass_ ) );
+   const pe_real_t  sphereMass( pe_real_t (4)/pe_real_t (3) * math::M_PI * radius_*radius_*radius_ * density );
+   const pe_real_t  cylinderMass( math::M_PI * radius_*radius_ * length_ * density );
 
    // 'Ia' represent the moment of inertia along the x-axis. 'Ia' contains the following two parts:
    //  - cylinder :  I = (1/2)*mass*radius^2
    //  - sphere   :  I = (2/5)*mass*radius^2
-   const real_t  Ia( radius_*radius_ * ( real_t (0.5)*cylinderMass + real_t (0.4)*sphereMass ) );
+   const pe_real_t  Ia( radius_*radius_ * ( pe_real_t (0.5)*cylinderMass + pe_real_t (0.4)*sphereMass ) );
 
    // 'Ib' represent the moment of inertia along the y- and z-axis. 'Ib' contains the following two parts,
    // where full_length is the full length of the cylinder part and half_length is (1/2)*full_length:
    //  - cylinder :  I = mass*( (1/4)*radius^2 + (1/12)*full_length^2 )
    //  - sphere   :  I = mass*( (2/5)*radius^2 + half_length^2 + (3/4)*half_length*radius )
-   const real_t  Ib( cylinderMass*( real_t (0.25)*radius_*radius_ + real_t (1)/real_t (12)*length_*length_ ) +
-                     sphereMass*( real_t (0.4)*radius_*radius_ + real_t (0.375)*radius_*length_ + real_t (0.25)*length_*length_ ) );
+   const pe_real_t  Ib( cylinderMass*( pe_real_t (0.25)*radius_*radius_ + pe_real_t (1)/pe_real_t (12)*length_*length_ ) +
+                     sphereMass*( pe_real_t (0.4)*radius_*radius_ + pe_real_t (0.375)*radius_*length_ + pe_real_t (0.25)*length_*length_ ) );
 
    // Setting the moment of inertia (capsule is aligned along the x-axis)
    I_[0] = Ia;
diff --git a/src/pe/rigidbody/Capsule.h b/src/pe/rigidbody/Capsule.h
index 3be8e04530f9b725e2831de746ba8c1875143b98..f27edf7d451269dd34be1894d2322bce078ecf35 100644
--- a/src/pe/rigidbody/Capsule.h
+++ b/src/pe/rigidbody/Capsule.h
@@ -71,7 +71,7 @@ public:
    /*!\name Constructors */
    //@{
    explicit Capsule( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
-                     real_t  radius, real_t  length, MaterialID material,
+                     pe_real_t  radius, pe_real_t  length, MaterialID material,
                      const bool global, const bool communicating, const bool infiniteMass );
    //@}
    //**********************************************************************************************
@@ -87,8 +87,8 @@ public:
    //**Get functions*******************************************************************************
    /*!\name Get functions */
    //@{
-   inline real_t  getRadius() const;
-   inline real_t  getLength() const;
+   inline pe_real_t  getRadius() const;
+   inline pe_real_t  getLength() const;
    //@}
    //**********************************************************************************************
 
@@ -103,23 +103,23 @@ public:
    //**Volume, mass and density functions**********************************************************
    /*!\name Volume, mass and density functions */
    //@{
-   static inline real_t  calcVolume( real_t  radius, real_t  length );
-   static inline real_t  calcMass( real_t  radius, real_t  length, real_t  density );
-   static inline real_t  calcDensity( real_t  radius, real_t  length, real_t  mass );
+   static inline pe_real_t  calcVolume( pe_real_t  radius, pe_real_t  length );
+   static inline pe_real_t  calcMass( pe_real_t  radius, pe_real_t  length, pe_real_t  density );
+   static inline pe_real_t  calcDensity( pe_real_t  radius, pe_real_t  length, pe_real_t  mass );
    //@}
    //**********************************************************************************************
 
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-   inline real_t  getRelDepth   ( real_t  px, real_t  py, real_t  pz ) const;
-   inline real_t  getRelDepth   ( const Vec3& rpos )          const;
-   inline real_t  getDepth      ( real_t  px, real_t  py, real_t  pz ) const;
-   inline real_t  getDepth      ( const Vec3& gpos )          const;
-   inline real_t  getRelDistance( real_t  px, real_t  py, real_t  pz ) const;
-   inline real_t  getRelDistance( const Vec3& rpos )          const;
-   inline real_t  getDistance   ( real_t  px, real_t  py, real_t  pz ) const;
-   inline real_t  getDistance   ( const Vec3& gpos )          const;
+   inline pe_real_t  getRelDepth   ( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const;
+   inline pe_real_t  getRelDepth   ( const Vec3& rpos )          const;
+   inline pe_real_t  getDepth      ( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const;
+   inline pe_real_t  getDepth      ( const Vec3& gpos )          const;
+   inline pe_real_t  getRelDistance( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const;
+   inline pe_real_t  getRelDistance( const Vec3& rpos )          const;
+   inline pe_real_t  getDistance   ( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const;
+   inline pe_real_t  getDistance   ( const Vec3& gpos )          const;
    static inline id_t getStaticTypeID();
    //@}
    //**********************************************************************************************
@@ -132,8 +132,8 @@ public:
    //**********************************************************************************************
 
 protected:
-   virtual bool containsRelPointImpl ( real_t  px, real_t  py, real_t  pz ) const;
-   virtual bool isSurfaceRelPointImpl( real_t  px, real_t  py, real_t  pz ) const;
+   virtual bool containsRelPointImpl ( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const;
+   virtual bool isSurfaceRelPointImpl( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const;
 
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
@@ -146,8 +146,8 @@ protected:
    //**Member variables****************************************************************************
    /*!\name Member variables */
    //@{
-   real_t  radius_;  //!< The radius of the cylinder part and the caps on both ends of the cylinder.
-   real_t  length_;  //!< The length of the cylinder part.
+   pe_real_t  radius_;  //!< The radius of the cylinder part and the caps on both ends of the cylinder.
+   pe_real_t  length_;  //!< The length of the cylinder part.
    //@}
    //**********************************************************************************************
 
@@ -175,7 +175,7 @@ private:
  *
  * \return The radius of the capsule.
  */
-inline real_t  Capsule::getRadius() const
+inline pe_real_t  Capsule::getRadius() const
 {
    return radius_;
 }
@@ -187,7 +187,7 @@ inline real_t  Capsule::getRadius() const
  *
  * \return The length of the cylinder part.
  */
-inline real_t  Capsule::getLength() const
+inline pe_real_t  Capsule::getLength() const
 {
    return length_;
 }
@@ -209,9 +209,9 @@ inline real_t  Capsule::getLength() const
  * \param length The length of the cylinder part.
  * \return The volume of the capsule.
  */
-inline real_t  Capsule::calcVolume( real_t  radius, real_t  length )
+inline pe_real_t  Capsule::calcVolume( pe_real_t  radius, pe_real_t  length )
 {
-   return math::M_PI*radius*radius*( ( static_cast<real_t >( 4 ) / static_cast<real_t >( 3 ) )*radius + length );
+   return math::M_PI*radius*radius*( ( static_cast<pe_real_t >( 4 ) / static_cast<pe_real_t >( 3 ) )*radius + length );
 }
 //*************************************************************************************************
 
@@ -224,9 +224,9 @@ inline real_t  Capsule::calcVolume( real_t  radius, real_t  length )
  * \param density The density of the capsule.
  * \return The total mass of the capsule.
  */
-inline real_t  Capsule::calcMass( real_t  radius, real_t  length, real_t  density )
+inline pe_real_t  Capsule::calcMass( pe_real_t  radius, pe_real_t  length, pe_real_t  density )
 {
-   return math::M_PI*radius*radius*( ( static_cast<real_t >( 4 ) / static_cast<real_t >( 3 ) )*radius + length ) * density;
+   return math::M_PI*radius*radius*( ( static_cast<pe_real_t >( 4 ) / static_cast<pe_real_t >( 3 ) )*radius + length ) * density;
 }
 //*************************************************************************************************
 
@@ -239,9 +239,9 @@ inline real_t  Capsule::calcMass( real_t  radius, real_t  length, real_t  densit
  * \param mass The total mass of the capsule.
  * \return The density of the capsule.
  */
-inline real_t  Capsule::calcDensity( real_t  radius, real_t  length, real_t  mass )
+inline pe_real_t  Capsule::calcDensity( pe_real_t  radius, pe_real_t  length, pe_real_t  mass )
 {
-   return mass / ( math::M_PI*radius*radius*( ( static_cast<real_t >( 4 ) / static_cast<real_t >( 3 ) )*radius + length ) );
+   return mass / ( math::M_PI*radius*radius*( ( static_cast<pe_real_t >( 4 ) / static_cast<pe_real_t >( 3 ) )*radius + length ) );
 }
 //*************************************************************************************************
 
@@ -255,14 +255,14 @@ inline real_t  Capsule::calcDensity( real_t  radius, real_t  length, real_t  mas
 inline Vec3 Capsule::support( const Vec3& d ) const
 {
    auto len = d.sqrLength();
-   if (math::equal(len, real_t(0)))
+   if (math::equal(len, pe_real_t(0)))
       return Vec3(0,0,0);
 
    Vec3 dnorm = d / sqrt(len);
 
    const Vec3 bfD = vectorFromWFtoBF(dnorm); //d in body frame coordinates
 
-   const Vec3 supportSegment = Vec3( math::sign(bfD[0])*length_*real_t (0.5), real_t (0.0), real_t (0.0));
+   const Vec3 supportSegment = Vec3( math::sign(bfD[0])*length_*pe_real_t (0.5), pe_real_t (0.0), pe_real_t (0.0));
    const Vec3 supportSphere = radius_ * dnorm;
 
    return gpos_ + vectorFromBFtoWF(supportSegment) + supportSphere;
@@ -280,7 +280,7 @@ inline Vec3 Capsule::support( const Vec3& d ) const
 inline Vec3 Capsule::supportContactThreshold( const Vec3& d ) const
 {
    auto len = d.sqrLength();
-   if (math::equal(len, real_t(0)))
+   if (math::equal(len, pe_real_t(0)))
       return Vec3(0,0,0);
 
    return support(d) + d*contactThreshold;
@@ -307,10 +307,10 @@ inline Vec3 Capsule::supportContactThreshold( const Vec3& d ) const
  * Returns a positive value, if the point lies inside the capsule and a negative value,
  * if the point lies outside the capsule.
  */
-inline real_t  Capsule::getRelDepth( real_t  px, real_t  py, real_t  pz ) const
+inline pe_real_t  Capsule::getRelDepth( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const
 {
-   const real_t  xabs( std::fabs( px ) );         // Absolute x-distance
-   const real_t  hlength( real_t (0.5) * length_ );  // Capsule half length
+   const pe_real_t  xabs( std::fabs( px ) );         // Absolute x-distance
+   const pe_real_t  hlength( pe_real_t (0.5) * length_ );  // Capsule half length
 
    if( xabs > hlength ) {
       return ( radius_ - std::sqrt( math::sq(xabs-hlength) + math::sq(py) + math::sq(pz) ) );
@@ -331,7 +331,7 @@ inline real_t  Capsule::getRelDepth( real_t  px, real_t  py, real_t  pz ) const
  * Returns a positive value, if the point lies inside the capsule and a negative value,
  * if the point lies outside the capsule.
  */
-inline real_t  Capsule::getRelDepth( const Vec3& rpos ) const
+inline pe_real_t  Capsule::getRelDepth( const Vec3& rpos ) const
 {
    return getRelDepth( rpos[0], rpos[1], rpos[2] );
 }
@@ -349,7 +349,7 @@ inline real_t  Capsule::getRelDepth( const Vec3& rpos ) const
  * Returns a positive value, if the point lies inside the capsule and a negative value,
  * if the point lies outside the capsule.
  */
-inline real_t  Capsule::getDepth( real_t  px, real_t  py, real_t  pz ) const
+inline pe_real_t  Capsule::getDepth( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const
 {
    return getRelDepth( pointFromWFtoBF( px, py, pz ) );
 }
@@ -365,7 +365,7 @@ inline real_t  Capsule::getDepth( real_t  px, real_t  py, real_t  pz ) const
  * Returns a positive value, if the point lies inside the capsule and a negative value,
  * if the point lies outside the capsule.
  */
-inline real_t  Capsule::getDepth( const Vec3& gpos ) const
+inline pe_real_t  Capsule::getDepth( const Vec3& gpos ) const
 {
    return getRelDepth( pointFromWFtoBF( gpos ) );
 }
@@ -383,7 +383,7 @@ inline real_t  Capsule::getDepth( const Vec3& gpos ) const
  * Returns a positive value, if the point lies outside the capsule and a negative value,
  * if the point lies inside the capsule.
  */
-inline real_t  Capsule::getRelDistance( real_t  px, real_t  py, real_t  pz ) const
+inline pe_real_t  Capsule::getRelDistance( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const
 {
    return -getRelDepth( px, py, pz );
 }
@@ -399,7 +399,7 @@ inline real_t  Capsule::getRelDistance( real_t  px, real_t  py, real_t  pz ) con
  * Returns a positive value, if the point lies outside the capsule and a negative value,
  * if the point lies inside the capsule.
  */
-inline real_t  Capsule::getRelDistance( const Vec3& rpos ) const
+inline pe_real_t  Capsule::getRelDistance( const Vec3& rpos ) const
 {
    return -getRelDepth( rpos );
 }
@@ -417,7 +417,7 @@ inline real_t  Capsule::getRelDistance( const Vec3& rpos ) const
  * Returns a positive value, if the point lies outside the capsule and a negative value,
  * if the point lies inside the capsule.
  */
-inline real_t  Capsule::getDistance( real_t  px, real_t  py, real_t  pz ) const
+inline pe_real_t  Capsule::getDistance( pe_real_t  px, pe_real_t  py, pe_real_t  pz ) const
 {
    return -getRelDepth( pointFromWFtoBF( px, py, pz ) );
 }
@@ -433,7 +433,7 @@ inline real_t  Capsule::getDistance( real_t  px, real_t  py, real_t  pz ) const
  * Returns a positive value, if the point lies outside the capsule and a negative value,
  * if the point lies inside the capsule.
  */
-inline real_t  Capsule::getDistance( const Vec3& gpos ) const
+inline pe_real_t  Capsule::getDistance( const Vec3& gpos ) const
 {
    return -getRelDepth( pointFromWFtoBF( gpos ) );
 }
diff --git a/src/pe/rigidbody/CapsuleFactory.cpp b/src/pe/rigidbody/CapsuleFactory.cpp
index 44b7839d11d8587d6415f9d0d52d3c885a4e6b23..9f67bf30a82509b60341f8cf48c3ee85b49abfdb 100644
--- a/src/pe/rigidbody/CapsuleFactory.cpp
+++ b/src/pe/rigidbody/CapsuleFactory.cpp
@@ -30,15 +30,15 @@ namespace walberla {
 namespace pe {
 
 CapsuleID createCapsule(   BodyStorage& globalStorage, BlockStorage& blocks, BlockDataID storageID,
-                           id_t uid, const Vec3& gpos, const real_t radius, const real_t length,
+                           id_t uid, const Vec3& gpos, const pe_real_t radius, const pe_real_t length,
                            MaterialID material,
                            bool global, bool communicating, bool infiniteMass )
 {
    WALBERLA_ASSERT_UNEQUAL( Capsule::getStaticTypeID(), std::numeric_limits<id_t>::max(), "Capsule TypeID not initalized!");
 
    // Checking the radius and the length
-   WALBERLA_ASSERT_GREATER( radius, real_t(0), "Invalid capsule radius" );
-   WALBERLA_ASSERT_GREATER( length, real_t(0), "Invalid capsule length" );
+   WALBERLA_ASSERT_GREATER( radius, pe_real_t(0), "Invalid capsule radius" );
+   WALBERLA_ASSERT_GREATER( length, pe_real_t(0), "Invalid capsule length" );
 
    CapsuleID capsule = NULL;
 
diff --git a/src/pe/rigidbody/CapsuleFactory.h b/src/pe/rigidbody/CapsuleFactory.h
index 012522b6005222f40cf92033a48804da0f28596e..97eae3efed64d68bbf9830869a95d3edc08518ea 100644
--- a/src/pe/rigidbody/CapsuleFactory.h
+++ b/src/pe/rigidbody/CapsuleFactory.h
@@ -61,7 +61,7 @@ namespace pe {
    \snippet PeDocumentationSnippets.cpp Create a Capsule
  */
 CapsuleID createCapsule(   BodyStorage& globalStorage, BlockStorage& blocks, BlockDataID storageID,
-                           id_t uid, const Vec3& gpos, const real_t radius, const real_t length,
+                           id_t uid, const Vec3& gpos, const pe_real_t radius, const pe_real_t length,
                            MaterialID material = Material::find("iron"),
                            bool global = false, bool communicating = true, bool infiniteMass = false );
 //*************************************************************************************************
diff --git a/src/pe/rigidbody/Plane.cpp b/src/pe/rigidbody/Plane.cpp
index ffb6c91a0690eaabb52bb7c45199b0255506deb3..1c8872a60830861f8b14e839146fb9c540907055 100644
--- a/src/pe/rigidbody/Plane.cpp
+++ b/src/pe/rigidbody/Plane.cpp
@@ -62,7 +62,7 @@ namespace pe {
  * from the origin to the plane.
  */
 Plane::Plane( id_t sid, id_t uid,
-              const Vec3& gpos, const Vec3& normal, real_t d,
+              const Vec3& gpos, const Vec3& normal, pe_real_t d,
               MaterialID material )
    : GeomPrimitive( getStaticTypeID(), sid, uid, material )  // Initialization of the parent class
    , normal_( normal )                                                       // Normal of the plane
@@ -92,7 +92,7 @@ Plane::Plane( id_t sid, id_t uid,
    // Calculating the orientation and rotation
    // The default normal of a plane is <0,0,1>. The rotation of the plane is calculated
    // as the rotation of this default normal to the specified normal.
-   if( normal[0]*normal[0] + normal[1]*normal[1] < math::Limits<real_t>::accuracy() )
+   if( normal[0]*normal[0] + normal[1]*normal[1] < math::Limits<pe_real_t>::accuracy() )
       q_ = Quat( Vec3( 1, 0, 0 ), std::acos( normal[2] ) );
    else
       q_ = Quat( Vec3( -normal[1], normal[0], real_c(0) ), std::acos( normal[2] ) );
@@ -137,17 +137,17 @@ Plane::~Plane()
 void Plane::calcBoundingBox()
 {
    aabb_ = AABB( ( normal_[0] <  real_c(0) && floatIsEqual(normal_[1], real_c(0)) && floatIsEqual(normal_[2], real_c(0)) )
-                 ? ( -d_ - contactThreshold ) : ( -math::Limits<real_t>::inf() ),
+                 ? ( -d_ - contactThreshold ) : ( -math::Limits<pe_real_t>::inf() ),
                  ( floatIsEqual(normal_[0], real_c(0)) && normal_[1] <  real_c(0) && floatIsEqual(normal_[2], real_c(0)) )
-                 ? ( -d_ - contactThreshold ) : ( -math::Limits<real_t>::inf() ),
+                 ? ( -d_ - contactThreshold ) : ( -math::Limits<pe_real_t>::inf() ),
                  ( floatIsEqual(normal_[0], real_c(0)) && floatIsEqual(normal_[1], real_c(0)) && normal_[2] <  real_c(0) )
-                 ? ( -d_ - contactThreshold ) : ( -math::Limits<real_t>::inf() ),
+                 ? ( -d_ - contactThreshold ) : ( -math::Limits<pe_real_t>::inf() ),
                  ( normal_[0] >  real_c(0) && floatIsEqual(normal_[1], real_c(0)) && floatIsEqual(normal_[2], real_c(0)) )
-                 ? (  d_ + contactThreshold ) : (  math::Limits<real_t>::inf() ),
+                 ? (  d_ + contactThreshold ) : (  math::Limits<pe_real_t>::inf() ),
                  ( floatIsEqual(normal_[0], real_c(0)) && normal_[1] >  real_c(0) && floatIsEqual(normal_[2], real_c(0)) )
-                 ? (  d_ + contactThreshold ) : (  math::Limits<real_t>::inf() ),
+                 ? (  d_ + contactThreshold ) : (  math::Limits<pe_real_t>::inf() ),
                  ( floatIsEqual(normal_[0], real_c(0)) && floatIsEqual(normal_[1], real_c(0)) && normal_[2] >  real_c(0) )
-                 ? (  d_ + contactThreshold ) : (  math::Limits<real_t>::inf() ) );
+                 ? (  d_ + contactThreshold ) : (  math::Limits<pe_real_t>::inf() ) );
 }
 //*************************************************************************************************
 
@@ -173,7 +173,7 @@ void Plane::calcBoundingBox()
  * - Setting the position of a plane contained in a union changes the geometry of the union.
  *   Therefore this may cause an invalidation of links contained in the union.
  */
-void Plane::setPositionImpl( real_t px, real_t py, real_t pz )
+void Plane::setPositionImpl( pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    gpos_[0] = px;
    gpos_[1] = py;
@@ -208,7 +208,7 @@ void Plane::setPositionImpl( real_t px, real_t py, real_t pz )
  * - Setting the orientation of a plane contained in a union changes the geometry of the union.
  *   Therefore this may cause an invalidation of links contained in the union.
  */
-void Plane::setOrientationImpl( real_t r, real_t i, real_t j, real_t k )
+void Plane::setOrientationImpl( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k )
 {
    q_.set(r, i, j, k);          // Updating the orientation of the plane
    R_ = q_.toRotationMatrix();  // Updating the rotation of the plane
@@ -254,7 +254,7 @@ void Plane::setOrientationImpl( real_t r, real_t i, real_t j, real_t k )
  * - Translating a plane contained in a union changes the geometry of the union. Therefore this
  *   may cause an invalidation of links contained in the union.
  */
-void Plane::translateImpl( real_t dx, real_t dy, real_t dz )
+void Plane::translateImpl( pe_real_t dx, pe_real_t dy, pe_real_t dz )
 {
    gpos_[0] += dx;
    gpos_[1] += dy;
@@ -423,7 +423,7 @@ void Plane::rotateAroundPointImpl( const Vec3& point, const Quat& dq )
  * \param pz The z-component of the relative coordinate.
  * \return \a true if the point lies inside the plane, \a false if not.
  */
-bool Plane::containsRelPointImpl( real_t /*px*/, real_t /*py*/, real_t pz ) const
+bool Plane::containsRelPointImpl( pe_real_t /*px*/, pe_real_t /*py*/, pe_real_t pz ) const
 {
    return pz <= real_c(0);
 }
@@ -440,7 +440,7 @@ bool Plane::containsRelPointImpl( real_t /*px*/, real_t /*py*/, real_t pz ) cons
  *
  * The tolerance level of the check is pe::surfaceThreshold.
  */
-bool Plane::isSurfaceRelPointImpl( real_t /*px*/, real_t /*py*/, real_t pz ) const
+bool Plane::isSurfaceRelPointImpl( pe_real_t /*px*/, pe_real_t /*py*/, pe_real_t pz ) const
 {
    return std::fabs( pz ) <= surfaceThreshold;
 }
diff --git a/src/pe/rigidbody/Plane.h b/src/pe/rigidbody/Plane.h
index 996edb3e84a4589be73f31a5e5cd61e9d9517e45..0882912a045dadd4cd11a4bb884bff2e45c52bb9 100644
--- a/src/pe/rigidbody/Plane.h
+++ b/src/pe/rigidbody/Plane.h
@@ -72,7 +72,7 @@ public:
    /*!\name Constructor */
    //@{
    explicit Plane( id_t sid, id_t uid, const Vec3& gpos, const Vec3& normal,
-                   real_t d, MaterialID material );
+                   pe_real_t d, MaterialID material );
    //@}
    //**********************************************************************************************
 
@@ -87,23 +87,23 @@ public:
    //**Get functions*******************************************************************************
    /*!\name Get functions */
    //@{
-   virtual inline real_t getVolume()       const;
+   virtual inline pe_real_t getVolume()       const;
    inline const Vec3&    getNormal()       const;
-   inline real_t         getDisplacement() const;
+   inline pe_real_t         getDisplacement() const;
    //@}
    //**********************************************************************************************
 
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-   inline real_t getRelDepth   ( real_t px, real_t py, real_t pz ) const;
-   inline real_t getRelDepth   ( const Vec3& rpos )          const;
-   inline real_t getDepth      ( real_t px, real_t py, real_t pz ) const;
-   inline real_t getDepth      ( const Vec3& gpos )          const;
-   inline real_t getRelDistance( real_t px, real_t py, real_t pz ) const;
-   inline real_t getRelDistance( const Vec3& rpos )          const;
-   inline real_t getDistance   ( real_t px, real_t py, real_t pz ) const;
-   inline real_t getDistance   ( const Vec3& gpos )          const;
+   inline pe_real_t getRelDepth   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getRelDepth   ( const Vec3& rpos )          const;
+   inline pe_real_t getDepth      ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getDepth      ( const Vec3& gpos )          const;
+   inline pe_real_t getRelDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getRelDistance( const Vec3& rpos )          const;
+   inline pe_real_t getDistance   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getDistance   ( const Vec3& gpos )          const;
 
    static inline id_t getStaticTypeID();
    //@}
@@ -120,14 +120,14 @@ protected:
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-   virtual void setPositionImpl       ( real_t px, real_t py, real_t pz );
-   virtual void setOrientationImpl    ( real_t r, real_t i, real_t j, real_t k );
-   virtual void translateImpl         ( real_t dx, real_t dy, real_t dz );
+   virtual void setPositionImpl       ( pe_real_t px, pe_real_t py, pe_real_t pz );
+   virtual void setOrientationImpl    ( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k );
+   virtual void translateImpl         ( pe_real_t dx, pe_real_t dy, pe_real_t dz );
    virtual void rotateImpl            ( const Quat& dq );
    virtual void rotateAroundOriginImpl( const Quat& dq );
    virtual void rotateAroundPointImpl ( const Vec3& point, const Quat& dq );
-   virtual bool containsRelPointImpl   ( real_t px, real_t py, real_t pz ) const;
-   virtual bool isSurfaceRelPointImpl  ( real_t px, real_t py, real_t pz ) const;
+   virtual bool containsRelPointImpl   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   virtual bool isSurfaceRelPointImpl  ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    //@}
    //**********************************************************************************************
 
@@ -152,7 +152,7 @@ protected:
    Vec3 normal_;  //!< Normal of the plane in reference to the global world frame.
                   /*!< The normal of the plane is always pointing towards the halfspace
                        outside the plane. */
-   real_t d_;       //!< Plane displacement from the origin.
+   pe_real_t d_;       //!< Plane displacement from the origin.
                   /*!< The displacement can be categorized in the following way:\n
                         - > 0: The global origin is inside the plane\n
                         - < 0: The global origin is outside the plane\n
@@ -185,9 +185,9 @@ private:
  *
  * \return The volume is always infinity.
  */
-inline real_t Plane::getVolume() const
+inline pe_real_t Plane::getVolume() const
 {
-   return std::numeric_limits<real_t>::infinity();
+   return std::numeric_limits<pe_real_t>::infinity();
 }
 //*************************************************************************************************
 
@@ -212,7 +212,7 @@ inline const Vec3& Plane::getNormal() const
  * A positive displacement value indicates that the origin of the global world frame is contained
  * in the plane, whereas a negative value indicates that the origin is not contained in the plane.
  */
-inline real_t Plane::getDisplacement() const
+inline pe_real_t Plane::getDisplacement() const
 {
    return d_;
 }
@@ -235,7 +235,7 @@ inline real_t Plane::getDisplacement() const
  * Returns a positive value, if the point lies inside the plane and a negative value,
  * if the point lies outside the plane.
  */
-inline real_t Plane::getRelDepth( real_t /*px*/, real_t /*py*/, real_t pz ) const
+inline pe_real_t Plane::getRelDepth( pe_real_t /*px*/, pe_real_t /*py*/, pe_real_t pz ) const
 {
    return -pz;
 }
@@ -251,7 +251,7 @@ inline real_t Plane::getRelDepth( real_t /*px*/, real_t /*py*/, real_t pz ) cons
  * Returns a positive value, if the point lies inside the plane and a negative value,
  * if the point lies outside the plane.
  */
-inline real_t Plane::getRelDepth( const Vec3& rpos ) const
+inline pe_real_t Plane::getRelDepth( const Vec3& rpos ) const
 {
    return -rpos[2];
 }
@@ -269,7 +269,7 @@ inline real_t Plane::getRelDepth( const Vec3& rpos ) const
  * Returns a positive value, if the point lies inside the plane and a negative value,
  * if the point lies outside the plane.
  */
-inline real_t Plane::getDepth( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Plane::getDepth( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return getDepth( Vec3( px, py, pz ) );
 }
@@ -285,7 +285,7 @@ inline real_t Plane::getDepth( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies inside the plane and a negative value,
  * if the point lies outside the plane.
  */
-inline real_t Plane::getDepth( const Vec3& gpos ) const
+inline pe_real_t Plane::getDepth( const Vec3& gpos ) const
 {
    return d_ - ( gpos * normal_ );
 }
@@ -303,7 +303,7 @@ inline real_t Plane::getDepth( const Vec3& gpos ) const
  * Returns a positive value, if the point lies outside the plane and a negative value, if the
  * point lies inside the plane.
  */
-inline real_t Plane::getRelDistance( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Plane::getRelDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return -getRelDepth( px, py, pz );
 }
@@ -319,7 +319,7 @@ inline real_t Plane::getRelDistance( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies outside the plane and a negative value, if the
  * point lies inside the plane.
  */
-inline real_t Plane::getRelDistance( const Vec3& rpos ) const
+inline pe_real_t Plane::getRelDistance( const Vec3& rpos ) const
 {
    return -getRelDepth( rpos );
 }
@@ -337,7 +337,7 @@ inline real_t Plane::getRelDistance( const Vec3& rpos ) const
  * Returns a positive value, if the point lies outside the plane and a negative value, if the
  * point lies inside the plane.
  */
-inline real_t Plane::getDistance( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Plane::getDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return -getRelDepth( pointFromWFtoBF( px, py, pz ) );
 }
@@ -353,7 +353,7 @@ inline real_t Plane::getDistance( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies outside the plane and a negative value, if the
  * point lies inside the plane.
  */
-inline real_t Plane::getDistance( const Vec3& gpos ) const
+inline pe_real_t Plane::getDistance( const Vec3& gpos ) const
 {
    return -getRelDepth( pointFromWFtoBF( gpos ) );
 }
diff --git a/src/pe/rigidbody/RigidBody.cpp b/src/pe/rigidbody/RigidBody.cpp
index 45d40109e31a29020a55517e8c28b1b5fecddf2f..bffd1f1890ae6149d28b624951003d4e47f38de7 100644
--- a/src/pe/rigidbody/RigidBody.cpp
+++ b/src/pe/rigidbody/RigidBody.cpp
@@ -200,7 +200,7 @@ bool RigidBody::checkInvariants()
  *
  * The function calculates the global velocity of a point relative to the body's center of mass.
  */
-const Vec3 RigidBody::velFromBF( real_t px, real_t py, real_t pz ) const
+const Vec3 RigidBody::velFromBF( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return velFromBF( Vec3( px, py, pz ) );
 }
@@ -234,7 +234,7 @@ const Vec3 RigidBody::velFromBF( const Vec3& rpos ) const
  *
  * The function calculates the global velocity of a point in global coordinates.
  */
-const Vec3 RigidBody::velFromWF( real_t px, real_t py, real_t pz ) const
+const Vec3 RigidBody::velFromWF( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return velFromWF( Vec3( px, py, pz ) );
 }
diff --git a/src/pe/rigidbody/RigidBody.h b/src/pe/rigidbody/RigidBody.h
index 8627cf49698d946810e946dc3962b42035e30af8..3b34590ad54a5978fa256757c6522378d0df8342 100644
--- a/src/pe/rigidbody/RigidBody.h
+++ b/src/pe/rigidbody/RigidBody.h
@@ -126,33 +126,33 @@ public:
    inline const Vec3&    getAngularVel()     const;
    inline const Quat&    getQuaternion()     const;
    inline const Mat3&    getRotation()       const;
-   inline real_t         getMass()           const;
-   inline real_t         getInvMass()        const;
-   virtual inline real_t getVolume()         const;
+   inline pe_real_t         getMass()           const;
+   inline pe_real_t         getInvMass()        const;
+   virtual inline pe_real_t getVolume()         const;
    inline const Mat3&    getBodyInertia()    const;
    inline const Mat3     getInertia()        const;
    inline const Mat3&    getInvBodyInertia() const;
    inline const Mat3     getInvInertia()     const;
    inline const AABB&    getAABB()           const;
-   inline real_t         getAABBSize()       const;
+   inline pe_real_t         getAABBSize()       const;
 
-   inline       real_t   getKineticEnergy()     const;
-   inline       real_t   getRotationalEnergy()  const;
-   inline       real_t   getEnergy()            const;
+   inline       pe_real_t   getKineticEnergy()     const;
+   inline       pe_real_t   getRotationalEnergy()  const;
+   inline       pe_real_t   getEnergy()            const;
 
-   inline const Vec3     vectorFromBFtoWF( real_t vx, real_t vy, real_t vz ) const;
+   inline const Vec3     vectorFromBFtoWF( pe_real_t vx, pe_real_t vy, pe_real_t vz ) const;
    inline const Vec3     vectorFromBFtoWF( const Vec3& v )             const;
-   inline const Vec3     pointFromBFtoWF ( real_t px, real_t py, real_t pz ) const;
+   inline const Vec3     pointFromBFtoWF ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    inline const Vec3     pointFromBFtoWF ( const Vec3& rpos )          const;
-   virtual const Vec3    velFromBF       ( real_t px, real_t py, real_t pz ) const;
+   virtual const Vec3    velFromBF       ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    virtual const Vec3    velFromBF       ( const Vec3& rpos )          const;
-   inline const Vec3     vectorFromWFtoBF( real_t vx, real_t vy, real_t vz ) const;
+   inline const Vec3     vectorFromWFtoBF( pe_real_t vx, pe_real_t vy, pe_real_t vz ) const;
    inline const Vec3     vectorFromWFtoBF( const Vec3& v )             const;
-   inline const Vec3     pointFromWFtoBF ( real_t px, real_t py, real_t pz ) const;
+   inline const Vec3     pointFromWFtoBF ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    inline const Vec3     pointFromWFtoBF ( const Vec3& gpos )          const;
-   virtual const Vec3    velFromWF       ( real_t px, real_t py, real_t pz ) const;
+   virtual const Vec3    velFromWF       ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    virtual const Vec3    velFromWF       ( const Vec3& gpos )          const;
-   inline const Vec3     accFromWF       ( real_t px, real_t py, real_t pz ) const;
+   inline const Vec3     accFromWF       ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
           const Vec3     accFromWF       ( const Vec3& gpos )          const;
 
    inline       id_t     getTypeID() const;
@@ -168,18 +168,18 @@ public:
    inline  void setFinite     ( const bool finite );
    inline  void setMass       ( bool infinite );
    inline  void setVisible    ( bool visible );
-   inline  void setPosition   ( real_t px, real_t py, real_t pz );
+   inline  void setPosition   ( pe_real_t px, pe_real_t py, pe_real_t pz );
    inline  void setPosition   ( const Vec3& gpos );
-   inline  void setOrientation( real_t r, real_t i, real_t j, real_t k );
+   inline  void setOrientation( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k );
    inline  void setOrientation( const Quat& q );
 
-   inline void setRelLinearVel ( real_t vx, real_t vy, real_t vz );
+   inline void setRelLinearVel ( pe_real_t vx, pe_real_t vy, pe_real_t vz );
    inline void setRelLinearVel ( const Vec3& lvel );
-   inline void setLinearVel    ( real_t vx, real_t vy, real_t vz );
+   inline void setLinearVel    ( pe_real_t vx, pe_real_t vy, pe_real_t vz );
    inline void setLinearVel    ( const Vec3& lvel );
-   inline void setRelAngularVel( real_t ax, real_t ay, real_t az );
+   inline void setRelAngularVel( pe_real_t ax, pe_real_t ay, pe_real_t az );
    inline void setRelAngularVel( const Vec3& avel );
-   inline void setAngularVel   ( real_t ax, real_t ay, real_t az );
+   inline void setAngularVel   ( pe_real_t ax, pe_real_t ay, pe_real_t az );
    inline void setAngularVel   ( const Vec3& avel );
 
    ///Marks the rigid body for deletion during the next synchronization
@@ -193,7 +193,7 @@ public:
    //**Translation functions***********************************************************************
    /*!\name Translation functions */
    //@{
-   void translate( real_t dx, real_t dy, real_t dz );
+   void translate( pe_real_t dx, pe_real_t dy, pe_real_t dz );
    void translate( const Vec3& dp );
    //@}
    //**********************************************************************************************
@@ -201,19 +201,19 @@ public:
    //**Rotation functions**************************************************************************
    /*!\name Rotation functions */
    //@{
-   void rotate( real_t x, real_t y, real_t z, real_t angle );
-   void rotate( const Vec3& axis, real_t angle );
-   void rotate( real_t xangle, real_t yangle, real_t zangle );
+   void rotate( pe_real_t x, pe_real_t y, pe_real_t z, pe_real_t angle );
+   void rotate( const Vec3& axis, pe_real_t angle );
+   void rotate( pe_real_t xangle, pe_real_t yangle, pe_real_t zangle );
    void rotate( const Vec3& euler );
    void rotate( const Quat& dq );
 
-   void rotateAroundOrigin( real_t x, real_t y, real_t z, real_t angle );
-   void rotateAroundOrigin( const Vec3& axis, real_t angle );
-   void rotateAroundOrigin( real_t xangle, real_t yangle, real_t zangle );
+   void rotateAroundOrigin( pe_real_t x, pe_real_t y, pe_real_t z, pe_real_t angle );
+   void rotateAroundOrigin( const Vec3& axis, pe_real_t angle );
+   void rotateAroundOrigin( pe_real_t xangle, pe_real_t yangle, pe_real_t zangle );
    void rotateAroundOrigin( const Vec3& euler );
    void rotateAroundOrigin( const Quat& dq );
 
-   void rotateAroundPoint( const Vec3& point, const Vec3& axis, real_t angle );
+   void rotateAroundPoint( const Vec3& point, const Vec3& axis, pe_real_t angle );
    void rotateAroundPoint( const Vec3& point, const Vec3& euler );
    //@}
    //**********************************************************************************************
@@ -221,13 +221,13 @@ public:
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-   bool containsRelPoint       ( real_t px, real_t py, real_t pz ) const;
+   bool containsRelPoint       ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    bool containsRelPoint       ( const Vec3& rpos )                const;
-   bool containsPoint          ( real_t px, real_t py, real_t pz ) const;
+   bool containsPoint          ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    bool containsPoint          ( const Vec3& gpos )                const;
-   bool isSurfaceRelPoint      ( real_t px, real_t py, real_t pz ) const;
+   bool isSurfaceRelPoint      ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    bool isSurfaceRelPoint      ( const Vec3& rpos )                const;
-   bool isSurfacePoint         ( real_t px, real_t py, real_t pz ) const;
+   bool isSurfacePoint         ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    bool isSurfacePoint         ( const Vec3& gpos )                const;
    virtual Vec3 support                ( const Vec3& d )                   const;
    virtual Vec3 supportContactThreshold( const Vec3& d )                   const;
@@ -245,20 +245,20 @@ public:
    inline void        setForce           ( const Vec3& f );
    inline void        setTorque          ( const Vec3& tau );
 
-   inline void        addRelForce        ( real_t fx, real_t fy, real_t fz );
+   inline void        addRelForce        ( pe_real_t fx, pe_real_t fy, pe_real_t fz );
    inline void        addRelForce        ( const Vec3& f );
-   inline void        addForce           ( real_t fx, real_t fy, real_t fz );
+   inline void        addForce           ( pe_real_t fx, pe_real_t fy, pe_real_t fz );
    inline void        addForce           ( const Vec3& f );
-   inline void        addRelForceAtRelPos( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz );
+   inline void        addRelForceAtRelPos( pe_real_t fx, pe_real_t fy, pe_real_t fz, pe_real_t px, pe_real_t py, pe_real_t pz );
    inline void        addRelForceAtRelPos( const Vec3& f, const Vec3& rpos );
-   inline void        addRelForceAtPos   ( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz );
+   inline void        addRelForceAtPos   ( pe_real_t fx, pe_real_t fy, pe_real_t fz, pe_real_t px, pe_real_t py, pe_real_t pz );
    inline void        addRelForceAtPos   ( const Vec3& f, const Vec3& gpos );
-   inline void        addForceAtRelPos   ( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz );
+   inline void        addForceAtRelPos   ( pe_real_t fx, pe_real_t fy, pe_real_t fz, pe_real_t px, pe_real_t py, pe_real_t pz );
    inline void        addForceAtRelPos   ( const Vec3& f, const Vec3& rpos );
-   inline void        addForceAtPos      ( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz );
+   inline void        addForceAtPos      ( pe_real_t fx, pe_real_t fy, pe_real_t fz, pe_real_t px, pe_real_t py, pe_real_t pz );
    inline void        addForceAtPos      ( const Vec3& f, const Vec3& gpos );
 
-   inline void        addTorque( real_t tx, real_t ty, real_t tz );
+   inline void        addTorque( pe_real_t tx, pe_real_t ty, pe_real_t tz );
    inline void        addTorque( const Vec3& t );
 
    virtual inline void        resetForceAndTorque();
@@ -268,9 +268,9 @@ public:
    //**Impulse functions***************************************************************************
    /*!\name Impulse functions */
    //@{
-   inline void addImpulse( real_t jx, real_t jy, real_t jz );
+   inline void addImpulse( pe_real_t jx, pe_real_t jy, pe_real_t jz );
    inline void addImpulse( const Vec3& j );
-   inline void addImpulseAtPos( real_t jx, real_t jy, real_t jz, real_t px, real_t py, real_t pz );
+   inline void addImpulseAtPos( pe_real_t jx, pe_real_t jy, pe_real_t jz, pe_real_t px, pe_real_t py, pe_real_t pz );
    inline void addImpulseAtPos( const Vec3& j, const Vec3& p );
    //@}
    //**********************************************************************************************
@@ -351,14 +351,14 @@ protected:
    //**Set functions*******************************************************************************
    /*!\name Set functions */
    //@{
-   virtual void setPositionImpl       ( real_t px, real_t py, real_t pz );
-   virtual void setOrientationImpl    ( real_t r, real_t i, real_t j, real_t k );
-   virtual void translateImpl         ( real_t dx, real_t dy, real_t dz );
+   virtual void setPositionImpl       ( pe_real_t px, pe_real_t py, pe_real_t pz );
+   virtual void setOrientationImpl    ( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k );
+   virtual void translateImpl         ( pe_real_t dx, pe_real_t dy, pe_real_t dz );
    virtual void rotateImpl            ( const Quat& dq );
    virtual void rotateAroundOriginImpl( const Quat& dq );
    virtual void rotateAroundPointImpl ( const Vec3& point, const Quat& dq );
-   virtual bool containsRelPointImpl   ( real_t px, real_t py, real_t pz ) const;
-   virtual bool isSurfaceRelPointImpl  ( real_t px, real_t py, real_t pz ) const;
+   virtual bool containsRelPointImpl   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   virtual bool isSurfaceRelPointImpl  ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
 
    inline void calcRelPosition();
    //@}
@@ -402,9 +402,9 @@ protected:
    bool awake_;      //!< Sleep mode flag.
                   /*!< The flag value indicates if the rigid body is currently awake
                        (\a true) or in sleep mode (\a false). */
-   real_t mass_;     //!< The total mass of the rigid body.
-   real_t invMass_;  //!< The inverse total mass of the rigid body.
-   real_t motion_;   //!< The current motion of the rigid body.
+   pe_real_t mass_;     //!< The total mass of the rigid body.
+   pe_real_t invMass_;  //!< The inverse total mass of the rigid body.
+   pe_real_t motion_;   //!< The current motion of the rigid body.
                   /*!< If this value drops under the specified sleep threshold, the
                        rigid body will be put to sleep. */
    Vec3 gpos_;       //!< The global position of the center of mass of this rigid body.
@@ -706,7 +706,7 @@ inline bool RigidBody::isFixed() const
  */
 inline bool RigidBody::hasInfiniteMass() const
 {
-   return (isIdentical(invMass_, real_t(0))) && ( Iinv_.isZero() );
+   return (isIdentical(invMass_, pe_real_t(0))) && ( Iinv_.isZero() );
 }
 //*************************************************************************************************
 
@@ -877,7 +877,7 @@ inline const Mat3& RigidBody::getRotation() const
  *
  * \return The total mass of the rigid body.
  */
-inline real_t RigidBody::getMass() const
+inline pe_real_t RigidBody::getMass() const
 {
    return mass_;
 }
@@ -889,7 +889,7 @@ inline real_t RigidBody::getMass() const
  *
  * \return The inverse total mass of the rigid body.
  */
-inline real_t RigidBody::getInvMass() const
+inline pe_real_t RigidBody::getInvMass() const
 {
    return invMass_;
 }
@@ -901,7 +901,7 @@ inline real_t RigidBody::getInvMass() const
  *
  * \return The volume of the rigid body.
  */
-inline real_t RigidBody::getVolume() const
+inline pe_real_t RigidBody::getVolume() const
 {
    WALBERLA_ABORT("getVolume is not implemented for this rigid body!");
 }
@@ -972,9 +972,9 @@ inline const AABB& RigidBody::getAABB() const
  *
  * \return The length of the longest side of the AABB of the rigid body.
  */
-inline real_t RigidBody::getAABBSize() const
+inline pe_real_t RigidBody::getAABBSize() const
 {
-   real_t size  = aabb_.xSize();
+   pe_real_t size  = aabb_.xSize();
 
    if( aabb_.ySize() > size ) size = aabb_.ySize();
    if( aabb_.zSize() > size ) size = aabb_.zSize();
@@ -989,7 +989,7 @@ inline real_t RigidBody::getAABBSize() const
  *
  * \return kinetic energy
  */
-inline real_t   RigidBody::getKineticEnergy()      const
+inline pe_real_t   RigidBody::getKineticEnergy()      const
 {
    return real_c(0.5) * getMass() * getLinearVel() * getLinearVel();
 }
@@ -999,7 +999,7 @@ inline real_t   RigidBody::getKineticEnergy()      const
  *
  * \return rotational energy
  */
-inline real_t   RigidBody::getRotationalEnergy()      const
+inline pe_real_t   RigidBody::getRotationalEnergy()      const
 {
    return real_c(0.5) * getAngularVel() * (getInertia() * getAngularVel());
 }
@@ -1009,7 +1009,7 @@ inline real_t   RigidBody::getRotationalEnergy()      const
  *
  * \return energy. Takes into account rotational energy, kinetic energy and potential energy.
  */
-inline real_t   RigidBody::getEnergy()      const
+inline pe_real_t   RigidBody::getEnergy()      const
 {
    return getKineticEnergy() + getRotationalEnergy();
 }
@@ -1027,7 +1027,7 @@ inline real_t   RigidBody::getEnergy()      const
  * The function calculates the transformation of a vector in body frame to a vector in global
  * world frame.
  */
-inline const Vec3 RigidBody::vectorFromBFtoWF( real_t vx, real_t vy, real_t vz ) const
+inline const Vec3 RigidBody::vectorFromBFtoWF( pe_real_t vx, pe_real_t vy, pe_real_t vz ) const
 {
    return R_ * Vec3( vx, vy, vz );
 }
@@ -1061,7 +1061,7 @@ inline const Vec3 RigidBody::vectorFromBFtoWF( const Vec3& v ) const
  * The function calculates the transformation of a point relative to the body's center of
  * mass to a point in global coordinates.
  */
-inline const Vec3 RigidBody::pointFromBFtoWF( real_t px, real_t py, real_t pz ) const
+inline const Vec3 RigidBody::pointFromBFtoWF( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return gpos_ + ( R_ * Vec3( px, py, pz ) );
 }
@@ -1095,7 +1095,7 @@ inline const Vec3 RigidBody::pointFromBFtoWF( const Vec3& rpos ) const
  * The function calculates the transformation of a vector in global world frame to a vector
  * in body frame.
  */
-inline const Vec3 RigidBody::vectorFromWFtoBF( real_t vx, real_t vy, real_t vz ) const
+inline const Vec3 RigidBody::vectorFromWFtoBF( pe_real_t vx, pe_real_t vy, pe_real_t vz ) const
 {
    return R_.getTranspose() * Vec3( vx, vy, vz );
 }
@@ -1129,7 +1129,7 @@ inline const Vec3 RigidBody::vectorFromWFtoBF( const Vec3& v ) const
  * The function calculates the transformation of a point in global coordinates to a point
  * relative to the body's center of mass.
  */
-inline const Vec3 RigidBody::pointFromWFtoBF( real_t px, real_t py, real_t pz ) const
+inline const Vec3 RigidBody::pointFromWFtoBF( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return R_.getTranspose() * ( Vec3( px, py, pz ) - gpos_ );
 }
@@ -1162,7 +1162,7 @@ inline const Vec3 RigidBody::pointFromWFtoBF( const Vec3& gpos ) const
  *
  * The function calculates the global acceleration of a point in global coordinates.
  */
-const Vec3 RigidBody::accFromWF( real_t px, real_t py, real_t pz ) const
+const Vec3 RigidBody::accFromWF( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return accFromWF( Vec3( px, py, pz ) );
 }
@@ -1200,7 +1200,7 @@ inline id_t     RigidBody::getTypeID() const{
  * by the user. Note that any changes on remote rigid
  * bodies are neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::setRelLinearVel( real_t vx, real_t vy, real_t vz )
+inline void RigidBody::setRelLinearVel( pe_real_t vx, pe_real_t vy, pe_real_t vz )
 {
    if( !hasSuperBody() )
    {
@@ -1210,7 +1210,7 @@ inline void RigidBody::setRelLinearVel( real_t vx, real_t vy, real_t vz )
 }
 //*************************************************************************************************
 
-/// \see setRelLinearVel( real_t vx, real_t vy, real_t vz )
+/// \see setRelLinearVel( pe_real_t vx, pe_real_t vy, pe_real_t vz )
 inline void RigidBody::setRelLinearVel( const Vec3& lvel )
 {
    setRelLinearVel(lvel[0], lvel[1], lvel[2]);
@@ -1235,7 +1235,7 @@ inline void RigidBody::setRelLinearVel( const Vec3& lvel )
  * by the user. Note that any changes on remote rigid
  * bodies are neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::setLinearVel( real_t vx, real_t vy, real_t vz )
+inline void RigidBody::setLinearVel( pe_real_t vx, pe_real_t vy, pe_real_t vz )
 {
    if( !hasSuperBody() )
    {
@@ -1246,7 +1246,7 @@ inline void RigidBody::setLinearVel( real_t vx, real_t vy, real_t vz )
 //*************************************************************************************************
 
 
-/// /see setLinearVel( real_t vx, real_t vy, real_t vz )
+/// /see setLinearVel( pe_real_t vx, pe_real_t vy, pe_real_t vz )
 inline void RigidBody::setLinearVel( const Vec3& lvel )
 {
    setLinearVel(lvel[0], lvel[1], lvel[2]);
@@ -1273,7 +1273,7 @@ inline void RigidBody::setLinearVel( const Vec3& lvel )
  * by the user. Note that any changes on remote rigid
  * bodies are neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::setRelAngularVel( real_t ax, real_t ay, real_t az )
+inline void RigidBody::setRelAngularVel( pe_real_t ax, pe_real_t ay, pe_real_t az )
 {
    if( !hasSuperBody() )
    {
@@ -1284,7 +1284,7 @@ inline void RigidBody::setRelAngularVel( real_t ax, real_t ay, real_t az )
 //*************************************************************************************************
 
 
-/// /see setRelAngularVel( real_t ax, real_t ay, real_t az )
+/// /see setRelAngularVel( pe_real_t ax, pe_real_t ay, pe_real_t az )
 inline void RigidBody::setRelAngularVel( const Vec3& avel )
 {
    setRelAngularVel(avel[0], avel[1], avel[2]);
@@ -1309,7 +1309,7 @@ inline void RigidBody::setRelAngularVel( const Vec3& avel )
  * by the user. Note that any changes on remote rigid
  * bodies are neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::setAngularVel( real_t ax, real_t ay, real_t az )
+inline void RigidBody::setAngularVel( pe_real_t ax, pe_real_t ay, pe_real_t az )
 {
    if( !hasSuperBody() )
    {
@@ -1320,7 +1320,7 @@ inline void RigidBody::setAngularVel( real_t ax, real_t ay, real_t az )
 //*************************************************************************************************
 
 
-/// /see setAngularVel( real_t ax, real_t ay, real_t az )
+/// /see setAngularVel( pe_real_t ax, pe_real_t ay, pe_real_t az )
 inline void RigidBody::setAngularVel( const Vec3& avel )
 {
    setAngularVel(avel[0], avel[1], avel[2]);
@@ -1460,7 +1460,7 @@ inline void RigidBody::setTorque( const Vec3& tau )
  * body. Depending on the position of the superordinate body's center of mass, the force can
  * also cause a torque in the superordinate body.
  */
-inline void RigidBody::addRelForce( real_t fx, real_t fy, real_t fz )
+inline void RigidBody::addRelForce( pe_real_t fx, pe_real_t fy, pe_real_t fz )
 {
    addForce( R_ * Vec3( fx, fy, fz ) );
 }
@@ -1500,7 +1500,7 @@ inline void RigidBody::addRelForce( const Vec3& f )
  * Depending on the position of the superordinate body's center of mass, the force can also
  * cause a torque in the superordinate body.
  */
-inline void RigidBody::addForce( real_t fx, real_t fy, real_t fz )
+inline void RigidBody::addForce( pe_real_t fx, pe_real_t fy, pe_real_t fz )
 {
    addForce( Vec3( fx, fy, fz ) );
 }
@@ -1551,7 +1551,7 @@ inline void RigidBody::addForce( const Vec3& f )
  * If the body is part of a superordinate body, the force is also acting on the superordinate
  * body.
  */
-inline void RigidBody::addRelForceAtRelPos( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz )
+inline void RigidBody::addRelForceAtRelPos( pe_real_t fx, pe_real_t fy, pe_real_t fz, pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    addForceAtPos( vectorFromBFtoWF( fx, fy, fz ), pointFromBFtoWF( px, py, pz ) );
 }
@@ -1594,7 +1594,7 @@ inline void RigidBody::addRelForceAtRelPos( const Vec3& f, const Vec3& rpos )
  * Depending on the position, the force can cause a torque in the body's center of mass. If the
  * body is part of a superordinate body, the force is also acting on the superordinate body.
  */
-inline void RigidBody::addRelForceAtPos( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz )
+inline void RigidBody::addRelForceAtPos( pe_real_t fx, pe_real_t fy, pe_real_t fz, pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    addForceAtPos( vectorFromBFtoWF( fx, fy, fz ), Vec3( px, py, pz ) );
 }
@@ -1636,7 +1636,7 @@ inline void RigidBody::addRelForceAtPos( const Vec3& f, const Vec3& gpos )
  * Depending on the position, the force can cause a torque in the body's center of mass. If the
  * body is part of a superordinate body, the force is also acting on the superordinate body.
  */
-inline void RigidBody::addForceAtRelPos( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz )
+inline void RigidBody::addForceAtRelPos( pe_real_t fx, pe_real_t fy, pe_real_t fz, pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    addForceAtPos( Vec3( fx, fy, fz ), pointFromBFtoWF( px, py, pz ) );
 }
@@ -1678,7 +1678,7 @@ inline void RigidBody::addForceAtRelPos( const Vec3& f, const Vec3& rpos )
  * body's center of mass. If the body is part of a superordinate body, the force is also
  * acting on the superordinate body.
  */
-inline void RigidBody::addForceAtPos( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz )
+inline void RigidBody::addForceAtPos( pe_real_t fx, pe_real_t fy, pe_real_t fz, pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    addForceAtPos( Vec3( fx, fy, fz ), Vec3( px, py, pz ) );
 }
@@ -1726,7 +1726,7 @@ inline void RigidBody::addForceAtPos( const Vec3& f, const Vec3& gpos )
  * to the superordinate body instead. It is \b not possible to apply a torque on subordinate
  * rigid bodies!
  */
-inline void RigidBody::addTorque( real_t tx, real_t ty, real_t tz )
+inline void RigidBody::addTorque( pe_real_t tx, pe_real_t ty, pe_real_t tz )
 {
    addTorque( Vec3( tx, ty, tz ) );
 }
@@ -1790,7 +1790,7 @@ inline void RigidBody::resetForceAndTorque()
  * superordinate body's center of mass, the impulse can also change the angular velocity
  * of the rigid body (and the superordinate body).
  */
-inline void RigidBody::addImpulse( real_t jx, real_t jy, real_t jz )
+inline void RigidBody::addImpulse( pe_real_t jx, pe_real_t jy, pe_real_t jz )
 {
    addImpulse( Vec3( jx, jy, jz ) );
 }
@@ -1836,7 +1836,7 @@ inline void RigidBody::addImpulse( const Vec3& j )
  * can also change the angular velocity. If the rigid body is part of a superordinate body, the
  * impulse is also acting on the superordinate body.
  */
-inline void RigidBody::addImpulseAtPos( real_t jx, real_t jy, real_t jz, real_t px, real_t py, real_t pz )
+inline void RigidBody::addImpulseAtPos( pe_real_t jx, pe_real_t jy, pe_real_t jz, pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    addImpulseAtPos( Vec3( jx, jy, jz ), Vec3( px, py, pz ) );
 }
@@ -2368,7 +2368,7 @@ inline void RigidBody::setVisible( bool visible )
 //*************************************************************************************************
 
 //*************************************************************************************************
-/*!\fn void RigidBody::setPosition( real_t px, real_t py, real_t pz )
+/*!\fn void RigidBody::setPosition( pe_real_t px, pe_real_t py, pe_real_t pz )
  * \brief Setting the global position of the rigid body.
  *
  * \param px The x-component of the global position.
@@ -2389,7 +2389,7 @@ inline void RigidBody::setVisible( bool visible )
  *   bodies are neglected and overwritten by the settings of the rigid body on its local process!
  */
 //*************************************************************************************************
-inline void RigidBody::setPositionImpl( real_t px, real_t py, real_t pz )
+inline void RigidBody::setPositionImpl( pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    if (isFixed())
       WALBERLA_ABORT("Trying to move a fixed body: " << *this);
@@ -2405,7 +2405,7 @@ inline void RigidBody::setPositionImpl( real_t px, real_t py, real_t pz )
 //*************************************************************************************************
 
 //*************************************************************************************************
-/*!\fn void RigidBody::setPosition( real_t px, real_t py, real_t pz )
+/*!\fn void RigidBody::setPosition( pe_real_t px, pe_real_t py, pe_real_t pz )
  * \brief Setting the global position of the rigid body.
  *
  * \param px The x-component of the global position.
@@ -2426,7 +2426,7 @@ inline void RigidBody::setPositionImpl( real_t px, real_t py, real_t pz )
  *   bodies are neglected and overwritten by the settings of the rigid body on its local process!
  */
 //*************************************************************************************************
-inline void RigidBody::setPosition( real_t px, real_t py, real_t pz )
+inline void RigidBody::setPosition( pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    setPositionImpl(px, py, pz);
 }
@@ -2461,10 +2461,10 @@ inline void RigidBody::setPosition( const Vec3& gpos )
 
 
 //*************************************************************************************************
-/*!\fn void RigidBody::setOrientationImpl( real_t r, real_t i, real_t j, real_t k )
+/*!\fn void RigidBody::setOrientationImpl( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k )
  * \brief Setting the global orientation of the rigid body.
  *
- * \param r The value for the real_t part.
+ * \param r The value for the pe_real_t part.
  * \param i The value for the first imaginary part.
  * \param j The value for the second imaginary part.
  * \param k The value for the third imaginary part.
@@ -2484,7 +2484,7 @@ inline void RigidBody::setPosition( const Vec3& gpos )
  *   bodies are neglected and overwritten by the settings of the rigid body on its local process!
  */
 //*************************************************************************************************
-inline void RigidBody::setOrientationImpl( real_t r, real_t i, real_t j, real_t k )
+inline void RigidBody::setOrientationImpl( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k )
 {
    if (isFixed())
       WALBERLA_ABORT("Trying to rotate a fixed body: " << *this);
@@ -2499,10 +2499,10 @@ inline void RigidBody::setOrientationImpl( real_t r, real_t i, real_t j, real_t
 //*************************************************************************************************
 
 //*************************************************************************************************
-/*!\fn void RigidBody::setOrientation( real_t r, real_t i, real_t j, real_t k )
+/*!\fn void RigidBody::setOrientation( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k )
  * \brief Setting the global orientation of the rigid body.
  *
- * \param r The value for the real_t part.
+ * \param r The value for the pe_real_t part.
  * \param i The value for the first imaginary part.
  * \param j The value for the second imaginary part.
  * \param k The value for the third imaginary part.
@@ -2522,7 +2522,7 @@ inline void RigidBody::setOrientationImpl( real_t r, real_t i, real_t j, real_t
  *   bodies are neglected and overwritten by the settings of the rigid body on its local process!
  */
 //*************************************************************************************************
-inline void RigidBody::setOrientation( real_t r, real_t i, real_t j, real_t k )
+inline void RigidBody::setOrientation( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k )
 {
    setOrientationImpl(r, i, j, k);
 }
@@ -2581,7 +2581,7 @@ inline void RigidBody::setOrientation( const Quat& q )
  *   by the user. Note that any changes on remote rigid bodies are
  *   neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::translateImpl( real_t dx, real_t dy, real_t dz )
+inline void RigidBody::translateImpl( pe_real_t dx, pe_real_t dy, pe_real_t dz )
 {
    if (isFixed())
       WALBERLA_ABORT("Trying to translate a fixed body: " << *this);
@@ -2614,7 +2614,7 @@ inline void RigidBody::translateImpl( real_t dx, real_t dy, real_t dz )
  *   by the user. Note that any changes on remote rigid bodies are
  *   neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::translate( real_t dx, real_t dy, real_t dz )
+inline void RigidBody::translate( pe_real_t dx, pe_real_t dy, pe_real_t dz )
 {
    translateImpl( dx, dy, dz);
 }
@@ -2671,7 +2671,7 @@ inline void RigidBody::translate( const Vec3& dp )
  *   by the user. Note that any changes on remote rigid bodies are
  *   neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::rotate( real_t x, real_t y, real_t z, real_t angle )
+inline void RigidBody::rotate( pe_real_t x, pe_real_t y, pe_real_t z, pe_real_t angle )
 {
    rotateImpl( Quat( Vec3(x, y, z), angle) );
 }
@@ -2699,7 +2699,7 @@ inline void RigidBody::rotate( real_t x, real_t y, real_t z, real_t angle )
  *   by the user. Note that any changes on remote rigid bodies are
  *   neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::rotate( const Vec3& axis, real_t angle )
+inline void RigidBody::rotate( const Vec3& axis, pe_real_t angle )
 {
    rotateImpl( Quat( axis, angle ) );
 }
@@ -2728,7 +2728,7 @@ inline void RigidBody::rotate( const Vec3& axis, real_t angle )
  *   by the user. Note that any changes on remote rigid bodies are
  *   neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::rotate( real_t xangle, real_t yangle, real_t zangle )
+inline void RigidBody::rotate( pe_real_t xangle, pe_real_t yangle, pe_real_t zangle )
 {
    Quat q;
    q.rotateX( xangle );  // Rotation around the x-axis
@@ -2827,7 +2827,7 @@ inline void RigidBody::rotateImpl( const Quat& dq )
  *
  * \see rotateAroundOrigin( const Quat& dq )
  */
-inline void RigidBody::rotateAroundOrigin( real_t x, real_t y, real_t z, real_t angle )
+inline void RigidBody::rotateAroundOrigin( pe_real_t x, pe_real_t y, pe_real_t z, pe_real_t angle )
 {
    rotateAroundOrigin( Quat(Vec3( x, y, z ), angle) );
 }
@@ -2847,7 +2847,7 @@ inline void RigidBody::rotateAroundOrigin( real_t x, real_t y, real_t z, real_t
  *
  * \see rotateAroundOrigin( const Quat& dq )
  */
-inline void RigidBody::rotateAroundOrigin( const Vec3& axis, real_t angle )
+inline void RigidBody::rotateAroundOrigin( const Vec3& axis, pe_real_t angle )
 {
    rotateAroundOrigin( Quat(axis, angle) );
 }
@@ -2869,7 +2869,7 @@ inline void RigidBody::rotateAroundOrigin( const Vec3& axis, real_t angle )
  *
  * \see rotateAroundOrigin( const Quat& dq )
  */
-inline void RigidBody::rotateAroundOrigin( real_t xangle, real_t yangle, real_t zangle )
+inline void RigidBody::rotateAroundOrigin( pe_real_t xangle, pe_real_t yangle, pe_real_t zangle )
 {
    rotateAroundOrigin( Quat(xangle, yangle, zangle) );
 }
@@ -3005,7 +3005,7 @@ inline void RigidBody::rotateAroundPointImpl( const Vec3& point, const Quat& dq
  *   by the user. Note that any changes on remote rigid bodies are
  *   neglected and overwritten by the settings of the rigid body on its local process!
  */
-inline void RigidBody::rotateAroundPoint( const Vec3& point, const Vec3& axis, real_t angle )
+inline void RigidBody::rotateAroundPoint( const Vec3& point, const Vec3& axis, pe_real_t angle )
 {
    rotateAroundPointImpl(point, Quat(axis, angle) );
 }
@@ -3058,7 +3058,7 @@ inline void RigidBody::rotateAroundPoint( const Vec3& point, const Vec3& euler )
  * \param pz The z-component of the relative coordinate.
  * \return \a true if the point lies inside the rigid body, \a false if not.
  */
-inline bool RigidBody::containsRelPoint( real_t px, real_t py, real_t pz ) const
+inline bool RigidBody::containsRelPoint( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return containsRelPointImpl( px, py, pz );
 }
@@ -3086,7 +3086,7 @@ inline bool RigidBody::containsRelPoint( const Vec3& rpos ) const
  * \param pz The z-component of the global coordinate.
  * \return \a true if the point lies inside the rigid body, \a false if not.
  */
-inline bool RigidBody::containsPoint( real_t px, real_t py, real_t pz ) const
+inline bool RigidBody::containsPoint( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    const Vec3& temp = pointFromWFtoBF( px, py, pz );
    return containsRelPointImpl( temp[0], temp[1], temp[2] );
@@ -3115,7 +3115,7 @@ inline bool RigidBody::containsPoint( const Vec3& gpos ) const
  * \param pz The z-component of the relative coordinate.
  * \return \a true if the point lies inside the rigid body, \a false if not.
  */
-inline bool RigidBody::containsRelPointImpl( real_t /*px*/, real_t /*py*/, real_t /*pz*/ ) const
+inline bool RigidBody::containsRelPointImpl( pe_real_t /*px*/, pe_real_t /*py*/, pe_real_t /*pz*/ ) const
 {
    WALBERLA_ABORT( "Contains point function not implemented!" );
    return false;
@@ -3133,7 +3133,7 @@ inline bool RigidBody::containsRelPointImpl( real_t /*px*/, real_t /*py*/, real_
  *
  * The tolerance level of the check is surfaceThreshold.
  */
-inline bool RigidBody::isSurfaceRelPoint( real_t px, real_t py, real_t pz ) const
+inline bool RigidBody::isSurfaceRelPoint( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return isSurfaceRelPointImpl( px, py, pz );
 }
@@ -3165,7 +3165,7 @@ inline bool RigidBody::isSurfaceRelPoint( const Vec3& rpos ) const
  *
  * The tolerance level of the check is surfaceThreshold.
  */
-inline bool RigidBody::isSurfacePoint( real_t px, real_t py, real_t pz ) const
+inline bool RigidBody::isSurfacePoint( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    const Vec3& temp = pointFromWFtoBF( px, py, pz );
    return isSurfaceRelPointImpl( temp[0], temp[1], temp[2] );
@@ -3198,7 +3198,7 @@ inline bool RigidBody::isSurfacePoint( const Vec3& gpos ) const
  *
  * The tolerance level of the check is surfaceThreshold.
  */
-inline bool RigidBody::isSurfaceRelPointImpl( real_t /*px*/, real_t /*py*/, real_t /*pz*/ ) const
+inline bool RigidBody::isSurfaceRelPointImpl( pe_real_t /*px*/, pe_real_t /*py*/, pe_real_t /*pz*/ ) const
 {
    WALBERLA_ABORT( "Surface point calculation not implemented!" );
    return false;
diff --git a/src/pe/rigidbody/Sphere.cpp b/src/pe/rigidbody/Sphere.cpp
index 8ea3a81a768d586f47ab77b3016cead0e6b85fb3..9868249ff1aaf5e5abad65a07e24e86311b8ad74 100644
--- a/src/pe/rigidbody/Sphere.cpp
+++ b/src/pe/rigidbody/Sphere.cpp
@@ -59,12 +59,12 @@ namespace pe {
  * \param infiniteMass specifies if the sphere has infinite mass and will be treated as an obstacle
  */
 Sphere::Sphere( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
-                real_t radius, MaterialID material,
+                pe_real_t radius, MaterialID material,
                 const bool global, const bool communicating, const bool infiniteMass )
    : Sphere::Sphere( getStaticTypeID(), sid, uid, gpos, rpos, q, radius, material, global, communicating, infiniteMass )
 {}
 Sphere::Sphere( id_t const typeId, id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
-                real_t radius, MaterialID material,
+                pe_real_t radius, MaterialID material,
                 const bool global, const bool communicating, const bool infiniteMass )
    : GeomPrimitive( typeId, sid, uid, material )  // Initialization of the parent class
    , radius_(radius)
@@ -136,7 +136,7 @@ Sphere::~Sphere()
  * \param pz The z-component of the relative coordinate.
  * \return \a true if the point lies inside the sphere, \a false if not.
  */
-bool Sphere::containsRelPointImpl( real_t px, real_t py, real_t pz ) const
+bool Sphere::containsRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    const Vec3 rpos( px, py, pz );
    return ( rpos.sqrLength() <= ( radius_*radius_ ) );
@@ -154,7 +154,7 @@ bool Sphere::containsRelPointImpl( real_t px, real_t py, real_t pz ) const
  *
  * The tolerance level of the check is pe::surfaceThreshold.
  */
-bool Sphere::isSurfaceRelPointImpl( real_t px, real_t py, real_t pz ) const
+bool Sphere::isSurfaceRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    const Vec3 rpos( px, py, pz );
    return floatIsEqual( rpos.sqrLength(), radius_*radius_, pe::surfaceThreshold );
diff --git a/src/pe/rigidbody/Sphere.h b/src/pe/rigidbody/Sphere.h
index bc0e82566c5f171eee4aa354a2dbedb7e75033b7..942a01860c3d5ecda6da1ad70fff4de2b194ca08 100644
--- a/src/pe/rigidbody/Sphere.h
+++ b/src/pe/rigidbody/Sphere.h
@@ -64,10 +64,10 @@ public:
    /*!\name Constructors */
    //@{
    explicit Sphere( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
-                    real_t radius, MaterialID material,
+                    pe_real_t radius, MaterialID material,
                     const bool global, const bool communicating, const bool infiniteMass );
    explicit Sphere( id_t const typeID, id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
-                    real_t radius, MaterialID material,
+                    pe_real_t radius, MaterialID material,
                     const bool global, const bool communicating, const bool infiniteMass );
    //@}
    //**********************************************************************************************
@@ -84,22 +84,22 @@ public:
    //**Get functions*******************************************************************************
    /*!\name Get functions */
    //@{
-   inline real_t getRadius() const;
-   virtual inline real_t getVolume()         const;
+   inline pe_real_t getRadius() const;
+   virtual inline pe_real_t getVolume()         const;
    //@}
    //**********************************************************************************************
 
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-   inline real_t getRelDepth   ( real_t px, real_t py, real_t pz ) const;
-   inline real_t getRelDepth   ( const Vec3& rpos )          const;
-   inline real_t getDepth      ( real_t px, real_t py, real_t pz ) const;
-   inline real_t getDepth      ( const Vec3& gpos )          const;
-   inline real_t getRelDistance( real_t px, real_t py, real_t pz ) const;
-   inline real_t getRelDistance( const Vec3& rpos )          const;
-   inline real_t getDistance   ( real_t px, real_t py, real_t pz ) const;
-   inline real_t getDistance   ( const Vec3& gpos )          const;
+   inline pe_real_t getRelDepth   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getRelDepth   ( const Vec3& rpos )          const;
+   inline pe_real_t getDepth      ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getDepth      ( const Vec3& gpos )          const;
+   inline pe_real_t getRelDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getRelDistance( const Vec3& rpos )          const;
+   inline pe_real_t getDistance   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   inline pe_real_t getDistance   ( const Vec3& gpos )          const;
    static inline id_t getStaticTypeID();
    //@}
    //**********************************************************************************************
@@ -122,9 +122,9 @@ public:
    //**Volume, mass and density functions**********************************************************
    /*!\name Volume, mass and density functions */
    //@{
-   static inline real_t calcVolume( real_t radius );
-   static inline real_t calcMass( real_t radius, real_t density );
-   static inline real_t calcDensity( real_t radius, real_t mass );
+   static inline pe_real_t calcVolume( pe_real_t radius );
+   static inline pe_real_t calcMass( pe_real_t radius, pe_real_t density );
+   static inline pe_real_t calcDensity( pe_real_t radius, pe_real_t mass );
    //@}
    //**********************************************************************************************
 
@@ -132,8 +132,8 @@ protected:
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-   virtual bool containsRelPointImpl ( real_t px, real_t py, real_t pz ) const;
-   virtual bool isSurfaceRelPointImpl( real_t px, real_t py, real_t pz ) const;
+   virtual bool containsRelPointImpl ( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
+   virtual bool isSurfaceRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const;
    //@}
    //**********************************************************************************************
 
@@ -148,7 +148,7 @@ protected:
    //**Member variables****************************************************************************
    /*!\name Member variables */
    //@{
-   real_t radius_;  //!< Radius of the sphere.
+   pe_real_t radius_;  //!< Radius of the sphere.
                   /*!< The radius is constrained to values larger than 0.0. */
    //@}
    //**********************************************************************************************
@@ -177,7 +177,7 @@ private:
  *
  * \return The radius of the sphere.
  */
-inline real_t Sphere::getRadius() const
+inline pe_real_t Sphere::getRadius() const
 {
    return radius_;
 }
@@ -189,7 +189,7 @@ inline real_t Sphere::getRadius() const
  *
  * \return The volume of the sphere.
  */
-inline real_t Sphere::getVolume() const
+inline pe_real_t Sphere::getVolume() const
 {
    return Sphere::calcVolume(getRadius());
 }
@@ -210,7 +210,7 @@ inline real_t Sphere::getVolume() const
  * \param radius The radius of the sphere.
  * \return The volume of the sphere.
  */
-inline real_t Sphere::calcVolume( real_t radius )
+inline pe_real_t Sphere::calcVolume( pe_real_t radius )
 {
    return real_c(4.0)/real_c(3.0) * math::M_PI * radius * radius * radius;
 }
@@ -224,7 +224,7 @@ inline real_t Sphere::calcVolume( real_t radius )
  * \param density The density of the sphere.
  * \return The total mass of the sphere.
  */
-inline real_t Sphere::calcMass( real_t radius, real_t density )
+inline pe_real_t Sphere::calcMass( pe_real_t radius, pe_real_t density )
 {
    return real_c(4.0)/real_c(3.0) * math::M_PI * radius * radius * radius * density;
 }
@@ -238,7 +238,7 @@ inline real_t Sphere::calcMass( real_t radius, real_t density )
  * \param mass The total mass of the sphere.
  * \return The density of the sphere.
  */
-inline real_t Sphere::calcDensity( real_t radius, real_t mass )
+inline pe_real_t Sphere::calcDensity( pe_real_t radius, pe_real_t mass )
 {
    return real_c(0.75) * mass / ( math::M_PI * radius * radius * radius );
 }
@@ -265,7 +265,7 @@ inline real_t Sphere::calcDensity( real_t radius, real_t mass )
  */
 inline void Sphere::calcBoundingBox()
 {
-   const real_t length( radius_ + contactThreshold );
+   const pe_real_t length( radius_ + contactThreshold );
 
    aabb_    = AABB(
               gpos_[0] - length,
@@ -304,7 +304,7 @@ inline void Sphere::calcInertia()
 inline Vec3 Sphere::support( const Vec3& d ) const
 {
    auto len = d.sqrLength();
-   if (!math::equal(len, real_t(0)))
+   if (!math::equal(len, pe_real_t(0)))
    {
       return getPosition() + getRadius() / sqrt(len) * d;
    } else
@@ -325,7 +325,7 @@ inline Vec3 Sphere::support( const Vec3& d ) const
 inline Vec3 Sphere::supportContactThreshold( const Vec3& d ) const
 {
    WALBERLA_ASSERT( d.sqrLength() <= real_c(0.0), "Zero length search direction" );
-   WALBERLA_ASSERT( 1.0-math::Limits<real_t>::fpuAccuracy() <= d.length() && d.length() <= 1.0+math::Limits<real_t>::fpuAccuracy(), "Search direction is not normalised" );
+   WALBERLA_ASSERT( 1.0-math::Limits<pe_real_t>::fpuAccuracy() <= d.length() && d.length() <= 1.0+math::Limits<pe_real_t>::fpuAccuracy(), "Search direction is not normalised" );
    return gpos_ + d*(radius_ + contactThreshold);
 }
 //*************************************************************************************************
@@ -347,7 +347,7 @@ inline Vec3 Sphere::supportContactThreshold( const Vec3& d ) const
  * Returns a positive value, if the point lies inside the sphere and a negative value,
  * if the point lies outside the sphere.
  */
-inline real_t Sphere::getRelDepth( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Sphere::getRelDepth( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return getRelDepth( Vec3( px, py, pz ) );
 }
@@ -363,7 +363,7 @@ inline real_t Sphere::getRelDepth( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies inside the sphere and a negative value,
  * if the point lies outside the sphere.
  */
-inline real_t Sphere::getRelDepth( const Vec3& rpos ) const
+inline pe_real_t Sphere::getRelDepth( const Vec3& rpos ) const
 {
    return ( radius_ - rpos.length() );
 }
@@ -381,7 +381,7 @@ inline real_t Sphere::getRelDepth( const Vec3& rpos ) const
  * Returns a positive value, if the point lies inside the sphere and a negative value,
  * if the point lies outside the sphere.
  */
-inline real_t Sphere::getDepth( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Sphere::getDepth( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return getDepth( Vec3( px, py, pz ) );
 }
@@ -397,7 +397,7 @@ inline real_t Sphere::getDepth( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies inside the sphere and a negative value,
  * if the point lies outside the sphere.
  */
-inline real_t Sphere::getDepth( const Vec3& gpos ) const
+inline pe_real_t Sphere::getDepth( const Vec3& gpos ) const
 {
    return ( radius_ - ( gpos - gpos_ ).length() );
 }
@@ -415,7 +415,7 @@ inline real_t Sphere::getDepth( const Vec3& gpos ) const
  * Returns a positive value, if the point lies outside the sphere and a negative value, if the
  * point lies inside the sphere.
  */
-inline real_t Sphere::getRelDistance( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Sphere::getRelDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return getRelDistance( Vec3( px, py, pz ) );
 }
@@ -431,7 +431,7 @@ inline real_t Sphere::getRelDistance( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies outside the sphere and a negative value, if the
  * point lies inside the sphere.
  */
-inline real_t Sphere::getRelDistance( const Vec3& rpos ) const
+inline pe_real_t Sphere::getRelDistance( const Vec3& rpos ) const
 {
    return ( rpos.length() - radius_ );
 }
@@ -449,7 +449,7 @@ inline real_t Sphere::getRelDistance( const Vec3& rpos ) const
  * Returns a positive value, if the point lies outside the sphere and a negative value, if the
  * point lies inside the sphere.
  */
-inline real_t Sphere::getDistance( real_t px, real_t py, real_t pz ) const
+inline pe_real_t Sphere::getDistance( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return getDistance( Vec3( px, py, pz ) );
 }
@@ -465,7 +465,7 @@ inline real_t Sphere::getDistance( real_t px, real_t py, real_t pz ) const
  * Returns a positive value, if the point lies outside the sphere and a negative value, if the
  * point lies inside the sphere.
  */
-inline real_t Sphere::getDistance( const Vec3& gpos ) const
+inline pe_real_t Sphere::getDistance( const Vec3& gpos ) const
 {
    return ( ( gpos - gpos_ ).length() - radius_ );
 }
diff --git a/src/pe/rigidbody/SphereFactory.cpp b/src/pe/rigidbody/SphereFactory.cpp
index c9487031def01e2876e0d2bf6d341c1e9681825b..3ca27fbf8800214ceb4e20db83130c62c109b056 100644
--- a/src/pe/rigidbody/SphereFactory.cpp
+++ b/src/pe/rigidbody/SphereFactory.cpp
@@ -30,7 +30,7 @@ namespace walberla {
 namespace pe {
 
 SphereID createSphere( BodyStorage& globalStorage, BlockStorage& blocks, BlockDataID storageID,
-                       id_t uid, const Vec3& gpos, real_t radius,
+                       id_t uid, const Vec3& gpos, pe_real_t radius,
                        MaterialID material,
                        bool global, bool communicating, bool infiniteMass )
 {
diff --git a/src/pe/rigidbody/SphereFactory.h b/src/pe/rigidbody/SphereFactory.h
index e1f5774209d43abdba9d29e0060aacc586be3afa..7dbfe39c9b625f97e7964efb0e00e1fa3a2db1f7 100644
--- a/src/pe/rigidbody/SphereFactory.h
+++ b/src/pe/rigidbody/SphereFactory.h
@@ -66,7 +66,7 @@ namespace pe {
  *
  */
 SphereID createSphere( BodyStorage& globalStorage, BlockStorage& blocks, BlockDataID storageID,
-                       id_t uid, const Vec3& gpos, real_t radius,
+                       id_t uid, const Vec3& gpos, pe_real_t radius,
                        MaterialID material = Material::find("iron"),
                        bool global = false, bool communicating = true, bool infiniteMass = false );
 //*************************************************************************************************
diff --git a/src/pe/rigidbody/Squirmer.cpp b/src/pe/rigidbody/Squirmer.cpp
index 99f650b00290b619fa411c1a74f77a8c193c6200..fe250a1c50d0cd9437493b68adccb6f1f0f016f8 100644
--- a/src/pe/rigidbody/Squirmer.cpp
+++ b/src/pe/rigidbody/Squirmer.cpp
@@ -49,7 +49,7 @@ namespace pe {
  * \param infiniteMass specifies if the sphere has infinite mass and will be treated as an obstacle
  */
 Squirmer::Squirmer( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
-                    real_t radius, real_t squirmerVelocity, real_t squirmerBeta, MaterialID material,
+                    pe_real_t radius, pe_real_t squirmerVelocity, pe_real_t squirmerBeta, MaterialID material,
                     const bool global, const bool communicating, const bool infiniteMass )
    : Sphere( getStaticTypeID(), sid, uid, gpos, rpos, q, radius, material, global, communicating, infiniteMass )  // Initialization of the parent class
    , squirmerVelocity_(squirmerVelocity), squirmerBeta_(squirmerBeta)
@@ -89,7 +89,7 @@ Squirmer::~Squirmer()
  *
  * The function calculates the global velocity of a point relative to the body's center of mass.
  */
-const Vec3 Squirmer::velFromBF( real_t px, real_t py, real_t pz ) const
+const Vec3 Squirmer::velFromBF( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return velFromBF( Vec3( px, py, pz ) );
 }
@@ -120,7 +120,7 @@ const Vec3 Squirmer::velFromBF( const Vec3& rpos ) const
  *
  * The function calculates the global velocity of a point in global coordinates.
  */
-const Vec3 Squirmer::velFromWF( real_t px, real_t py, real_t pz ) const
+const Vec3 Squirmer::velFromWF( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    return velFromWF( Vec3( px, py, pz ) );
 }
diff --git a/src/pe/rigidbody/Squirmer.h b/src/pe/rigidbody/Squirmer.h
index 3dc76acad0ecd56c46f9d17f3027fbd3f4fd3d7e..11da2f6a8061c6cfd435b7f3ff8d25124a22f50e 100644
--- a/src/pe/rigidbody/Squirmer.h
+++ b/src/pe/rigidbody/Squirmer.h
@@ -33,7 +33,7 @@ public:
    /*!\name Constructors */
    //@{
    explicit Squirmer( id_t sid, id_t uid, const Vec3& gpos, const Vec3& rpos, const Quat& q,
-                    real_t radius, real_t squirmerVelocity, real_t squirmerBeta, MaterialID material,
+                    pe_real_t radius, pe_real_t squirmerVelocity, pe_real_t squirmerBeta, MaterialID material,
                     const bool global, const bool communicating, const bool infiniteMass );
    //@}
    //**********************************************************************************************
@@ -50,12 +50,12 @@ public:
    //**Get functions*******************************************************************************
    /*!\name Get functions */
    //@{
-   inline real_t getSquirmerVelocity() const;
-   inline real_t getSquirmerBeta()     const;
+   inline pe_real_t getSquirmerVelocity() const;
+   inline pe_real_t getSquirmerBeta()     const;
 
-   inline const Vec3     velFromBF       ( real_t px, real_t py, real_t pz ) const WALBERLA_OVERRIDE;
+   inline const Vec3     velFromBF       ( pe_real_t px, pe_real_t py, pe_real_t pz ) const WALBERLA_OVERRIDE;
    inline const Vec3     velFromBF       ( const Vec3& rpos )                const WALBERLA_OVERRIDE;
-   inline const Vec3     velFromWF       ( real_t px, real_t py, real_t pz ) const WALBERLA_OVERRIDE;
+   inline const Vec3     velFromWF       ( pe_real_t px, pe_real_t py, pe_real_t pz ) const WALBERLA_OVERRIDE;
    inline const Vec3     velFromWF       ( const Vec3& gpos )                const WALBERLA_OVERRIDE;
 
    static inline id_t getStaticTypeID() WALBERLA_OVERRIDE;
@@ -73,8 +73,8 @@ protected:
    //**Member variables****************************************************************************
    /*!\name Member variables */
    //@{
-   real_t squirmerVelocity_;  //!< Velocity of the squirmer.
-   real_t squirmerBeta_;  //!< Dipolar character of the squirmer.
+   pe_real_t squirmerVelocity_;  //!< Velocity of the squirmer.
+   pe_real_t squirmerBeta_;  //!< Dipolar character of the squirmer.
    //@}
    //**********************************************************************************************
 
@@ -99,7 +99,7 @@ private:
  *
  * \return The velocity of the squirmer.
  */
-inline real_t Squirmer::getSquirmerVelocity() const
+inline pe_real_t Squirmer::getSquirmerVelocity() const
 {
    return squirmerVelocity_;
 }
@@ -110,7 +110,7 @@ inline real_t Squirmer::getSquirmerVelocity() const
  *
  * \return The dipole characteristic of the squirmer.
  */
-inline real_t Squirmer::getSquirmerBeta() const
+inline pe_real_t Squirmer::getSquirmerBeta() const
 {
    return squirmerBeta_;
 }
diff --git a/src/pe/rigidbody/SquirmerFactory.cpp b/src/pe/rigidbody/SquirmerFactory.cpp
index 41b495b75aa008cf3aae1278b98ad450302b9cd7..a8a5580a1f42f715ec8a8ad0f1e264d18cda4994 100644
--- a/src/pe/rigidbody/SquirmerFactory.cpp
+++ b/src/pe/rigidbody/SquirmerFactory.cpp
@@ -28,8 +28,8 @@ namespace walberla {
 namespace pe {
 
 SquirmerID createSquirmer( BodyStorage& globalStorage, BlockStorage& blocks, BlockDataID storageID,
-                        id_t uid, const Vec3& gpos, real_t radius,
-                        real_t squirmerVelocity, real_t squirmerBeta,
+                        id_t uid, const Vec3& gpos, pe_real_t radius,
+                        pe_real_t squirmerVelocity, pe_real_t squirmerBeta,
                         MaterialID material,
                         bool global, bool communicating, bool infiniteMass )
 {
diff --git a/src/pe/rigidbody/SquirmerFactory.h b/src/pe/rigidbody/SquirmerFactory.h
index 01aca87847b4571e08f2e17db0919a98dd001e8b..01ddbadbbb6438207e46c64f2efdcb6ff01a48ad 100644
--- a/src/pe/rigidbody/SquirmerFactory.h
+++ b/src/pe/rigidbody/SquirmerFactory.h
@@ -63,8 +63,8 @@ namespace pe {
  *
  */
 SquirmerID createSquirmer( BodyStorage& globalStorage, BlockStorage& blocks, BlockDataID storageID,
-                           id_t uid, const Vec3& gpos, real_t radius,
-                           real_t squirmerVelocity, real_t squirmerBeta,
+                           id_t uid, const Vec3& gpos, pe_real_t radius,
+                           pe_real_t squirmerVelocity, pe_real_t squirmerBeta,
                            MaterialID material = Material::find("iron"),
                            bool global = false, bool communicating = true, bool infiniteMass = false );
 //*************************************************************************************************
diff --git a/src/pe/rigidbody/Union.h b/src/pe/rigidbody/Union.h
index 31c025c274b9c3fbfaf7b21a051e72a9796e64d1..e0191412f46993328c86c159f3f4821ce8766028 100644
--- a/src/pe/rigidbody/Union.h
+++ b/src/pe/rigidbody/Union.h
@@ -113,7 +113,7 @@ public:
    template< typename C > inline Bodies::CastIterator<C>      end()         {return bodies_.end<C>();}
    template< typename C > inline Bodies::ConstCastIterator<C> end() const   {return bodies_.end<C>();}
 
-   virtual inline real_t getVolume()         const;
+   virtual inline pe_real_t getVolume()         const;
    //@}
    //**********************************************************************************************
 
@@ -168,14 +168,14 @@ protected:
    //**Utility functions***************************************************************************
    /*!\name Utility functions */
    //@{
-   virtual void setPositionImpl       ( real_t px, real_t py, real_t pz )         WALBERLA_OVERRIDE;
-   virtual void setOrientationImpl    ( real_t r, real_t i, real_t j, real_t k )  WALBERLA_OVERRIDE;
-   virtual void translateImpl         ( real_t dx, real_t dy, real_t dz )         WALBERLA_OVERRIDE;
+   virtual void setPositionImpl       ( pe_real_t px, pe_real_t py, pe_real_t pz )         WALBERLA_OVERRIDE;
+   virtual void setOrientationImpl    ( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k )  WALBERLA_OVERRIDE;
+   virtual void translateImpl         ( pe_real_t dx, pe_real_t dy, pe_real_t dz )         WALBERLA_OVERRIDE;
    virtual void rotateImpl            ( const Quat& dq )                          WALBERLA_OVERRIDE;
    virtual void rotateAroundOriginImpl( const Quat& dq )                          WALBERLA_OVERRIDE;
    virtual void rotateAroundPointImpl ( const Vec3& point, const Quat& dq )       WALBERLA_OVERRIDE;
-   virtual bool containsRelPointImpl   ( real_t px, real_t py, real_t pz ) const  WALBERLA_OVERRIDE;
-   virtual bool isSurfaceRelPointImpl  ( real_t px, real_t py, real_t pz ) const  WALBERLA_OVERRIDE;
+   virtual bool containsRelPointImpl   ( pe_real_t px, pe_real_t py, pe_real_t pz ) const  WALBERLA_OVERRIDE;
+   virtual bool isSurfaceRelPointImpl  ( pe_real_t px, pe_real_t py, pe_real_t pz ) const  WALBERLA_OVERRIDE;
    //@}
    //**********************************************************************************************
 
@@ -276,9 +276,9 @@ Union<BodyTypeTuple>::~Union()
  * \return The volume of the union.
  */
 template <typename BodyTypeTuple>
-inline real_t Union<BodyTypeTuple>::getVolume() const
+inline pe_real_t Union<BodyTypeTuple>::getVolume() const
 {
-   real_t volume(0);
+   pe_real_t volume(0);
    for( auto bodyIt=bodies_.begin(); bodyIt!=bodies_.end(); ++bodyIt )
       volume += bodyIt->getVolume();
    return volume;
@@ -321,13 +321,13 @@ void Union<BodyTypeTuple>::calcBoundingBox()
 {
    // Setting the bounding box of an empty union
    if( bodies_.isEmpty() ) {
-      aabb_ = math::AABB(
-            gpos_[0] - real_t(0.01),
-            gpos_[1] - real_t(0.01),
-            gpos_[2] - real_t(0.01),
-            gpos_[0] + real_t(0.01),
-            gpos_[1] + real_t(0.01),
-            gpos_[2] + real_t(0.01)
+      aabb_ = AABB(
+            gpos_[0] - pe_real_t(0.01),
+            gpos_[1] - pe_real_t(0.01),
+            gpos_[2] - pe_real_t(0.01),
+            gpos_[0] + pe_real_t(0.01),
+            gpos_[1] + pe_real_t(0.01),
+            gpos_[2] + pe_real_t(0.01)
             );
    }
 
@@ -357,8 +357,8 @@ void Union<BodyTypeTuple>::calcCenterOfMass()
    WALBERLA_ASSERT( checkInvariants(), "Invalid union state detected" );
 
    // Initializing the total mass and the inverse mass
-   mass_    = real_t(0);
-   invMass_ = real_t(0);
+   mass_    = pe_real_t(0);
+   invMass_ = pe_real_t(0);
 
    // Don't calculate the center of mass of an empty union
    if( bodies_.isEmpty() ) return;
@@ -369,8 +369,8 @@ void Union<BodyTypeTuple>::calcCenterOfMass()
       const BodyID body( bodies_[0] );
       gpos_ = body->getPosition();
       mass_ = body->getMass();
-      if( !isFixed() && mass_ > real_t(0) )
-         invMass_ = real_t(1) / mass_;
+      if( !isFixed() && mass_ > pe_real_t(0) )
+         invMass_ = pe_real_t(1) / mass_;
    }
 
    // Calculating the center of mass of a union containing several bodies
@@ -390,8 +390,8 @@ void Union<BodyTypeTuple>::calcCenterOfMass()
          }
 
          // Calculating the center of mass for unions with non-zero mass
-         if( mass_ > real_t(0) ) {
-            if( !isFixed() ) invMass_ = real_t(1) / mass_;
+         if( mass_ > pe_real_t(0) ) {
+            if( !isFixed() ) invMass_ = pe_real_t(1) / mass_;
             gpos_ /= mass_;
          }
 
@@ -441,14 +441,14 @@ void Union<BodyTypeTuple>::calcInertia()
    WALBERLA_ASSERT( checkInvariants(), "Invalid union state detected" );
 
    // Initializing the body moment of inertia and the inverse moment of inertia
-   I_    = real_t(0);
-   Iinv_ = real_t(0);
+   I_    = pe_real_t(0);
+   Iinv_ = pe_real_t(0);
 
    // Don't calculate the moment of inertia of an infinite or empty union
-   if( !isFinite() || bodies_.isEmpty() || floatIsEqual(mass_, real_t(0)) ) return;
+   if( !isFinite() || bodies_.isEmpty() || floatIsEqual(mass_, pe_real_t(0)) ) return;
 
    // Calculating the global moment of inertia
-   real_t mass;
+   pe_real_t mass;
    Vec3   pos;
 
    for( auto b=bodies_.begin(); b!=bodies_.end(); ++b )
@@ -501,7 +501,7 @@ void Union<BodyTypeTuple>::calcInertia()
  * given global coordinate.
  */
 template <typename BodyTypeTuple>
-void Union<BodyTypeTuple>::setPositionImpl( real_t px, real_t py, real_t pz )
+void Union<BodyTypeTuple>::setPositionImpl( pe_real_t px, pe_real_t py, pe_real_t pz )
 {
    Vec3 gpos = Vec3( px, py, pz );
 
@@ -539,7 +539,7 @@ void Union<BodyTypeTuple>::setPositionImpl( real_t px, real_t py, real_t pz )
  * within the union in reference to the body frame of the union is not changed.
  */
 template <typename BodyTypeTuple>
-void Union<BodyTypeTuple>::setOrientationImpl( real_t r, real_t i, real_t j, real_t k )
+void Union<BodyTypeTuple>::setOrientationImpl( pe_real_t r, pe_real_t i, pe_real_t j, pe_real_t k )
 {
    const Quat q ( r, i, j, k );
    const Quat dq( q * q_.getInverse() );
@@ -748,7 +748,7 @@ void Union<BodyTypeTuple>::add( BodyID body )
  * are moved by the same displacement.
  */
 template <typename BodyTypeTuple>
-void Union<BodyTypeTuple>::translateImpl( real_t dx, real_t dy, real_t dz )
+void Union<BodyTypeTuple>::translateImpl( pe_real_t dx, pe_real_t dy, pe_real_t dz )
 {
    Vec3 dp(dx, dy, dz);
 
@@ -888,7 +888,7 @@ void Union<BodyTypeTuple>::rotateAroundPointImpl( const Vec3& point, const Quat
  * \return \a true if the point lies inside the sphere, \a false if not.
  */
 template <typename BodyTypeTuple>
-bool Union<BodyTypeTuple>::containsRelPointImpl( real_t px, real_t py, real_t pz ) const
+bool Union<BodyTypeTuple>::containsRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    const Vec3 gpos( pointFromBFtoWF( px, py, pz ) );
    for( auto b=bodies_.begin(); b!=bodies_.end(); ++b )
@@ -909,7 +909,7 @@ bool Union<BodyTypeTuple>::containsRelPointImpl( real_t px, real_t py, real_t pz
  * The tolerance level of the check is pe::surfaceThreshold.
  */
 template <typename BodyTypeTuple>
-bool Union<BodyTypeTuple>::isSurfaceRelPointImpl( real_t px, real_t py, real_t pz ) const
+bool Union<BodyTypeTuple>::isSurfaceRelPointImpl( pe_real_t px, pe_real_t py, pe_real_t pz ) const
 {
    bool surface( false );
    const Vec3 gpos( pointFromBFtoWF( px, py, pz ) );
diff --git a/src/pe/rigidbody/UnionFactory.h b/src/pe/rigidbody/UnionFactory.h
index e237e0dd31d83642f80663ed48b7c083498cad63..aeeca9fc95c2f0f8173c801ef32fff31bd8836e0 100644
--- a/src/pe/rigidbody/UnionFactory.h
+++ b/src/pe/rigidbody/UnionFactory.h
@@ -140,7 +140,7 @@ BoxID createBox( Union<BodyTypeTuple>* un,
       throw std::logic_error( "createBox: Union is remote" );
 
    // Checking the side lengths
-   if( lengths[0] <= real_t(0) || lengths[1] <= real_t(0) || lengths[2] <= real_t(0) )
+   if( lengths[0] <= pe_real_t(0) || lengths[1] <= pe_real_t(0) || lengths[2] <= pe_real_t(0) )
       throw std::invalid_argument( "Invalid side length" );
 
    BoxID box = NULL;
@@ -192,7 +192,7 @@ BoxID createBox( Union<BodyTypeTuple>* un,
  */
 template <typename BodyTypeTuple>
 CapsuleID createCapsule( Union<BodyTypeTuple>* un,
-                         id_t uid, const Vec3& gpos, const real_t radius, const real_t length,
+                         id_t uid, const Vec3& gpos, const pe_real_t radius, const pe_real_t length,
                          MaterialID material = Material::find("iron"),
                          bool global = false, bool communicating = true, bool infiniteMass = false )
 {
@@ -255,7 +255,7 @@ CapsuleID createCapsule( Union<BodyTypeTuple>* un,
  */
 template <typename BodyTypeTuple>
 SphereID createSphere( Union<BodyTypeTuple>* un,
-                       id_t uid, const Vec3& gpos, real_t radius,
+                       id_t uid, const Vec3& gpos, pe_real_t radius,
                        MaterialID material = Material::find("iron"),
                        bool global = false, bool communicating = true, bool infiniteMass = false )
 {
diff --git a/src/pe/statistics/BodyStatistics.cpp b/src/pe/statistics/BodyStatistics.cpp
index e76910eff77b6ec92b0bb35b9e0c6414c1895a96..173ac15399b675868d7761f4d8b8e31c8c27597e 100644
--- a/src/pe/statistics/BodyStatistics.cpp
+++ b/src/pe/statistics/BodyStatistics.cpp
@@ -56,8 +56,8 @@ void BodyStatistics::operator()()
 
       for( auto bodyIt = localStorage.begin(); bodyIt != localStorage.end(); ++bodyIt )
       {
-         velocitySample_.insert( bodyIt->getLinearVel().length() );
-         massSample_.insert( bodyIt->getMass() );
+         velocitySample_.insert( real_c(bodyIt->getLinearVel().length()) );
+         massSample_.insert( real_c(bodyIt->getMass()) );
       }
    }
 
diff --git a/src/pe/statistics/BodyStatistics.h b/src/pe/statistics/BodyStatistics.h
index dacbf9585bb85dedda918cc2b058856e008f3f1c..b477e00c94567ee7a0d5e27c91d9f48093bd9a36 100644
--- a/src/pe/statistics/BodyStatistics.h
+++ b/src/pe/statistics/BodyStatistics.h
@@ -46,10 +46,10 @@ public:
 
    uint_t numBodies() const { return numBodies_; }
    uint_t numShadowCopies() const { return numShadowCopies_; }
-   real_t minVelocity() const { return velocitySample_.min(); }
-   real_t maxVelocity() const { return velocitySample_.max(); }
-   real_t avgVelocity() const { return velocitySample_.avg(); }
-   real_t totalMass() const { return massSample_.sum(); }
+   pe_real_t minVelocity() const { return velocitySample_.min(); }
+   pe_real_t maxVelocity() const { return velocitySample_.max(); }
+   pe_real_t avgVelocity() const { return velocitySample_.avg(); }
+   pe_real_t totalMass() const { return massSample_.sum(); }
 
 private:
    const shared_ptr<BlockStorage> blockStorage_;
diff --git a/src/pe/synchronization/SyncForces.h b/src/pe/synchronization/SyncForces.h
index 0bca535418797cfdfdf9f18979a169f607f80e87..822a9d737f52a3113d0f59d9c777135b60e5da55 100644
--- a/src/pe/synchronization/SyncForces.h
+++ b/src/pe/synchronization/SyncForces.h
@@ -128,7 +128,7 @@ void reduceForces( BlockStorage& blocks, BlockDataID storageID, BodyStorage& glo
    WALBERLA_LOG_DETAIL( "Sync force on global bodies..." );
    {
       size_t i;
-      std::vector<real_t> reductionBuffer( globalBodyStorage.size() * 6, real_c(0) );
+      std::vector<pe_real_t> reductionBuffer( globalBodyStorage.size() * 6, real_c(0) );
 
       i = 0;
       for( auto it = globalBodyStorage.begin(); it != globalBodyStorage.end(); ++it )
diff --git a/src/pe/synchronization/SyncNextNeighbors.h b/src/pe/synchronization/SyncNextNeighbors.h
index 56da2bc958e39edf2994882fcc9e2b69fd5d2c77..eb46044873e9669fbc0373935ebab6738c42ec7f 100644
--- a/src/pe/synchronization/SyncNextNeighbors.h
+++ b/src/pe/synchronization/SyncNextNeighbors.h
@@ -46,12 +46,12 @@ namespace walberla {
 namespace pe {
 
 template <typename BodyTypeTuple>
-void generateSynchonizationMessages(mpi::BufferSystem& bs, const Block& block, BodyStorage& localStorage, BodyStorage& shadowStorage, const real_t dx, const bool syncNonCommunicatingBodies)
+void generateSynchonizationMessages(mpi::BufferSystem& bs, const Block& block, BodyStorage& localStorage, BodyStorage& shadowStorage, const pe_real_t dx, const bool syncNonCommunicatingBodies)
 {
    using namespace walberla::pe::communication;
 
    const Owner me( int_c( mpi::MPIManager::instance()->rank() ), block.getId().getID() );
-   const math::AABB domain = block.getBlockStorage().getDomain();
+   const AABB domain = block.getBlockStorage().getDomain();
 
    WALBERLA_LOG_DETAIL( "Assembling of body synchronization message starts..." );
 
@@ -236,7 +236,7 @@ void generateSynchonizationMessages(mpi::BufferSystem& bs, const Block& block, B
 }
 
 template <typename BodyTypeTuple>
-void syncNextNeighbors( BlockForest& forest, BlockDataID storageID, WcTimingTree* tt = NULL, const real_t dx = real_t(0), const bool syncNonCommunicatingBodies = false )
+void syncNextNeighbors( BlockForest& forest, BlockDataID storageID, WcTimingTree* tt = NULL, const pe_real_t dx = pe_real_t(0), const bool syncNonCommunicatingBodies = false )
 {
    if (tt != NULL) tt->start("Sync");
    if (tt != NULL) tt->start("Assembling Body Synchronization");
diff --git a/src/pe/synchronization/SyncShadowOwners.h b/src/pe/synchronization/SyncShadowOwners.h
index e02cea958b435d39f54e749aa237c696cec6d8ca..6c67bf91f4ac2c2be3f5e54411d06a1bd5f09585 100644
--- a/src/pe/synchronization/SyncShadowOwners.h
+++ b/src/pe/synchronization/SyncShadowOwners.h
@@ -66,7 +66,7 @@ void updateAndMigrate( BlockForest& forest, BlockDataID storageID, const bool sy
       BodyStorage& shadowStorage = (*storage)[1];
 
       const Owner me( int_c( mpi::MPIManager::instance()->rank() ), block.getId().getID() );
-      const math::AABB& blkAABB = block.getAABB();
+      const AABB& blkAABB = block.getAABB();
 
       // schedule receives
       for( auto bodyIt = shadowStorage.begin(); bodyIt != shadowStorage.end(); ++bodyIt)
@@ -190,7 +190,7 @@ void updateAndMigrate( BlockForest& forest, BlockDataID storageID, const bool sy
 }
 
 template <typename BodyTypeTuple>
-void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const real_t dx, const bool syncNonCommunicatingBodies )
+void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const pe_real_t dx, const bool syncNonCommunicatingBodies )
 {
    using namespace walberla::pe::communication;
    //==========================================================
@@ -216,7 +216,7 @@ void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const r
       BodyStorage& shadowStorage = (*storage)[1];
 
       const Owner me( int_c(block.getProcess()), block.getId().getID() );
-//      const math::AABB& blkAABB = block->getAABB();
+//      const AABB& blkAABB = block->getAABB();
 
       for( auto bodyIt = localStorage.begin(); bodyIt != localStorage.end(); ++bodyIt)
       {
@@ -224,7 +224,7 @@ void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const r
 
          if( !b->isCommunicating() && !syncNonCommunicatingBodies ) continue;
 
-         bool isInsideDomain = forest.getDomain().contains( b->getAABB(), -dx );
+         bool isInsideDomain = AABB(forest.getDomain()).contains( b->getAABB(), -dx );
 
          mpi::SendBuffer& sbMaster = bs.sendBuffer(b->MPITrait.getOwner().rank_);
          if (sbMaster.isEmpty()) sbMaster << walberla::uint8_c(0);
@@ -244,7 +244,7 @@ void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const r
 //            WALBERLA_LOG_DEVEL("body AABB: " << b->getAABB());
 //            WALBERLA_LOG_DEVEL("neighbour AABB: " << block.getNeighborAABB(nb));
 
-            if( (isInsideDomain ? block.getNeighborAABB(nb).intersects( b->getAABB(), dx ) : block.getBlockStorage().periodicIntersect(block.getNeighborAABB(nb), b->getAABB(), dx)) )
+            if( (isInsideDomain ? AABB(block.getNeighborAABB(nb)).intersects( b->getAABB(), dx ) : block.getBlockStorage().periodicIntersect(block.getNeighborAABB(nb), math::AABB(b->getAABB()), real_c(dx))) )
             {
                WALBERLA_LOG_DETAIL( "Sending copy notification for body " << b->getSystemID() << " to process " << (nbProcess) << "\n master: " << b->MPITrait.getOwner());
                packNotification(me, nbProcess, sb, RigidBodyCopyNotification( *b ));
@@ -258,7 +258,7 @@ void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const r
       {
          BodyID b (*bodyIt);
          WALBERLA_ASSERT(!b->isGlobal(), "Global body in ShadowStorage!");
-         bool isInsideDomain = forest.getDomain().contains( b->getAABB(), -dx );
+         bool isInsideDomain = AABB(forest.getDomain()).contains( b->getAABB(), -dx );
 
          mpi::SendBuffer& sbMaster = bs.sendBuffer(b->MPITrait.getOwner().rank_);
          if (sbMaster.isEmpty()) sbMaster << walberla::uint8_c(0);
@@ -273,7 +273,7 @@ void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const r
 
             if (b->MPITrait.getOwner() == nbProcess) continue; // dont send to owner!!
             if (b->MPITrait.getBlockState( nbProcess.blockID_ )) continue; // only send to neighbor which do not know this body
-            if( (isInsideDomain ? block.getNeighborAABB(nb).intersects( b->getAABB(), dx ) : block.getBlockStorage().periodicIntersect(block.getNeighborAABB(nb), b->getAABB(), dx)) )
+            if( (isInsideDomain ? AABB(block.getNeighborAABB(nb)).intersects( b->getAABB(), dx ) : block.getBlockStorage().periodicIntersect(block.getNeighborAABB(nb), math::AABB(b->getAABB()), real_c(dx))) )
             {
                WALBERLA_LOG_DETAIL( "Sending copy notification for body " << b->getSystemID() << " to process " << (nbProcess) );
                packNotification(me, nbProcess, sb, RigidBodyCopyNotification( *b ));
@@ -283,7 +283,7 @@ void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const r
             }
          }
 
-         if ( !block.getAABB().intersects(b->getAABB(), dx) )
+         if ( !AABB(block.getAABB()).intersects(b->getAABB(), dx) )
          {
             // Delete
             // inform nearest neighbor processes.
@@ -357,7 +357,7 @@ void checkAndResolveOverlap( BlockForest& forest, BlockDataID storageID, const r
 }
 
 template <typename BodyTypeTuple>
-void syncShadowOwners( BlockForest& forest, BlockDataID storageID, WcTimingTree* tt = NULL, const real_t dx = real_t(0), const bool syncNonCommunicatingBodies = false )
+void syncShadowOwners( BlockForest& forest, BlockDataID storageID, WcTimingTree* tt = NULL, const pe_real_t dx = pe_real_t(0), const bool syncNonCommunicatingBodies = false )
 {
    if (tt != NULL) tt->start("Sync");
 
diff --git a/src/pe/utility/CreateWorld.cpp b/src/pe/utility/CreateWorld.cpp
index e66c76a14512120e5c72130a69ae4ab8786c3112..8c38034cbd29c633092f87914b3a0fde3bcbc3a6 100644
--- a/src/pe/utility/CreateWorld.cpp
+++ b/src/pe/utility/CreateWorld.cpp
@@ -33,7 +33,7 @@
 namespace walberla {
 namespace pe {
 
-shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
+shared_ptr<BlockForest> createBlockForest(const AABB simulationDomain,
                                           Vector3<uint_t> blocks,
                                           const Vector3<bool> isPeriodic,
                                           const uint_t numberOfProcesses)
@@ -69,7 +69,7 @@ shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
    return shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sforest, false ) );
 }
 
-shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
+shared_ptr<BlockForest> createBlockForest(const AABB simulationDomain,
                                           Vector3<uint_t> blocks,
                                           const Vector3<bool> isPeriodic,
                                           const bool setupRun,
@@ -139,7 +139,7 @@ shared_ptr<BlockForest> createBlockForestFromConfig(const Config::BlockHandle& m
    bool setupRun                 = mainConf.getParameter< bool >( "setupRun", true );
    Vec3 simulationCorner         = mainConf.getParameter<Vec3>("simulationCorner", Vec3(0, 0, 0));
    Vec3 simulationSize           = mainConf.getParameter<Vec3>("simulationDomain", Vec3(10, 10, 10));
-   math::AABB simulationDomain   = math::AABB( simulationCorner, simulationCorner + simulationSize );
+   AABB simulationDomain   = AABB( simulationCorner, simulationCorner + simulationSize );
    Vector3<uint_t> blocks        = mainConf.getParameter<Vector3<uint_t>>("blocks", Vector3<uint_t>(3, 3, 3));
    Vector3<bool> isPeriodic      = mainConf.getParameter<Vector3<bool>>("isPeriodic", Vector3<bool>(true, true, true));
    uint_t numberOfProcesses      = mainConf.getParameter<uint_t>( "numberOfProcesses",
diff --git a/src/pe/utility/CreateWorld.h b/src/pe/utility/CreateWorld.h
index 1594b8172e8b286eca664d5b6350b110d1a02965..e3363f1a988f8705624910e0cdd8f3cfb824314a 100644
--- a/src/pe/utility/CreateWorld.h
+++ b/src/pe/utility/CreateWorld.h
@@ -31,11 +31,11 @@
 namespace walberla {
 namespace pe {
 
-shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
+shared_ptr<BlockForest> createBlockForest(const AABB simulationDomain,
                                           Vector3<uint_t> blocks,
                                           const Vector3<bool> isPeriodic,
                                           const uint_t numberOfProcesses = uint_c(mpi::MPIManager::instance()->numProcesses()));
-shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
+shared_ptr<BlockForest> createBlockForest(const AABB simulationDomain,
                                           Vector3<uint_t> blocks,
                                           const Vector3<bool> isPeriodic,
                                           const bool setupRun,
diff --git a/src/pe/utility/Distance.h b/src/pe/utility/Distance.h
index 182932591f79a60f66345ee4b1cbda80f77f8561..330d40ec5b4155560293321d59eab05250911e60 100644
--- a/src/pe/utility/Distance.h
+++ b/src/pe/utility/Distance.h
@@ -52,9 +52,9 @@ namespace pe {
 //*************************************************************************************************
 /*!\name Distance calculation functions */
 //@{
-inline real_t getSurfaceDistance( ConstSphereID s1  , ConstSphereID s2   );
-inline real_t getSurfaceDistance( ConstSphereID s   , ConstPlaneID p     );
-inline real_t getSurfaceDistance( ConstPlaneID p1   , ConstPlaneID p2    );
+inline pe_real_t getSurfaceDistance( ConstSphereID s1  , ConstSphereID s2   );
+inline pe_real_t getSurfaceDistance( ConstSphereID s   , ConstPlaneID p     );
+inline pe_real_t getSurfaceDistance( ConstPlaneID p1   , ConstPlaneID p2    );
 //@}
 //*************************************************************************************************
 
@@ -69,7 +69,7 @@ inline real_t getSurfaceDistance( ConstPlaneID p1   , ConstPlaneID p2    );
  * This function returns the distance between the two spheres \a s1 and \a s2. Note that a
  * negative distance indicates that the two spheres are overlapping.
  */
-inline real_t getSurfaceDistance( ConstSphereID s1, ConstSphereID s2 )
+inline pe_real_t getSurfaceDistance( ConstSphereID s1, ConstSphereID s2 )
 {
    const Vec3 normal( s1->getPosition() - s2->getPosition() );
    return normal.length() - s1->getRadius() - s2->getRadius();
@@ -87,7 +87,7 @@ inline real_t getSurfaceDistance( ConstSphereID s1, ConstSphereID s2 )
  * This function returns the distance between the sphere \a s and the plane \a p. Note that
  * a negative distance indicates that the two bodies are overlapping.
  */
-inline real_t getSurfaceDistance( ConstSphereID s, ConstPlaneID p )
+inline pe_real_t getSurfaceDistance( ConstSphereID s, ConstPlaneID p )
 {
    return (  s->getPosition() * p->getNormal() ) - s->getRadius() - p->getDisplacement();
 }
@@ -102,13 +102,13 @@ inline real_t getSurfaceDistance( ConstSphereID s, ConstPlaneID p )
  * \return The minimum distance between the two planes.
  *
  * This function returns the distance between the two planes \a p1 and \a p2. Note that in case
- * the two (infinite) planes overlap the returned distance is -math::Limits<real_t>::inf().
+ * the two (infinite) planes overlap the returned distance is -math::Limits<pe_real_t>::inf().
  */
-inline real_t getSurfaceDistance( ConstPlaneID p1, ConstPlaneID p2 )
+inline pe_real_t getSurfaceDistance( ConstPlaneID p1, ConstPlaneID p2 )
 {
-   if( (  p1->getNormal() * p2->getNormal() ) <= real_t(1E-12-1.0) )
+   if( (  p1->getNormal() * p2->getNormal() ) <= pe_real_t(1E-12-1.0) )
       return std::fabs( p1->getDisplacement() - p2->getDisplacement() );
-   else return -math::Limits<real_t>::inf();
+   else return -math::Limits<pe_real_t>::inf();
 }
 //*************************************************************************************************
 
diff --git a/src/pe/utility/Overlap.cpp b/src/pe/utility/Overlap.cpp
index 2ed2fe1c943f3349b71d86e1917baed710194e77..6fb4db828d8aeab0a075acfc9151137b3ce64469 100644
--- a/src/pe/utility/Overlap.cpp
+++ b/src/pe/utility/Overlap.cpp
@@ -26,7 +26,7 @@
 namespace walberla {
 namespace pe {
 
-real_t getSphereSphereOverlap(const real_t d, const real_t r1, const real_t r2)
+pe_real_t getSphereSphereOverlap(const pe_real_t d, const pe_real_t r1, const pe_real_t r2)
 {
    WALBERLA_ASSERT_GREATER(d, r1);
    WALBERLA_ASSERT_GREATER(d, r2);
diff --git a/src/pe/utility/Overlap.h b/src/pe/utility/Overlap.h
index 05746fa9acd96e949abe60f8fcdf1b619e6d44e9..725cc229997b11c9cf784653f56a1da11e9c9e64 100644
--- a/src/pe/utility/Overlap.h
+++ b/src/pe/utility/Overlap.h
@@ -31,7 +31,7 @@ namespace pe {
  * \param r2 radius of sphere 2
  * \return overlap volume
  */
-real_t getSphereSphereOverlap(const real_t d, const real_t r1, const real_t r2);
+pe_real_t getSphereSphereOverlap(const pe_real_t d, const pe_real_t r1, const pe_real_t r2);
 
 }  // namespace pe
 }  // namespace walberla
diff --git a/src/pe/vtk/BodyVtkOutput.cpp b/src/pe/vtk/BodyVtkOutput.cpp
index b2e154dc1248df49ad1a76db4fbf48814beb1137..0235a2bc50c48112b8d80bb959b8409a04ed2b5a 100644
--- a/src/pe/vtk/BodyVtkOutput.cpp
+++ b/src/pe/vtk/BodyVtkOutput.cpp
@@ -62,7 +62,8 @@ std::vector< math::Vector3< real_t > > DefaultBodyVTKOutput::getPoints()
    auto resultIt = result.begin();
    for( auto it = bodies_.begin(); it != bodies_.end(); ++it, ++resultIt )
    {
-      *resultIt = (*it)->getPosition();
+      const auto & pos = (*it)->getPosition();
+      *resultIt = Vector3<real_t>( real_c(pos[0]), real_c(pos[1]), real_c(pos[2]) );
    }
    return result;
 }
diff --git a/src/pe/vtk/SphereVtkOutput.cpp b/src/pe/vtk/SphereVtkOutput.cpp
index 90672a0f60d3ae642f87d21f325a5d3fcb992e9e..3b0164ad5d265cc872e10e9c94b1f76d5ec86bb9 100644
--- a/src/pe/vtk/SphereVtkOutput.cpp
+++ b/src/pe/vtk/SphereVtkOutput.cpp
@@ -104,7 +104,8 @@ std::vector< math::Vector3< real_t > > SphereVtkOutput::getPoints()
    auto resultIt = result.begin();
    for( auto it = bodies_.begin(); it != bodies_.end(); ++it, ++resultIt )
    {
-      *resultIt = (*it)->getPosition();
+      const auto & pos = (*it)->getPosition();
+      *resultIt = Vector3<real_t>( real_c(pos[0]), real_c(pos[1]), real_c(pos[2]) );
    }
    return result;
 }
diff --git a/src/pe_coupling/geometry/PeBodyOverlapFunctions.h b/src/pe_coupling/geometry/PeBodyOverlapFunctions.h
index 8d86350d25a6bca82e69ef7d7e41947b459e600d..cfecab48d0c6fcffda01e317154db748e3fc0bd8 100644
--- a/src/pe_coupling/geometry/PeBodyOverlapFunctions.h
+++ b/src/pe_coupling/geometry/PeBodyOverlapFunctions.h
@@ -45,7 +45,7 @@ template<> inline FastOverlapResult fastOverlapCheck( const pe::Sphere & peSpher
    {
       Vector3<real_t> midPoint = peSphere.getPosition();
       const real_t oneOverSqrt3 = real_t(1) / std::sqrt( real_t(3) );
-      real_t halfBoxEdge = peSphere.getRadius() * oneOverSqrt3;
+      real_t halfBoxEdge = real_c(peSphere.getRadius()) * oneOverSqrt3;
       AABB innerBox = AABB::createFromMinMaxCorner( midPoint[0] - halfBoxEdge, midPoint[1] - halfBoxEdge, midPoint[2] - halfBoxEdge,
                                                     midPoint[0] + halfBoxEdge, midPoint[1] + halfBoxEdge, midPoint[2] + halfBoxEdge );
       if( innerBox.contains(box) )
@@ -61,15 +61,15 @@ template<> inline FastOverlapResult fastOverlapCheck( const pe::Sphere & peSpher
 {
    const real_t sqrt3half = std::sqrt( real_t(3) ) / real_t(2);
 
-   const real_t midPointDistSq = (peSphere.getPosition() - cellMidpoint).sqrLength();
+   const real_t midPointDistSq = real_c((peSphere.getPosition() - cellMidpoint).sqrLength());
 
    // Check against outer circle of box
-   const real_t dist1 = peSphere.getRadius() + sqrt3half * dx;
+   const real_t dist1 = real_c(peSphere.getRadius()) + sqrt3half * dx;
    if ( midPointDistSq > dist1 * dist1 )
       return COMPLETELY_OUTSIDE;
 
    // Check against inner circle of box
-   const real_t dist2 = peSphere.getRadius() - sqrt3half * dx;
+   const real_t dist2 = real_c(peSphere.getRadius()) - sqrt3half * dx;
    if ( midPointDistSq < dist2 * dist2 )
       return CONTAINED_INSIDE_BODY;
 
diff --git a/src/pe_coupling/momentum_exchange_method/boundary/SimpleBB.h b/src/pe_coupling/momentum_exchange_method/boundary/SimpleBB.h
index 161dfc872e1094df917d2394048790afdf52da92..a519501399156c5f7ad9e2c3c073315a3aad2207 100644
--- a/src/pe_coupling/momentum_exchange_method/boundary/SimpleBB.h
+++ b/src/pe_coupling/momentum_exchange_method/boundary/SimpleBB.h
@@ -174,16 +174,16 @@ inline void SimpleBB< LatticeModel_T, FlagField_T >::treatDirection( const cell_
    {
        const auto density  = pdfField_->getDensity(x,y,z);
        pdf_new -= real_c(3.0) * alpha * density * LatticeModel_T::w[ Stencil_T::idx[dir] ] *
-                     ( real_c( stencil::cx[ dir ] ) * boundaryVelocity[0] +
-                       real_c( stencil::cy[ dir ] ) * boundaryVelocity[1] +
-                       real_c( stencil::cz[ dir ] ) * boundaryVelocity[2] );
+                     ( real_c( stencil::cx[ dir ] ) * real_c(boundaryVelocity[0]) +
+                       real_c( stencil::cy[ dir ] ) * real_c(boundaryVelocity[1]) +
+                       real_c( stencil::cz[ dir ] ) * real_c(boundaryVelocity[2]) );
    }
    else
    {
        pdf_new -= real_c(3.0) * alpha * LatticeModel_T::w[ Stencil_T::idx[dir] ] *
-                     ( real_c( stencil::cx[ dir ] ) * boundaryVelocity[0] +
-                       real_c( stencil::cy[ dir ] ) * boundaryVelocity[1] +
-                       real_c( stencil::cz[ dir ] ) * boundaryVelocity[2] );
+                     ( real_c( stencil::cx[ dir ] ) * real_c(boundaryVelocity[0]) +
+                       real_c( stencil::cy[ dir ] ) * real_c(boundaryVelocity[1]) +
+                       real_c( stencil::cz[ dir ] ) * real_c(boundaryVelocity[2]) );
    }
 
    // carry out the boundary handling
@@ -207,9 +207,9 @@ inline void SimpleBB< LatticeModel_T, FlagField_T >::treatDirection( const cell_
 
 
    // force consists of the MEM part and the galilean invariance correction including the boundary velocity
-   Vector3<real_t> force( real_c( stencil::cx[dir] ) * forceMEM - correction * boundaryVelocity[0],
-                          real_c( stencil::cy[dir] ) * forceMEM - correction * boundaryVelocity[1],
-                          real_c( stencil::cz[dir] ) * forceMEM - correction * boundaryVelocity[2] );
+   Vector3<real_t> force( real_c( stencil::cx[dir] ) * forceMEM - correction * real_c(boundaryVelocity[0]),
+                          real_c( stencil::cy[dir] ) * forceMEM - correction * real_c(boundaryVelocity[1]),
+                          real_c( stencil::cz[dir] ) * forceMEM - correction * real_c(boundaryVelocity[2]) );
 
 
    force *= forceScalingFactor_;
diff --git a/src/pe_coupling/momentum_exchange_method/restoration/Reconstructor.h b/src/pe_coupling/momentum_exchange_method/restoration/Reconstructor.h
index f6234295821421e268ecf8ab4c44bd889227333e..032c5368cfb97f9bf68b3c3c87f4420b3dfd0989 100644
--- a/src/pe_coupling/momentum_exchange_method/restoration/Reconstructor.h
+++ b/src/pe_coupling/momentum_exchange_method/restoration/Reconstructor.h
@@ -121,7 +121,7 @@ void EquilibriumReconstructor< LatticeModel_T, BoundaryHandling_T >
    blockStorage_->getBlockLocalCellCenter( *block, Cell(x,y,z), cx, cy, cz );
    const auto velocity = (*bodyField)(x,y,z)->velFromWF(cx,cy,cz);
 
-   pdfField->setToEquilibrium( x, y, z, Vector3< real_t >( velocity[0], velocity[1], velocity[2] ), averageDensity );
+   pdfField->setToEquilibrium( x, y, z, Vector3< real_t >( real_c(velocity[0]), real_c(velocity[1]), real_c(velocity[2]) ), averageDensity );
 }
 
 template< typename LatticeModel_T, typename BoundaryHandling_T >
diff --git a/src/pe_coupling/utility/TimeStep.h b/src/pe_coupling/utility/TimeStep.h
index b282766b3e69810d8f7e56fd94b60ec3778ebbce..7de78797a4c999847362d734503b03daf53fe9a3 100644
--- a/src/pe_coupling/utility/TimeStep.h
+++ b/src/pe_coupling/utility/TimeStep.h
@@ -80,14 +80,14 @@ public:
                     auto & f = forceMap[ bodyIt->getSystemID() ];
 
                     const auto & force = bodyIt->getForce();
-                    f.push_back( force[0] );
-                    f.push_back( force[1] );
-                    f.push_back( force[2] );
+                    f.push_back( real_c( force[0] ) );
+                    f.push_back( real_c( force[1] ) );
+                    f.push_back( real_c( force[2] ) );
 
                     const auto & torque = bodyIt->getTorque();
-                    f.push_back( torque[0] );
-                    f.push_back( torque[1] );
-                    f.push_back( torque[2] );
+                    f.push_back( real_c( torque[0] ) );
+                    f.push_back( real_c( torque[1] ) );
+                    f.push_back( real_c( torque[2] ) );
 
                     if ( bodyIt->isRemote() )
                     {
diff --git a/src/waLBerlaDefinitions.in.h b/src/waLBerlaDefinitions.in.h
index ce7d276a134dde5f7a933952738b668d2453f4e6..e8660e495301af935d8762f9695b46d7fff29e18 100644
--- a/src/waLBerlaDefinitions.in.h
+++ b/src/waLBerlaDefinitions.in.h
@@ -12,6 +12,7 @@
 
 // double or single precision
 #cmakedefine WALBERLA_DOUBLE_ACCURACY
+#cmakedefine WALBERLA_PE_DOUBLE_ACCURACY
 
 
 // Debugging options