From c22f4bb091d93ccba61fe2581e1209a18f4a4c25 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Tue, 21 Mar 2017 14:31:38 +0100
Subject: [PATCH] [el2p] Use the more elegant/typesafe std::string version

(cherry picked from commit 6dc626cda2cbaf761dd704dca461e65c20de214c)
---
 dumux/geomechanics/el1p2c/model.hh | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/dumux/geomechanics/el1p2c/model.hh b/dumux/geomechanics/el1p2c/model.hh
index 4c76185bfa..3fc84a1acb 100644
--- a/dumux/geomechanics/el1p2c/model.hh
+++ b/dumux/geomechanics/el1p2c/model.hh
@@ -469,17 +469,10 @@ public:
 
         writer.attachVertexData(pressure, "P");
 
-        char nameMoleFraction0[42], nameMoleFraction1[42];
-        snprintf(nameMoleFraction0, 42, "x_%s", FluidSystem::componentName(0));
-        snprintf(nameMoleFraction1, 42, "x_%s", FluidSystem::componentName(1));
-        writer.attachVertexData(moleFraction0, nameMoleFraction0);
-        writer.attachVertexData(moleFraction1, nameMoleFraction1);
-
-        char nameMassFraction0[42], nameMassFraction1[42];
-        snprintf(nameMassFraction0, 42, "X_%s", FluidSystem::componentName(0));
-        snprintf(nameMassFraction1, 42, "X_%s", FluidSystem::componentName(1));
-        writer.attachVertexData(massFraction0, nameMassFraction0);
-        writer.attachVertexData(massFraction1, nameMassFraction1);
+        writer.attachVertexData(moleFraction0, "x_" + FluidSystem::componentName(0));
+        writer.attachVertexData(moleFraction1, "x_" + FluidSystem::componentName(1));
+        writer.attachVertexData(massFraction0, "X_" + FluidSystem::componentName(0));
+        writer.attachVertexData(massFraction1, "X_" + FluidSystem::componentName(1));
 
         writer.attachVertexData(displacement, "u", dim);
         writer.attachVertexData(density, "rho");
-- 
GitLab