diff --git a/ProcessLib/Deformation/GMatrixPolicy.h b/ProcessLib/Deformation/GMatrixPolicy.h
index b53772eeaeff13f74913c8140c447f6ca6951669..5d650a48c6c3b4b738c3c808dcb06b841b57fa1e 100644
--- a/ProcessLib/Deformation/GMatrixPolicy.h
+++ b/ProcessLib/Deformation/GMatrixPolicy.h
@@ -10,6 +10,7 @@
 
 #pragma once
 
+#include "MathLib/VectorizedTensor.h"
 #include "NumLib/Fem/ShapeMatrixPolicy.h"
 
 namespace ProcessLib
@@ -37,11 +38,10 @@ private:
 public:
     // For the 2D case the 33-component is needed (and the four entries
     // of the non-symmetric matrix); In 3d there are nine entries.
-    using GradientMatrixType = MatrixType<DisplacementDim * DisplacementDim +
-                                              (DisplacementDim == 2 ? 1 : 0),
-                                          _number_of_dof>;
+    using GradientMatrixType =
+        MatrixType<MathLib::VectorizedTensor::size(DisplacementDim),
+                   _number_of_dof>;
     using GradientVectorType =
-        VectorTypeFixedSize<DisplacementDim * DisplacementDim +
-                            (DisplacementDim == 2 ? 1 : 0)>;
+        VectorTypeFixedSize<MathLib::VectorizedTensor::size(DisplacementDim)>;
 };
 }  // namespace ProcessLib