mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
(#405) Convert POR, SE, and ST to Bar. Fixed issues regarding property filters.
Result fields without component had an extra space in the option value string that made the search for the option in the option list fail.
This commit is contained in:
parent
3295c032b1
commit
276addc713
@ -156,6 +156,7 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
|
||||
if (resPos == RIG_NODAL)
|
||||
{
|
||||
fieldCompNames = m_readerInterface->scalarNodeFieldAndComponentNames();
|
||||
fieldCompNames["POR-Bar"];
|
||||
}
|
||||
else if (resPos == RIG_ELEMENT_NODAL)
|
||||
{
|
||||
@ -193,6 +194,7 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
|
||||
fieldCompNames["NE"].push_back("E12");
|
||||
fieldCompNames["NE"].push_back("E13");
|
||||
fieldCompNames["NE"].push_back("E23");
|
||||
|
||||
}
|
||||
else if (resPos == RIG_INTEGRATION_POINT)
|
||||
{
|
||||
@ -230,17 +232,53 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
|
||||
fieldCompNames["NE"].push_back("E12");
|
||||
fieldCompNames["NE"].push_back("E13");
|
||||
fieldCompNames["NE"].push_back("E23");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return fieldCompNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string fieldNameToConvert)
|
||||
{
|
||||
RigFemScalarResultFrames * srcDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(convertedResultAddr.resultPosType, fieldNameToConvert, convertedResultAddr.componentName));
|
||||
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(convertedResultAddr);
|
||||
|
||||
int frameCount = srcDataFrames->frameCount();
|
||||
for (int fIdx = 0; fIdx < frameCount; ++fIdx)
|
||||
{
|
||||
const std::vector<float>& srcFrameData = srcDataFrames->frameData(fIdx);
|
||||
std::vector<float>& dstFrameData = dstDataFrames->frameData(fIdx);
|
||||
size_t valCount = srcFrameData.size();
|
||||
dstFrameData.resize(valCount);
|
||||
|
||||
for (size_t vIdx = 0; vIdx < valCount; ++vIdx)
|
||||
{
|
||||
dstFrameData[vIdx] = 1.0e-5*srcFrameData[vIdx];
|
||||
}
|
||||
}
|
||||
|
||||
return dstDataFrames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(int partIndex, const RigFemResultAddress& resVarAddr)
|
||||
{
|
||||
if (resVarAddr.fieldName == "S-Bar")
|
||||
{
|
||||
return calculateBarConvertedResult(partIndex, resVarAddr, "S");
|
||||
}
|
||||
|
||||
if (resVarAddr.fieldName == "POR-Bar")
|
||||
{
|
||||
return calculateBarConvertedResult(partIndex, resVarAddr, "POR");
|
||||
}
|
||||
|
||||
if (resVarAddr.fieldName == "NE")
|
||||
{
|
||||
RigFemScalarResultFrames * srcDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "E", resVarAddr.componentName));
|
||||
@ -266,8 +304,8 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
||||
if ((resVarAddr.fieldName == "SE")
|
||||
&& !(resVarAddr.componentName == "S1" || resVarAddr.componentName == "S2" || resVarAddr.componentName == "S3" ))
|
||||
{
|
||||
RigFemScalarResultFrames * srcDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S", resVarAddr.componentName));
|
||||
RigFemScalarResultFrames * srcPORDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(RIG_NODAL, "POR", ""));
|
||||
RigFemScalarResultFrames * srcDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", resVarAddr.componentName));
|
||||
RigFemScalarResultFrames * srcPORDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(RIG_NODAL, "POR-Bar", ""));
|
||||
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
|
||||
|
||||
const RigFemPart * femPart = m_femParts->part(partIndex);
|
||||
@ -369,8 +407,8 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
||||
|| resVarAddr.componentName == "S22"
|
||||
|| resVarAddr.componentName == "S33" ))
|
||||
{
|
||||
RigFemScalarResultFrames * srcSDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S", resVarAddr.componentName));
|
||||
RigFemScalarResultFrames * srcPORDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(RIG_NODAL, "POR", ""));
|
||||
RigFemScalarResultFrames * srcSDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", resVarAddr.componentName));
|
||||
RigFemScalarResultFrames * srcPORDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(RIG_NODAL, "POR-Bar", ""));
|
||||
|
||||
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
|
||||
const RigFemPart * femPart = m_femParts->part(partIndex);
|
||||
@ -426,7 +464,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
||||
|| resVarAddr.componentName == "S13"
|
||||
|| resVarAddr.componentName == "S23" ))
|
||||
{
|
||||
RigFemScalarResultFrames * srcSDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S", resVarAddr.componentName));
|
||||
RigFemScalarResultFrames * srcSDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", resVarAddr.componentName));
|
||||
|
||||
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
|
||||
const RigFemPart * femPart = m_femParts->part(partIndex);
|
||||
@ -478,7 +516,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
||||
srcDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "ST", "S33"));
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames * srcPORDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(RIG_NODAL, "POR", ""));
|
||||
RigFemScalarResultFrames * srcPORDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(RIG_NODAL, "POR-Bar", ""));
|
||||
|
||||
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
|
||||
|
||||
|
@ -61,6 +61,8 @@ private:
|
||||
|
||||
RigFemScalarResultFrames* calculateDerivedResult(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
|
||||
RigFemScalarResultFrames* calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string fieldNameToConvert);
|
||||
|
||||
friend class RigFemNativeStatCalc;
|
||||
cvf::Collection<RigFemPartResults> m_femPartResults;
|
||||
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
|
||||
|
@ -197,7 +197,11 @@ void RimGeoMechPropertyFilter::updateFilterName()
|
||||
case RIG_INTEGRATION_POINT: posName = "IP"; break;
|
||||
}
|
||||
|
||||
newFiltername = posName + ", " + QString::fromStdString(resultAddress.fieldName + ", " + resultAddress.componentName) + " ("
|
||||
QString fieldUiName = resultDefinition->resultFieldUiName();
|
||||
QString compoUiName = resultDefinition->resultComponentUiName();
|
||||
|
||||
|
||||
newFiltername = posName + ", " + fieldUiName + ", " + compoUiName + " ("
|
||||
+ QString::number(lowerBound()) + " .. " + QString::number(upperBound) + ")";
|
||||
this->name = newFiltername;
|
||||
|
||||
|
@ -135,9 +135,9 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
getUiAndResultVariableStringList(&uiVarNames, &varNames, fieldCompNames);
|
||||
|
||||
if (m_resultPositionTypeUiField() == m_resultPositionType()
|
||||
&& varNames.contains(composeUiVarString(m_resultFieldName(), m_resultComponentName())))
|
||||
&& varNames.contains(composeFieldCompString(m_resultFieldName(), m_resultComponentName())))
|
||||
{
|
||||
m_resultVariableUiField = composeUiVarString(m_resultFieldName(), m_resultComponentName());
|
||||
m_resultVariableUiField = composeFieldCompString(m_resultFieldName(), m_resultComponentName());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -244,7 +244,7 @@ void RimGeoMechResultDefinition::getUiAndResultVariableStringList(QStringList* u
|
||||
{
|
||||
QString resultFieldName = QString::fromStdString(fieldIt->first);
|
||||
|
||||
if (resultFieldName == "E" || resultFieldName == "S") continue; // We will not show the native Stress and Strain
|
||||
if (resultFieldName == "E" || resultFieldName == "S" || resultFieldName == "POR") continue; // We will not show the native POR, Stress and Strain
|
||||
|
||||
QString resultFieldUiName = convertToUiResultFieldName(resultFieldName);
|
||||
|
||||
@ -255,8 +255,8 @@ void RimGeoMechResultDefinition::getUiAndResultVariableStringList(QStringList* u
|
||||
for (compIt = fieldIt->second.begin(); compIt != fieldIt->second.end(); ++compIt)
|
||||
{
|
||||
QString resultCompName = QString::fromStdString(*compIt);
|
||||
uiNames->push_back(" " + resultCompName);
|
||||
variableNames->push_back(composeUiVarString(resultFieldName, resultCompName));
|
||||
uiNames->push_back(" " + convertToUIComponentName(resultCompName));
|
||||
variableNames->push_back(composeFieldCompString(resultFieldName, resultCompName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -265,9 +265,12 @@ void RimGeoMechResultDefinition::getUiAndResultVariableStringList(QStringList* u
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGeoMechResultDefinition::composeUiVarString(const QString& resultFieldName, const QString& resultComponentName)
|
||||
QString RimGeoMechResultDefinition::composeFieldCompString(const QString& resultFieldName, const QString& resultComponentName)
|
||||
{
|
||||
return resultFieldName + " " + resultComponentName;
|
||||
if (resultComponentName.isEmpty())
|
||||
return resultFieldName;
|
||||
else
|
||||
return resultFieldName + " " + resultComponentName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -276,7 +279,7 @@ QString RimGeoMechResultDefinition::composeUiVarString(const QString& resultFiel
|
||||
void RimGeoMechResultDefinition::initAfterRead()
|
||||
{
|
||||
m_resultPositionTypeUiField = m_resultPositionType;
|
||||
m_resultVariableUiField = composeUiVarString(m_resultFieldName(), m_resultComponentName());
|
||||
m_resultVariableUiField = composeFieldCompString(m_resultFieldName(), m_resultComponentName());
|
||||
|
||||
}
|
||||
|
||||
@ -324,7 +327,7 @@ QString RimGeoMechResultDefinition::resultFieldUiName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGeoMechResultDefinition::resultComponentUiName()
|
||||
{
|
||||
return m_resultComponentName();
|
||||
return convertToUIComponentName(m_resultComponentName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -335,10 +338,18 @@ QString RimGeoMechResultDefinition::convertToUiResultFieldName(QString resultFie
|
||||
if (resultFieldName == "E") return "NativeAbaqus Strain";
|
||||
if (resultFieldName == "S") return "NativeAbaqus Stress";
|
||||
if (resultFieldName == "NE") return "E"; // Make NE and NS appear as E and SE
|
||||
if (resultFieldName == "POR-Bar") return "POR"; // POR-Bar appear as POR
|
||||
|
||||
return resultFieldName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGeoMechResultDefinition::convertToUIComponentName(QString resultComponentName)
|
||||
{
|
||||
return resultComponentName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -350,5 +361,5 @@ void RimGeoMechResultDefinition::setResultAddress( const RigFemResultAddress& re
|
||||
m_resultComponentName = QString::fromStdString(resultAddress.componentName);
|
||||
|
||||
m_resultPositionTypeUiField = m_resultPositionType;
|
||||
m_resultVariableUiField = composeUiVarString(m_resultFieldName(), m_resultComponentName());
|
||||
m_resultVariableUiField = composeFieldCompString(m_resultFieldName(), m_resultComponentName());
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
static void getUiAndResultVariableStringList(QStringList* uiNames, QStringList* variableNames,
|
||||
const std::map<std::string, std::vector<std::string> >& fieldCompNames);
|
||||
static QString composeUiVarString(const QString& resultFieldName, const QString& resultComponentName);
|
||||
static QString composeFieldCompString(const QString& resultFieldName, const QString& resultComponentName);
|
||||
|
||||
virtual void initAfterRead();
|
||||
|
||||
@ -87,4 +87,5 @@ private:
|
||||
caf::PdmPointer<RimGeoMechCase> m_geomCase;
|
||||
|
||||
static QString convertToUiResultFieldName(QString resultFieldName);
|
||||
static QString convertToUIComponentName(QString resultComponentName);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user