///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2020- Equinor AS // // ResInsight 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. // // ResInsight 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 at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaDefines.h" #include #include class RigWellPath; template class RiaWellLogUnitTools { public: static const FloatType gravityAcceleration(); static const FloatType unitWeightOfWater(); static bool stringsMatch( const QString& lhs, const QString& rhs ); static QString noUnitString(); static QString sg_emwUnitString(); static QString barUnitString(); static QString barX100UnitString(); static QString MPaUnitString(); static QString gPerCm3UnitString(); static QString kgPerM3UnitString(); static QString pascalUnitString(); static QString pascalUnitStringShort(); public: static std::vector convertDepths( const std::vector& depthsIn, RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut ); static std::vector> convertDepths( const std::vector>& depthsIn, RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut ); static FloatType convertDepth( FloatType depthIn, RiaDefines::DepthUnitType unitsIn, RiaDefines::DepthUnitType unitsOut ); static bool convertValues( const std::vector& tvdRKBs, const std::vector& valuesIn, std::vector* valuesOut, const QString& unitsIn, const QString& unitsOut ); static bool convertValues( std::vector>* measuredDepthsAndValues, const QString& unitsIn, const QString& unitsOut, const RigWellPath* wellPath ); static std::vector tvdRKBs( const std::vector& measuredDepths, const RigWellPath* wellPath ); // Supported conversions static std::vector convertGpcm3ToBar( const std::vector& tvdRKBs, const std::vector& valuesInGpcm3 ); static std::vector convertBarToGpcm3( const std::vector& tvdRKBs, const std::vector& valuesInBar ); static std::vector convertNormalizedByPPToBar( const std::vector& tvdRKBs, const std::vector& valuesInBar ); static std::vector convertBarToNormalizedByPP( const std::vector& tvdRKBs, const std::vector& valuesInBar ); static std::vector multiply( const std::vector& values, FloatType factor ); static FloatType pascalPerBar(); static FloatType MPaPerBar(); static FloatType hydrostaticPorePressureBar( FloatType tvdRKB ); }; #include "RiaWellLogUnitTools.inl"