mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve MSW export including multi lateral wells
Based on branch https://github.com/OPM/ResInsight/tree/system-msw-refactor - Move completion settings to property of well path - Rename to RimFishbones - Export implicit COMPSEGS for fishbones main bore - Add valve for each branch - Increase version number to be able to handle import of legacy project files
This commit is contained in:
@@ -28,8 +28,8 @@ bool RiaProjectFileVersionTools::isCandidateVersionNewerThanOther( const QString
|
||||
{
|
||||
int candidateMajorVersion = 0;
|
||||
int candidateMinorVersion = 0;
|
||||
int candidatePatchNumber = 0;
|
||||
int candidateDevelopmentId = 0;
|
||||
int candidatePatchNumber = -1;
|
||||
int candidateDevelopmentId = -1;
|
||||
|
||||
RiaProjectFileVersionTools::decodeVersionString( candidateProjectFileVersion,
|
||||
&candidateMajorVersion,
|
||||
@@ -39,8 +39,8 @@ bool RiaProjectFileVersionTools::isCandidateVersionNewerThanOther( const QString
|
||||
|
||||
int majorVersion = 0;
|
||||
int minorVersion = 0;
|
||||
int patchNumber = 0;
|
||||
int developmentId = 0;
|
||||
int patchNumber = -1;
|
||||
int developmentId = -1;
|
||||
|
||||
RiaProjectFileVersionTools::decodeVersionString( projectFileVersion,
|
||||
&majorVersion,
|
||||
@@ -120,11 +120,17 @@ bool RiaProjectFileVersionTools::isCandidateNewerThanOther( int candidateMajorVe
|
||||
return ( candidateMinorVersion > otherMinorVersion );
|
||||
}
|
||||
|
||||
// Early exit if a patch number is undefined
|
||||
if ( candidatePatchNumber == -1 || otherPatchNumber == -1 ) return false;
|
||||
|
||||
if ( candidatePatchNumber != otherPatchNumber )
|
||||
{
|
||||
return ( candidatePatchNumber > otherPatchNumber );
|
||||
}
|
||||
|
||||
// Early exit if a development number is undefined
|
||||
if ( candidateDevelopmentId == -1 && otherDevelopmentId == -1 ) return false;
|
||||
|
||||
if ( candidateDevelopmentId != otherDevelopmentId )
|
||||
{
|
||||
return ( candidateDevelopmentId > otherDevelopmentId );
|
||||
|
||||
@@ -86,6 +86,37 @@ QString RiaTextStringTools::commonRoot( const QStringList& stringList )
|
||||
return root;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaTextStringTools::commonSuffix( const QStringList& stringList )
|
||||
{
|
||||
QString suffix;
|
||||
if ( !stringList.isEmpty() )
|
||||
{
|
||||
suffix = stringList.back();
|
||||
for ( const auto& item : stringList )
|
||||
{
|
||||
if ( suffix.length() > item.length() )
|
||||
{
|
||||
suffix = suffix.right( item.length() );
|
||||
}
|
||||
|
||||
for ( int i = 0; i < suffix.length(); i++ )
|
||||
{
|
||||
int suffixIndex = suffix.length() - i - 1;
|
||||
int itemIndex = item.length() - i - 1;
|
||||
if ( suffix[suffixIndex] != item[itemIndex] )
|
||||
{
|
||||
suffix = suffix.right( i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return suffix;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -29,5 +29,6 @@ namespace RiaTextStringTools
|
||||
bool compare( const QString& expected, const QString& actual );
|
||||
QString trimAndRemoveDoubleSpaces( const QString& s );
|
||||
QString commonRoot( const QStringList& stringList );
|
||||
QString commonSuffix( const QStringList& stringList );
|
||||
QString trimNonAlphaNumericCharacters( const QString& s );
|
||||
} // namespace RiaTextStringTools
|
||||
|
||||
@@ -81,7 +81,7 @@ void RiaPolyArcLineSampler::sampleSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Ve
|
||||
|
||||
CVF_ASSERT( p1p2.lengthSquared() > 1e-20 );
|
||||
|
||||
if ( cvf::GeometryTools::getAngle( t1, p1p2 ) < 1e-5 )
|
||||
if ( cvf::GeometryTools::getAngle( t1, p1p2 ) < 1e-5 || p1p2.length() < m_maxSamplingsInterval )
|
||||
{
|
||||
sampleLine( p1, p2, endTangent );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user