From b2fc614468f66dc789373eda2835efb2cdc98b95 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Mon, 19 Feb 2018 12:42:43 +0100 Subject: [PATCH] [PL] Output; Add OGS_VERSION field data. --- ProcessLib/Output/ProcessOutput.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ProcessLib/Output/ProcessOutput.cpp b/ProcessLib/Output/ProcessOutput.cpp index 7bfcc83ccfd..db46a973710 100644 --- a/ProcessLib/Output/ProcessOutput.cpp +++ b/ProcessLib/Output/ProcessOutput.cpp @@ -9,9 +9,21 @@ #include "ProcessOutput.h" +#include "BaseLib/BuildInfo.h" #include "MeshLib/IO/VtkIO/VtuInterface.h" #include "NumLib/DOF/LocalToGlobalIndexMap.h" +/// Copies the ogs_version string containing the release number and the git +/// hash. +static void addOgsVersion(MeshLib::Mesh& mesh) +{ + auto& ogs_version_field = *MeshLib::getOrCreateMeshProperty<char>( + mesh, "OGS_VERSION", MeshLib::MeshItemType::IntegrationPoint, 1); + + ogs_version_field.assign(BaseLib::BuildInfo::ogs_version.begin(), + BaseLib::BuildInfo::ogs_version.end()); +} + #ifndef USE_PETSC // Not used in PETSc case static void addSecondaryVariableNodes( double const t, @@ -119,6 +131,8 @@ void processOutputData( { DBUG("Process output data."); + addOgsVersion(mesh); + // Copy result #ifdef USE_PETSC // TODO It is also possible directly to copy the data for single process -- GitLab