Improved ODB support (#8046)

* Experiments for supporting visualization of new ODB files from WIA workflow

* Some more experiments to get odb working for wia results

* More work in progress, experimenting to get wellIA result files to load properly

* Make sure all part geometries use the same global bounding box

* Clean up code

* Add some safeguards for data calculations
Move parts below grid in project tree

* Fix warnings

* Add support for C3D8RT elements
Add some more safeguards for missing data
Remove strange part handling

* Support elements with reduced number of integration points by pretending to have 8.

* Change integration point mapping to correct order (ref. Stein and Abaqus 2019 doc)

* Do not allocate too much memory for element nodal results for 20 element node types

* Code cleanup.
Revert back to old integration point numbering scheme (ref. Stein)

* And, another integration point order update...

* Update comments
This commit is contained in:
jonjenssen
2021-09-27 12:44:29 +02:00
committed by GitHub
parent ed2beec359
commit d09ae4e1cb
26 changed files with 539 additions and 123 deletions

View File

@@ -7,6 +7,8 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapProjection.h
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapView.h
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPartCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPart.h
)
set(SOURCE_GROUP_SOURCE_FILES
@@ -18,6 +20,8 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapProjection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapView.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPartCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPart.cpp
)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})

View File

@@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimGeoMechPart.h"
#include "RimGeoMechView.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObjectScriptingCapability.h"
CAF_PDM_SOURCE_INIT( RimGeoMechPart, "GeoMechPart" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechPart::RimGeoMechPart()
{
CAF_PDM_InitScriptableObject( "GeoMechPart", ":/GeoMechCase24x24.png", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_partId, "PartId", "Part Id", "", "", "" );
m_partId.uiCapability()->setUiReadOnly( true );
nameField()->uiCapability()->setUiReadOnly( true );
setDeletable( false );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechPart::~RimGeoMechPart()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechPart::setPartId( int partId )
{
m_partId = partId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimGeoMechPart::partId() const
{
return m_partId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechPart::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
updateUiIconFromToggleField();
if ( changedField == objectToggleField() )
{
RimGeoMechView* ownerView;
firstAncestorOrThisOfType( ownerView );
if ( ownerView ) ownerView->scheduleCreateDisplayModelAndRedraw();
}
}

View File

@@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimCheckableNamedObject.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
class RimGeoMechPart : public RimCheckableNamedObject
{
CAF_PDM_HEADER_INIT;
public:
RimGeoMechPart();
~RimGeoMechPart() override;
void setPartId( int partId );
int partId() const;
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
private:
caf::PdmField<int> m_partId;
};

View File

@@ -0,0 +1,112 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimGeoMechPartCollection.h"
#include "RigFemPartCollection.h"
#include "RigGeoMechCaseData.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechPart.h"
#include "RiaLogging.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObjectScriptingCapability.h"
CAF_PDM_SOURCE_INIT( RimGeoMechPartCollection, "GeoMechPartCollection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechPartCollection::RimGeoMechPartCollection()
: m_case( nullptr )
{
CAF_PDM_InitScriptableObject( "Parts", ":/GeoMechCase24x24.png", "", "" );
CAF_PDM_InitScriptableFieldNoDefault( &m_parts, "Parts", "Parts", "", "", "" );
m_parts.uiCapability()->setUiTreeHidden( true );
setDeletable( false );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechPartCollection::~RimGeoMechPartCollection()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechPartCollection::syncWithCase( RimGeoMechCase* geoCase )
{
m_case = geoCase;
if ( geoCase && geoCase->geoMechData() && geoCase->geoMechData()->femParts() )
{
const int count = geoCase->geoMechData()->femParts()->partCount();
if ( count != (int)m_parts.size() )
{
m_parts.clear();
for ( int i = 0; i < count; i++ )
{
const auto& femPart = geoCase->geoMechData()->femParts()->part( i );
RimGeoMechPart* part = new RimGeoMechPart();
part->setPartId( i );
part->setName( QString( femPart->name().c_str() ) );
part->setCheckState( femPart->enabled() );
m_parts.push_back( part );
}
}
}
updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimGeoMechPart*> RimGeoMechPartCollection::parts() const
{
return m_parts.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGeoMechPartCollection::shouldBeVisibleInTree() const
{
return m_parts.size() > 1;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGeoMechPartCollection::isPartEnabled( int partId ) const
{
for ( const auto& part : m_parts )
{
if ( part->partId() == partId ) return part->isChecked();
}
return false;
}

View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
class RimGeoMechPart;
class RimGeoMechCase;
class RimGeoMechPartCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimGeoMechPartCollection();
~RimGeoMechPartCollection() override;
void syncWithCase( RimGeoMechCase* geoCase );
bool shouldBeVisibleInTree() const;
bool isPartEnabled( int partId ) const;
std::vector<RimGeoMechPart*> parts() const;
private:
caf::PdmChildArrayField<RimGeoMechPart*> m_parts;
RimGeoMechCase* m_case;
};

View File

@@ -37,6 +37,8 @@
#include "RimEclipseView.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechCellColors.h"
#include "RimGeoMechPart.h"
#include "RimGeoMechPartCollection.h"
#include "RimGeoMechPropertyFilterCollection.h"
#include "RimGridCollection.h"
#include "RimIntersectionCollection.h"
@@ -96,6 +98,10 @@ RimGeoMechView::RimGeoMechView( void )
m_propertyFilterCollection = new RimGeoMechPropertyFilterCollection();
m_propertyFilterCollection.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_partsCollection, "Parts", "Parts", "", "", "" );
m_partsCollection = new RimGeoMechPartCollection();
m_partsCollection.uiCapability()->setUiHidden( true );
m_scaleTransform = new cvf::Transform();
m_vizLogic = new RivGeoMechVizLogic( this );
m_tensorPartMgr = new RivTensorResultPartMgr( this );
@@ -175,7 +181,9 @@ void RimGeoMechView::onLoadDataAndUpdate()
this->geoMechPropertyFilterCollection()->loadAndInitializePropertyFilters();
m_wellMeasurementCollection->syncWithChangesInWellMeasurementCollection();
if ( this->m_surfaceCollection ) this->m_surfaceCollection->loadData();
if ( m_surfaceCollection ) m_surfaceCollection->loadData();
if ( m_partsCollection ) m_partsCollection->syncWithCase( m_geomechCase );
this->scheduleCreateDisplayModelAndRedraw();
@@ -184,8 +192,6 @@ void RimGeoMechView::onLoadDataAndUpdate()
//--------------------------------------------------------------------------------------------------
///
/// Todo: Work in progress
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::onUpdateScaleTransform()
@@ -244,10 +250,16 @@ void RimGeoMechView::onCreateDisplayModel()
if ( !( m_geomechCase && m_geomechCase->geoMechData() && m_geomechCase->geoMechData()->femParts() ) ) return;
int partCount = m_geomechCase->geoMechData()->femParts()->partCount();
const auto& theParts = femParts();
int partCount = theParts->partCount();
if ( partCount <= 0 ) return;
for ( int i = 0; i < partCount; i++ )
{
theParts->part( i )->setEnabled( m_partsCollection()->isPartEnabled( i ) );
}
// Remove all existing animation frames from the viewer.
// The parts are still cached in the RivReservoir geometry and friends
@@ -956,6 +968,7 @@ void RimGeoMechView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
{
uiTreeOrdering.add( m_overlayInfoConfig() );
uiTreeOrdering.add( m_gridCollection() );
if ( m_partsCollection->shouldBeVisibleInTree() ) uiTreeOrdering.add( m_partsCollection() );
uiTreeOrdering.add( cellResult() );
uiTreeOrdering.add( m_tensorResults() );
@@ -986,3 +999,11 @@ const RimPropertyFilterCollection* RimGeoMechView::propertyFilterCollection() co
{
return geoMechPropertyFilterCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RimGeoMechPartCollection* RimGeoMechView::partsCollection() const
{
return m_partsCollection();
}

View File

@@ -45,6 +45,7 @@ class RiuViewer;
class RivGeoMechPartMgr;
class RivGeoMechVizLogic;
class RivTensorResultPartMgr;
class RimGeoMechPartCollection;
namespace cvf
{
@@ -73,6 +74,8 @@ public:
const RimPropertyFilterCollection* propertyFilterCollection() const override;
const RimGeoMechPartCollection* partsCollection() const;
RimGeoMechPropertyFilterCollection* geoMechPropertyFilterCollection();
const RimGeoMechPropertyFilterCollection* geoMechPropertyFilterCollection() const;
void setOverridePropertyFilterCollection( RimGeoMechPropertyFilterCollection* pfc );
@@ -133,6 +136,7 @@ private:
caf::PdmChildField<RimTensorResults*> m_tensorResults;
caf::PdmChildField<RimGeoMechPropertyFilterCollection*> m_propertyFilterCollection;
caf::PdmPointer<RimGeoMechPropertyFilterCollection> m_overridePropertyFilterCollection;
caf::PdmChildField<RimGeoMechPartCollection*> m_partsCollection;
caf::PdmPointer<RimGeoMechCase> m_geomechCase;
cvf::ref<RivGeoMechVizLogic> m_vizLogic;