Fix type conversion issues

This commit is contained in:
Magne Sjaastad committed 2025-06-17 14:43:47 +02:00
1 parent a5d010fe60
commit c204593f08
4 files changed
+16 -16

No files matched your search

@@ -41,7 +41,7 @@ void RigFemNativeStatCalc::minMaxCellScalarValues( size_t timeStepIndex, double&
{
auto frames = m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( static_cast<int>( timeStepIndex ) );
const std::vector<float>& values = frames->frameData( stepIdx, frameIdx );
size_t i;
@@ -73,7 +73,7 @@ void RigFemNativeStatCalc::posNegClosestToZero( size_t timeStepIndex, double& po
{
auto frames = m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( static_cast<int>( timeStepIndex ) );
const std::vector<float>& values = frames->frameData( stepIdx, frameIdx );
for ( size_t i = 0; i < values.size(); i++ )
@@ -106,7 +106,7 @@ void RigFemNativeStatCalc::valueSumAndSampleCount( size_t timeStepIndex, double&
for ( int pIdx = 0; pIdx < partCount; ++pIdx )
{
auto frames = m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( static_cast<int>( timeStepIndex ) );
const std::vector<float>& values = frames->frameData( stepIdx, frameIdx );
size_t undefValueCount = 0;
@@ -137,7 +137,7 @@ void RigFemNativeStatCalc::addDataToHistogramCalculator( size_t timeStepIndex, R
{
auto frames = m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( static_cast<int>( timeStepIndex ) );
const std::vector<float>& values = frames->frameData( stepIdx, frameIdx );
histogramCalculator.addData( values );
@@ -153,7 +153,7 @@ void RigFemNativeStatCalc::uniqueValues( size_t timeStepIndex, std::set<int>& va
{
auto frames = m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( static_cast<int>( timeStepIndex ) );
const std::vector<float>& floatValues = frames->frameData( stepIdx, frameIdx );
for ( size_t i = 0; i < floatValues.size(); i++ )
@@ -63,7 +63,7 @@ private:
int elmCount = part->elementCount();
m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( static_cast<int>( timeStepIndex ) );
const std::vector<float>& values = m_resultsData->resultValues( m_resVarAddr, pIdx, stepIdx, frameIdx );
@@ -146,11 +146,11 @@ bool RifInpReader::readFemParts( RigFemPartCollection* femParts )
std::map<int, int> nodeIdToIdxMap;
int nodeCount = partNodes.size();
auto nodeCount = partNodes.size();
femPart->nodes().nodeIds.resize( nodeCount );
femPart->nodes().coordinates.resize( nodeCount );
for ( int nIdx = 0; nIdx < nodeCount; ++nIdx )
for ( int nIdx = 0; nIdx < static_cast<int>( nodeCount ); ++nIdx )
{
auto [nodeId, pos] = partNodes[nIdx];
femPart->nodes().nodeIds[nIdx] = nodeId;
@@ -164,7 +164,7 @@ bool RifInpReader::readFemParts( RigFemPartCollection* femParts )
// Extract elements
std::vector<std::pair<int, std::vector<int>>> partElements = elements[partId];
int elmCount = partElements.size();
auto elmCount = static_cast<int>( partElements.size() );
femPart->preAllocateElementStorage( elmCount );
std::vector<int> indexBasedConnectivities;
@@ -283,7 +283,7 @@ RigElementType RifInpReader::read( std::istream&
{
stepName = parseLabel( line, "name" );
stepNames.push_back( stepName );
stepId = stepNames.size() - 1;
stepId = static_cast<int>( stepNames.size() - 1 );
}
else if ( uppercasedLine.starts_with( "*END STEP" ) )
{
@@ -591,7 +591,7 @@ std::vector<double> RifInpReader::frameTimes( int stepIndex ) const
//--------------------------------------------------------------------------------------------------
int RifInpReader::frameCount( int stepIndex ) const
{
return frameTimes( stepIndex ).size();
return static_cast<int>( frameTimes( stepIndex ).size() );
}
//--------------------------------------------------------------------------------------------------
@@ -142,7 +142,7 @@ bool RifVtkReader::readFemParts( RigFemPartCollection* femParts )
std::map<int, int> nodeIdToIdxMap;
int nodeCount = partNodes.size();
int nodeCount = static_cast<int>( partNodes.size() );
femPart->nodes().nodeIds.resize( nodeCount );
femPart->nodes().coordinates.resize( nodeCount );
@@ -160,7 +160,7 @@ bool RifVtkReader::readFemParts( RigFemPartCollection* femParts )
// Extract elements
std::vector<std::pair<int, std::vector<int>>> partElements = elements[partId];
int elmCount = partElements.size();
int elmCount = static_cast<int>( partElements.size() );
femPart->preAllocateElementStorage( elmCount );
std::vector<int> indexBasedConnectivities;
@@ -274,7 +274,7 @@ std::expected<RigElementType, std::string>
if ( isFirst )
{
std::vector<std::pair<int, cvf::Vec3d>> partNodes;
for ( size_t i = 0; i < vertices.size(); i++ )
for ( int i = 0; i < static_cast<int>( vertices.size() ); i++ )
{
partNodes.push_back( { i, vertices[i] } );
}
@@ -284,7 +284,7 @@ std::expected<RigElementType, std::string>
std::vector<std::pair<int, std::vector<int>>> partElements;
int numNodesPerElement = 8;
int numCells = connectivity.size() / numNodesPerElement;
int numCells = static_cast<int>( connectivity.size() / numNodesPerElement );
for ( int i = 0; i < numCells; i++ )
{
std::vector<int> els( numNodesPerElement );
@@ -342,7 +342,7 @@ std::vector<double> RifVtkReader::frameTimes( int stepIndex ) const
//--------------------------------------------------------------------------------------------------
int RifVtkReader::frameCount( int stepIndex ) const
{
return frameTimes( stepIndex ).size();
return static_cast<int>( frameTimes( stepIndex ).size() );
}
//--------------------------------------------------------------------------------------------------