Fixes of linux compile errors and warnings

This commit is contained in:
Jacob Storen 2015-05-27 05:50:12 -07:00
parent 0d56ee060e
commit f6e8bb4a1a
18 changed files with 29 additions and 28 deletions

View File

@ -21,7 +21,7 @@
#include <vector>
#include <algorithm>
#include <climits>
class RigFemFaceComparator
{
@ -46,7 +46,7 @@ public:
bool isSameButOposite(const int* elmNodes, const int * localFaceIndices, int faceNodeCount)
{
if (faceNodeCount != m_canonizedMainFaceIdxes.size()) return false;
if (faceNodeCount != static_cast<int>(m_canonizedMainFaceIdxes.size())) return false;
// Find min node index in face
int minNodeIdx = INT_MAX;

View File

@ -17,7 +17,6 @@
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RigFemNativeStatCalc.h"
#include "RigFemScalarResultFrames.h"

View File

@ -205,7 +205,7 @@ void RigFemPart::calculateElmNeighbors()
}
// Check if any of the neighbor candidates faces matches
for (int nbcIdx = 0; nbcIdx < candidates.size(); ++nbcIdx)
for (int nbcIdx = 0; nbcIdx < static_cast<int>(candidates.size()); ++nbcIdx)
{
int nbcElmIdx = candidates[nbcIdx];

View File

@ -83,7 +83,7 @@ private:
cvf::ref<RigFemPartGrid> m_structGrid;
void calculateNodeToElmRefs();
std::vector<std::vector<size_t>> m_nodeToElmRefs; // Needs a more memory friendly structure
std::vector<std::vector<size_t> > m_nodeToElmRefs; // Needs a more memory friendly structure
void calculateElmNeighbors();
struct Neighbors { int idxToNeighborElmPrFace[6]; };

View File

@ -17,7 +17,6 @@
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <stdlib.h>
#include "RigFemScalarResultFrames.h"

View File

@ -25,7 +25,7 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const int RigFemTypes::elmentNodeCount(RigElementType elmType)
int RigFemTypes::elmentNodeCount(RigElementType elmType)
{
static int elementTypeCounts[2] ={ 8, 4 };
@ -35,7 +35,7 @@ const int RigFemTypes::elmentNodeCount(RigElementType elmType)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const int RigFemTypes::elmentFaceCount(RigElementType elmType)
int RigFemTypes::elmentFaceCount(RigElementType elmType)
{
const static int elementFaceCounts[2] ={ 6, 1 };

View File

@ -30,8 +30,8 @@ enum RigElementType
class RigFemTypes
{
public:
static const int elmentNodeCount(RigElementType elmType);
static const int elmentFaceCount(RigElementType elmType);
static int elmentNodeCount(RigElementType elmType);
static int elmentFaceCount(RigElementType elmType);
static const int* localElmNodeIndicesForFace(RigElementType elmType, int faceIdx, int* faceNodeCount);
};

View File

@ -82,7 +82,7 @@ bool RigGeoMechCaseData::openAndReadFemParts()
// Initialize results containers
m_femPartResults.resize(m_femParts->partCount());
std::vector<std::string> stepNames = m_readerInterface->stepNames();
for (int pIdx = 0; pIdx < m_femPartResults.size(); ++pIdx)
for (int pIdx = 0; pIdx < static_cast<int>(m_femPartResults.size()); ++pIdx)
{
m_femPartResults[pIdx] = new RigFemPartResults;
m_femPartResults[pIdx]->initResultStages(stepNames);
@ -198,7 +198,7 @@ void RigGeoMechCaseData::minMaxScalarValuesInternal(const RigFemResultAddress& r
double min = HUGE_VAL;
double max = -HUGE_VAL;
for (int pIdx = 0; pIdx < m_femPartResults.size(); ++pIdx)
for (int pIdx = 0; pIdx < static_cast<int>(m_femPartResults.size()); ++pIdx)
{
if (m_femPartResults[pIdx].notNull())
{
@ -254,7 +254,7 @@ void RigGeoMechCaseData::posNegClosestToZeroInternal(const RigFemResultAddress&
double posClosestToZero = HUGE_VAL;
double negClosestToZero = -HUGE_VAL;
for (int pIdx = 0; pIdx < m_femPartResults.size(); ++pIdx)
for (int pIdx = 0; pIdx < static_cast<int>(m_femPartResults.size()); ++pIdx)
{
if (m_femPartResults[pIdx].notNull())
{
@ -287,10 +287,10 @@ void RigGeoMechCaseData::posNegClosestToZeroInternal(const RigFemResultAddress&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigGeoMechCaseData::frameCount(int stepIndex, const RigFemResultAddress& resVarAddr)
int RigGeoMechCaseData::frameCount(int stepIndex, const RigFemResultAddress& resVarAddr)
{
size_t maxFrameCount = 0;
for (int pIdx = 0; pIdx < m_femPartResults.size(); ++pIdx)
for (int pIdx = 0; pIdx < static_cast<int>(m_femPartResults.size()); ++pIdx)
{
if (m_femPartResults[pIdx].notNull())
{
@ -303,7 +303,7 @@ size_t RigGeoMechCaseData::frameCount(int stepIndex, const RigFemResultAddress&
}
}
return maxFrameCount;
return static_cast<int>(maxFrameCount);
}
//--------------------------------------------------------------------------------------------------
@ -311,7 +311,7 @@ size_t RigGeoMechCaseData::frameCount(int stepIndex, const RigFemResultAddress&
//--------------------------------------------------------------------------------------------------
void RigGeoMechCaseData::assertResultsLoaded(int stepIndex, const RigFemResultAddress& resVarAddr)
{
for (int pIdx = 0; pIdx < m_femPartResults.size(); ++pIdx)
for (int pIdx = 0; pIdx < static_cast<int>(m_femPartResults.size()); ++pIdx)
{
if (m_femPartResults[pIdx].notNull())
{

View File

@ -49,7 +49,7 @@ public:
int stepIndex,
const RigFemResultAddress& resVarAddr);
size_t frameCount(int stepIndex, const RigFemResultAddress& resVarAddr);
int frameCount(int stepIndex, const RigFemResultAddress& resVarAddr);
std::vector<double> frameTimes(int stepIndex, const RigFemResultAddress& resVarAddr);
void minMaxScalarValues (const RigFemResultAddress& resVarAddr, int stepIndex, int frameIndex, double* localMin, double* localMax);

View File

@ -254,8 +254,9 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechRe
m_surfaceFacesTextureCoords->resize(vxToResultMapping->size());
cvf::Vec2f* rawPtr = m_surfaceFacesTextureCoords->ptr();
int vxCount = static_cast<int>(vxToResultMapping->size());
#pragma omp parallel for schedule(dynamic)
for (int vxIdx = 0; vxIdx < vxToResultMapping->size(); ++vxIdx)
for (int vxIdx = 0; vxIdx < vxCount; ++vxIdx)
{
float resultValue = resultValues[(*vxToResultMapping)[vxIdx]];
if (resultValue == HUGE_VAL || resultValue != resultValue) // a != a is true for NAN's

View File

@ -54,7 +54,7 @@ void RivGeoMechPartMgr::clearAndSetReservoir(const RigGeoMechCaseData* geoMechCa
{
const RigFemPartCollection* femParts = geoMechCase->femParts();
for (size_t i = 0; i < femParts->partCount(); ++i)
for (int i = 0; i < femParts->partCount(); ++i)
{
m_femPartPartMgrs.push_back(new RivFemPartPartMgr(femParts->part(i)));
}

View File

@ -1,5 +1,5 @@
#pragma once
#include <cstddef>
#include "cvfObject.h"
#include <map>

View File

@ -27,7 +27,7 @@
#include "RivReservoirViewPartMgr.h"
#include "RimGeoMechCase.h"
#include "RigFemPartCollection.h"
#include "RigGeomechCaseData.h"
#include "RigGeoMechCaseData.h"
#include "RimCellRangeFilterCollection.h"
//--------------------------------------------------------------------------------------------------

View File

@ -19,6 +19,7 @@
#pragma once
#include <cstddef>
#include "cvfObject.h"
#include "cvfColor4.h"
#include "RivGeoMechPartMgrCache.h"

View File

@ -27,7 +27,7 @@
#include "RigFemPartCollection.h"
#include "RimGeoMechView.h"
#include "RimGeoMechCase.h"
#include "RigGeomechCaseData.h"
#include "RigGeoMechCaseData.h"
#include "RigFemPart.h"
#include "RigFemPartGrid.h"

View File

@ -189,7 +189,7 @@ void RimGeoMechView::createDisplayModel()
// Define a vector containing time step indices to produce geometry for.
// First entry in this vector is used to define the geometry only result mode with no results.
std::vector<size_t> timeStepIndices;
std::vector<int> timeStepIndices;
// The one and only geometry entry
timeStepIndices.push_back(0);
@ -198,7 +198,7 @@ void RimGeoMechView::createDisplayModel()
if (isTimeStepDependentDataVisible())
{
size_t i;
int i;
for (i = 0; i < geoMechCase()->geoMechData()->frameCount(0, cellResult()->resultAddress()); i++)
{
timeStepIndices.push_back(i);
@ -417,13 +417,13 @@ RimGeoMechCase* RimGeoMechView::geoMechCase()
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::clampCurrentTimestep()
{
size_t maxFrameCount = 0;
int maxFrameCount = 0;
if (m_geomechCase){
maxFrameCount = m_geomechCase->geoMechData()->frameCount(0, cellResult()->resultAddress());
}
if (m_currentTimeStep >= maxFrameCount ) m_currentTimeStep = (int)(maxFrameCount -1);
if (m_currentTimeStep >= maxFrameCount ) m_currentTimeStep = maxFrameCount -1;
if (m_currentTimeStep < 0 ) m_currentTimeStep = 0;
}

View File

@ -644,7 +644,7 @@ QString RiuResultTextBuilder::wellResultText()
{
RigSingleWellResultsData* singleWellResultData = wellResults.at(i);
if (m_timeStepIndex < static_cast<int>(singleWellResultData->firstResultTimeStep()))
if (m_timeStepIndex < singleWellResultData->firstResultTimeStep())
{
continue;
}

View File

@ -37,6 +37,7 @@
#pragma once
#include <cstddef>
#include "cvfObject.h"
#include "cvfVector3.h"