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

@@ -115,6 +115,8 @@ private:
const std::vector<float>& values = m_resultsData->resultValues( m_resVarAddr, pIdx, (int)timeStepIndex );
int elmCount = part->elementCount();
if ( values.empty() ) continue;
for ( int elmIdx = 0; elmIdx < elmCount; ++elmIdx )
{
if ( !( *m_cellVisibilities )[elmIdx] ) continue;

View File

@@ -29,6 +29,7 @@
RigFemPart::RigFemPart()
: m_elementPartId( -1 )
, m_characteristicElementSize( std::numeric_limits<float>::infinity() )
, m_enabled( true )
{
}
@@ -409,7 +410,7 @@ float RigFemPart::characteristicElementSize() const
{
RigElementType eType = this->elementType( elmIdx );
if ( eType == HEX8P )
if ( ( eType == HEX8P ) || ( eType == HEX8 ) )
{
const int* elementConn = this->connectivities( elmIdx );
cvf::Vec3f nodePos0 = this->nodes().coordinates[elementConn[0]];
@@ -562,3 +563,35 @@ bool RigFemPart::isHexahedron( size_t elementIdx ) const
RigElementType elType = elementType( elementIdx );
return elType == HEX8 || elType == HEX8P;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFemPart::setName( std::string name )
{
m_name = name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RigFemPart::name() const
{
return m_name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFemPart::setEnabled( bool enable )
{
m_enabled = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigFemPart::enabled() const
{
return m_enabled;
}

View File

@@ -27,6 +27,7 @@
#include "cvfBoundingBox.h"
#include "cvfObject.h"
#include "cvfVector3.h"
#include <string>
#include <vector>
class RigFemPartGrid;
@@ -92,8 +93,16 @@ public:
const RigFemPartGrid* getOrCreateStructGrid() const;
const std::vector<int>& elementIdxToId() const;
void setName( std::string name );
std::string name() const;
void setEnabled( bool enable );
bool enabled() const;
private:
int m_elementPartId;
int m_elementPartId;
std::string m_name;
bool m_enabled;
std::vector<int> m_elementId;
std::vector<RigElementType> m_elementTypes;

View File

@@ -74,8 +74,6 @@ void RigFemPartGrid::generateStructGridData()
int elmIdxForIJK_000 = findElmIdxForIJK000();
CVF_ASSERT( elmIdxForIJK_000 != -1 ); // Debug. When we have run enough tests, remove
if ( elmIdxForIJK_000 == -1 ) return;
// Find the IJK faces based on the corner cell

View File

@@ -172,8 +172,11 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
int frameCount = stressDataFrames->frameCount();
for ( int fIdx = 0; fIdx < frameCount; ++fIdx )
{
const std::vector<float>& porFrameData = porePressureDataFrames->frameData( fIdx );
const std::vector<float>& porFrameData = porePressureDataFrames->frameData( fIdx );
if ( porFrameData.empty() ) continue;
const std::vector<float>& initialPorFrameData = porePressureDataFrames->frameData( 0 );
if ( initialPorFrameData.empty() ) continue;
const std::vector<float>& stressFrameData = stressDataFrames->frameData( fIdx );
const std::vector<float>& obg0FrameData = obg0DataFrames->frameData( 0 );

View File

@@ -86,6 +86,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalST::calculate( int
{
const std::vector<float>& srcSFrameData = srcSDataFrames->frameData( fIdx );
const std::vector<float>& srcPORFrameData = srcPORDataFrames->frameData( fIdx );
if ( srcPORFrameData.empty() ) continue;
int elementCount = femPart->elementCount();

View File

@@ -100,7 +100,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
const RigFemPartGrid* femPartGrid = femPart->getOrCreateStructGrid();
float inf = std::numeric_limits<float>::infinity();
const float inf = std::numeric_limits<float>::infinity();
int elmNodeCount = femPart->elementCount();
const std::vector<cvf::Vec3f>& nodeCoords = femPart->nodes().coordinates;
@@ -108,6 +108,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int
for ( int fIdx = 0; fIdx < frameCount; ++fIdx )
{
const std::vector<float>& porFrameData = porDataFrames->frameData( fIdx );
if ( porFrameData.empty() ) continue;
const std::vector<float>& srcFrameData = srcDataFrames->frameData( fIdx );
std::vector<float>& dstFrameData = dstDataFrames->frameData( fIdx );

View File

@@ -94,8 +94,10 @@ RigFemScalarResultFrames*
for ( int fIdx = 0; fIdx < frameCount; ++fIdx )
{
const std::vector<float>& porFrameData = porePressureDataFrames->frameData( fIdx );
if ( porFrameData.empty() ) continue;
const std::vector<float>& stressFrameData = stressDataFrames->frameData( fIdx );
if ( stressFrameData.empty() ) continue;
std::vector<float>& shearSlipIndicatorFrameData = shearSlipIndicatorFrames->frameData( fIdx );

View File

@@ -120,6 +120,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorStressGradients::calculate(
std::vector<float>& dstFrameDataY = dataFramesY->frameData( fIdx );
std::vector<float>& dstFrameDataZ = dataFramesZ->frameData( fIdx );
size_t valCount = inputData.size();
if ( valCount == 0 ) continue;
dstFrameDataX.resize( valCount );
dstFrameDataY.resize( valCount );
dstFrameDataZ.resize( valCount );