}
+ //---------------------------------------------------------------
+ void
+ CalculateMinMax(MED::PTimeStampVal theTimeStampVal,
+ PMEDField theField,
+ PMEDValForTime theValForTime)
+ {
+ TInt aNbComp = theField->myNbComp;
+ TMinMaxArr& aMinMaxArr = theField->myMinMaxArr;
+ const MED::TTimeStampVal& aTimeStampValRef = theTimeStampVal;
+
+ PMEDProfile aProfile = theValForTime->myProfile;
+ TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
+ TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
+ for(; anIter != aGeom2SubProfile.end(); anIter++){
+ vtkIdType aVGeom = anIter->first;
+ PMEDSubProfile aSubProfile(anIter->second);
+
+ TInt aNbElem = aSubProfile->myNbCells;
+ TInt aNbGauss = theValForTime->GetNbGauss(aVGeom);
+
+ if(aSubProfile->myStatus != eRemoveAll){
+ INITMSG(MYDEBUG,
+ "- aVGeom = "<<aVGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ endl);
+
+ MED::EGeometrieElement aMGeom = aSubProfile->myMGeom;
+ const MED::TMeshValue& aMMeshValue = aTimeStampValRef.GetMeshValue(aMGeom);
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
+ ADDMSG(MYVALUEDEBUG,"{");
+ for(TInt iComp = 0; iComp < aNbComp; iComp++){
+ const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
+ TMinMax& aMinMax = aMinMaxArr[iComp];
+ float& aMin = aMinMax.first;
+ float& aMax = aMinMax.second;
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const float& aVal = aMValueSlice[iGauss];
+ ADDMSG(MYVALUEDEBUG,aVal<<" ");
+ aMin = min(aMin,aVal);
+ aMax = max(aMax,aVal);
+ }
+ ADDMSG(MYVALUEDEBUG,"| ");
+ }
+ ADDMSG(MYVALUEDEBUG,"} ");
+ }
+ ADDMSG(MYDEBUG,"\n");
+ }
+ }
+ }
+
+
//---------------------------------------------------------------
void
BuildFieldMap(PMEDMesh theMesh,
TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
PMEDField aField = aFieldMap[aFieldName](new TMEDField());
aField->myId = iField;
- aField->myNbComp = aNbComp;
+ aField->InitArrays(aNbComp);
aField->myEntity = aVEntity;
aField->myName = aFieldName;
aField->myMeshName = aMeshName;
aField->myDataSize = aMeshOnEntity->myNbCells * aNbComp;
- aField->myCompNames.resize(aNbComp);
- aField->myUnitNames.resize(aNbComp);
INITMSG(MYDEBUG,"myName = '"<<aField->myName<<"'"<<
"; myId = "<<aField->myId<<
aMeshOnEntity,
aGeom2Size,
aValForTime);
+
+ CalculateMinMax(aTimeStampVal,
+ aField,
+ aValForTime);
}
}
}
theField->myDataSize = 0;
- const MED::TTimeStampVal& aTimeVal = aTimeStampVal;
+ const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
for(; anIter != aGeom2SubProfile.end(); anIter++){
vtkIdType aVGeom = anIter->first;
aVMeshValue.Init(aNbElem,aNbGauss,aNbComp);
MED::EGeometrieElement aMGeom = aSubProfile->myMGeom;
- const MED::TMeshValue& aMMeshValue = aTimeVal.GetMeshValue(aMGeom);
+ const MED::TMeshValue& aMMeshValue = aTimeStampValRef.GetMeshValue(aMGeom);
for(TInt iElem = 0; iElem < aNbElem; iElem++){
TValueSliceArr aVValueSliceArr = aVMeshValue.GetGaussValueSliceArr(iElem);
- MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetValueSliceArr(iElem);
+ MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
ADDMSG(MYVALUEDEBUG,"{");
for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
TValueSlice& aVValueSlice = aVValueSliceArr[iGauss];