fully move the units code from opm-core to opm-parser

this fixes some annoying inconsistencies (e.g., the recently
introduced 'dyne' unit was unavailable in the opm-core version) and
gets rid of some compiler abiguity errors if 'using namespace
Opm::details' was used by code inside the 'Opm' namespace.

Since opm-parser is a hard dependency of opm-core, the only measure
which must be taken by higher-level code is to include
'opm/parser/eclipse/Units/Units.hpp' instead of
'opm/parser/eclipse/Units/ConversionFactors.hpp' or
'opm/core/utility/Units.hpp'.

Note that a potentially better location for this code would be
opm-common, but this would break the Windows build of opm-parser.
This commit is contained in:
Andreas Lauser
2016-10-10 15:41:19 +02:00
parent 0680e64b03
commit a8b6047b1d
17 changed files with 352 additions and 289 deletions

View File

@@ -28,7 +28,7 @@
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
#include <opm/parser/eclipse/Units/ConversionFactors.hpp>
#include <opm/parser/eclipse/Units/Units.hpp>
using namespace Opm;
@@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE( EquilOperations ) {
const auto& record = equil.getRecord( 0 );
BOOST_CHECK_CLOSE( 2469, record.datumDepth(), 1e-12 );
BOOST_CHECK_CLOSE( 382.4 * details::unit::barsa, record.datumDepthPressure(), 1e-12 );
BOOST_CHECK_CLOSE( 382.4 * unit::barsa, record.datumDepthPressure(), 1e-12 );
BOOST_CHECK_CLOSE( 1705.0, record.waterOilContactDepth(), 1e-12 );
BOOST_CHECK_CLOSE( 0.0, record.waterOilContactCapillaryPressure(), 1e-12 );
BOOST_CHECK_CLOSE( 500, record.gasOilContactDepth(), 1e-12 );