mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #513 from atgeirr/add-moduleversion
Add moduleVersion() utility and update dune.version.
This commit is contained in:
commit
0ffcaeb9f0
@ -34,6 +34,7 @@ list (APPEND MAIN_SOURCE_FILES
|
||||
opm/autodiff/NewtonIterationUtilities.cpp
|
||||
opm/autodiff/GridHelpers.cpp
|
||||
opm/autodiff/ImpesTPFAAD.cpp
|
||||
opm/autodiff/moduleVersion.cpp
|
||||
opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp
|
||||
opm/autodiff/SimulatorIncompTwophaseAd.cpp
|
||||
opm/autodiff/TransportSolverTwophaseAd.cpp
|
||||
@ -118,6 +119,7 @@ list (APPEND PUBLIC_HEADER_FILES
|
||||
opm/autodiff/GeoProps.hpp
|
||||
opm/autodiff/GridHelpers.hpp
|
||||
opm/autodiff/ImpesTPFAAD.hpp
|
||||
opm/autodiff/moduleVersion.hpp
|
||||
opm/autodiff/NewtonIterationBlackoilCPR.hpp
|
||||
opm/autodiff/NewtonIterationBlackoilInterface.hpp
|
||||
opm/autodiff/NewtonIterationBlackoilInterleaved.hpp
|
||||
|
@ -1,7 +1,7 @@
|
||||
Module: opm-autodiff
|
||||
Description: Utilities for automatic differentiation and simulators based on AD
|
||||
Version: 0.9
|
||||
Label: 2013.10
|
||||
Version: 2016.04-pre
|
||||
Label: 2016.04-pre
|
||||
Maintainer: atgeirr@sintef.no
|
||||
Depends: opm-common opm-core dune-istl (>=2.2)
|
||||
Suggests: dune-cornerpoint
|
||||
Depends: opm-common opm-material opm-core dune-cornerpoint dune-istl (>=2.2)
|
||||
Suggests:
|
||||
|
@ -80,6 +80,7 @@
|
||||
#include <opm/autodiff/SimulatorFullyImplicitBlackoil.hpp>
|
||||
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
|
||||
#include <opm/autodiff/RedistributeDataHandles.hpp>
|
||||
#include <opm/autodiff/moduleVersion.hpp>
|
||||
|
||||
#include <opm/core/utility/share_obj.hpp>
|
||||
|
||||
@ -143,9 +144,11 @@ try
|
||||
|
||||
if (output_cout)
|
||||
{
|
||||
std::string version = moduleVersionName();
|
||||
std::cout << "**********************************************************************\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "* This is Flow (version 2015.04) *\n";
|
||||
std::cout << "* This is Flow (version " << version << ")"
|
||||
<< std::string(26 - version.size(), ' ') << "*\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "* Flow is a simulator for fully implicit three-phase black-oil flow, *\n";
|
||||
std::cout << "* and is part of OPM. For more information see: *\n";
|
||||
|
@ -81,6 +81,7 @@
|
||||
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
|
||||
#include <opm/autodiff/SolventPropsAdFromDeck.hpp>
|
||||
#include <opm/autodiff/RedistributeDataHandles.hpp>
|
||||
#include <opm/autodiff/moduleVersion.hpp>
|
||||
|
||||
#include <opm/core/utility/share_obj.hpp>
|
||||
|
||||
@ -140,12 +141,14 @@ try
|
||||
|
||||
if (output_cout)
|
||||
{
|
||||
std::string version = moduleVersionName();
|
||||
std::cout << "**********************************************************************\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "* This is Flow-Solvent (version XXXX.XX) *\n";
|
||||
std::cout << "* This is Flow-Solvent (version " << version << ")"
|
||||
<< std::string(18 - version.size(), ' ') << "*\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "* Flow-Solvent is a simulator for fully implicit three-phase, *\n";
|
||||
std::cout << "* forth component (black-oil + solvent) flow, and is part of OPM. *\n";
|
||||
std::cout << "* four-component (black-oil + solvent) flow, and is part of OPM. *\n";
|
||||
std::cout << "* For more information see http://opm-project.org *\n";
|
||||
std::cout << "* *\n";
|
||||
std::cout << "**********************************************************************\n\n";
|
||||
|
49
opm/autodiff/moduleVersion.cpp
Normal file
49
opm/autodiff/moduleVersion.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 2015 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/autodiff/moduleVersion.hpp>
|
||||
#include "project-version.h"
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
/// Return the version name of the module, for example "2015.10"
|
||||
/// (for a release branch) or "2016.04-pre" (for a master branch).
|
||||
std::string moduleVersionName()
|
||||
{
|
||||
return PROJECT_VERSION_NAME;
|
||||
}
|
||||
|
||||
/// Return a (short) git hash for the current version of the
|
||||
/// module if this is a Release build (as defined by CMake), or
|
||||
/// "debug" for Debug builds.
|
||||
std::string moduleVersionHash()
|
||||
{
|
||||
return PROJECT_VERSION_HASH;
|
||||
}
|
||||
|
||||
/// Return a string containing both the name and hash, if N is the
|
||||
/// name and H is the hash it will be "N (H)". For example
|
||||
/// "2016.04-pre (f15be17)" or "2016.04-pre (debug)".
|
||||
std::string moduleVersion()
|
||||
{
|
||||
return PROJECT_VERSION;
|
||||
}
|
||||
|
||||
} // namespace Opm
|
44
opm/autodiff/moduleVersion.hpp
Normal file
44
opm/autodiff/moduleVersion.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 2015 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_MODULEVERSION_HEADER_INCLUDED
|
||||
#define OPM_MODULEVERSION_HEADER_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
/// Return the version name of the module, for example "2015.10"
|
||||
/// (for a release branch) or "2016.04-pre" (for a master branch).
|
||||
std::string moduleVersionName();
|
||||
|
||||
/// Return a (short) git hash for the current version of the
|
||||
/// module if this is a Release build (as defined by CMake), or
|
||||
/// "debug" for Debug builds.
|
||||
std::string moduleVersionHash();
|
||||
|
||||
/// Return a string containing both the name and hash, if N is the
|
||||
/// name and H is the hash it will be "N (H)". For example
|
||||
/// "2016.04-pre (f15be17)" or "2016.04-pre (debug)".
|
||||
std::string moduleVersion();
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPM_MODULEVERSION_HEADER_INCLUDED
|
Loading…
Reference in New Issue
Block a user