#ifdef _DEBUG_
static int MYDEBUG = 0;
static int MYDEBUGWITHFILES = 0;
-#define _DEXCEPT_
+//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
static int MYDEBUGWITHFILES = 0;
TValForTimeImpl
::TValForTimeImpl():
myGaussPtsIDFilter(new TGaussPtsIDFilter()),
- myIDMapperFilter(new TIDMapperFilter()),
- myNbGauss(1)
+ myIDMapperFilter(new TIDMapperFilter())
{}
const TMeshValue&
TValForTimeImpl
::GetNbGauss(EGeometry theGeom) const
{
- if(PGaussMeshImpl aGaussMesh = myGaussMesh){
- const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
- TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.find(theGeom);
- if(anIter != aGeom2GaussSubMesh.end()){
- PGaussSubMeshImpl aGaussSubMesh = anIter->second;
- PGaussImpl aGauss = aGaussSubMesh->myGauss;
- return aGauss->myNbPoints;
- }
+ TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.find(theGeom);
+ if(anIter == myGeom2NbGauss.end()){
+ //EXCEPTION(runtime_error,"TValForTimeImpl::GetNbGauss - myGeom2NbGauss.find(theGeom) fails");
+ return 1;
}
- return myNbGauss;
+ return anIter->second;
}
if(aNbGauss < 1)
continue;
+ const TPointCoords& aCoords = aGaussSubMesh->myPointCoords;
+
INITMSG(MYDEBUG,
"- aEGeom = "<<aEGeom<<
"; aNbElem = "<<aNbElem<<
"; aNbGauss = "<<aNbGauss<<
+ "; aCoords.GetNbPoints() = "<<aCoords.GetNbPoints()<<
endl);
- int aNbComp2 = aNbComp;
- if(aNbComp == 4)
- aNbComp2 = 2;
- else if(aNbComp > 4)
- aNbComp2 = 3;
-
- for(int iElem = 0; iElem < aNbElem; iElem++){
- TCValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
- for(int iGauss = 0; iGauss < aNbGauss; iGauss++, aTupleId++){
- const TCValueSlice& aValueSlice = aValueSliceArr[iGauss];
+ if(aCoords.GetNbPoints() == aNbElem*aNbGauss){
+ for(int iElem = 0; iElem < aNbElem; iElem++){
+ TCValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
+ for(int iGauss = 0; iGauss < aNbGauss; iGauss++, aTupleId++){
+ const TCValueSlice& aValueSlice = aValueSliceArr[iGauss];
+ for(int iComp = 0; iComp < aNbComp; iComp++){
+ aDataValues[iComp] = aValueSlice[iComp];
+ }
+ aFloatArray->SetTuple(aTupleId,&aDataValues[0]);
+ aDataArray->SetTuple(aTupleId,&aDataValues[0]);
+ }
+ }
+ }else{
+ for(int iElem = 0; iElem < aNbElem; iElem++, aTupleId++){
+ TCValueSliceArr aValueSliceArr = aMeshValue.GetCompValueSliceArr(iElem);
for(int iComp = 0; iComp < aNbComp; iComp++){
- aDataValues[iComp] = aValueSlice[iComp];
+ const TCValueSlice& aValueSlice = aValueSliceArr[iComp];
+ aDataValues[iComp] = 0.0;
+ for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
+ aDataValues[iComp] += aValueSlice[iGauss];
+ }
+ aDataValues[iComp] /= aNbGauss;
}
aFloatArray->SetTuple(aTupleId,&aDataValues[0]);
aDataArray->SetTuple(aTupleId,&aDataValues[0]);
static int MYVALUEDEBUG = 0;
static int MY_FAMILY_DEBUG = 0;
static int MY_GROUP_DEBUG = 0;
-#define _DEXCEPT_
+//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
aValForTime->myFieldName = aField->myName;
aValForTime->myEntity = aField->myEntity;
aValForTime->myMeshName = aField->myMeshName;
- aValForTime->myNbGauss = aTimeStampInfo->GetNbGauss();
aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
+
+ TGeom2NbGauss& aVGeom2NbGauss = aValForTime->myGeom2NbGauss;
+ const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss;
+ MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin();
+ for(; anIter != aMGeom2NbGauss.end(); anIter++){
+ const MED::EGeometrieElement& aMGeom = anIter->first;
+ EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ TInt aNbGauss = anIter->second;
+ aVGeom2NbGauss[aEGeom] = aNbGauss;
+ }
}
}
}
TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()");
INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
- MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
- aMEntity,
- aGeom2Size,
- iTimeStamp);
-
- MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
- aMKey2Profile,
- aKey2Gauss);
-
- const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
-
- const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
-
- const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value;
- MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin();
- for(; anIter != aGeom2Value.end(); anIter++){
- const MED::TMeshValue& aMMeshValue = anIter->second;
- MED::EGeometrieElement aMGeom = anIter->first;
+#ifndef _DEXCEPT_
+ try{
+#endif
+ MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
+ aMEntity,
+ aGeom2Size,
+ iTimeStamp);
- TInt aNbElem = aMMeshValue.myNbElem;
- TInt aNbGauss = aMMeshValue.myNbGauss;
+ MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
+ aMKey2Profile,
+ aKey2Gauss);
- MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
- if(aGaussIter == aGeom2Gauss.end())
- aNbGauss = 1;
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- endl);
+ const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
- // To calculate min/max per components
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
- for(TInt iComp = 0; iComp < aNbComp; iComp++){
- const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
- TMinMax& aMinMax = aMinMaxArr[iComp+1];
- float& aMin = aMinMax.first;
- float& aMax = aMinMax.second;
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const float& aVal = aMValueSlice[iGauss];
- aMin = min(aMin,aVal);
- aMax = max(aMax,aVal);
+ const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
+
+ const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value;
+ MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin();
+ for(; anIter != aGeom2Value.end(); anIter++){
+ const MED::TMeshValue& aMMeshValue = anIter->second;
+ MED::EGeometrieElement aMGeom = anIter->first;
+
+ TInt aNbElem = aMMeshValue.myNbElem;
+ TInt aNbGauss = aMMeshValue.myNbGauss;
+
+ MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
+ if(aGaussIter == aGeom2Gauss.end())
+ aNbGauss = 1;
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ endl);
+
+ // To calculate min/max per components
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
+ for(TInt iComp = 0; iComp < aNbComp; iComp++){
+ const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
+ TMinMax& aMinMax = aMinMaxArr[iComp+1];
+ float& aMin = aMinMax.first;
+ float& aMax = aMinMax.second;
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const float& aVal = aMValueSlice[iGauss];
+ aMin = min(aMin,aVal);
+ aMax = max(aMax,aVal);
+ }
}
}
- }
-
- // To calculate min/max per vector modulus
- TMinMax& aMinMax = aMinMaxArr[0];
- float& aMin = aMinMax.first;
- float& aMax = aMinMax.second;
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
- float aValue = 0.0;
- for(TInt iComp = 0; iComp < aNbComp2; iComp++){
- float aVal = aMValueSlice[iComp];
- aValue += aVal*aVal;
+
+ // To calculate min/max per vector modulus
+ TMinMax& aMinMax = aMinMaxArr[0];
+ float& aMin = aMinMax.first;
+ float& aMax = aMinMax.second;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
+ float aValue = 0.0;
+ for(TInt iComp = 0; iComp < aNbComp2; iComp++){
+ float aVal = aMValueSlice[iComp];
+ aValue += aVal*aVal;
+ }
+ aValue = sqrt(aValue);
+ aMin = min(aMin,aValue);
+ aMax = max(aMax,aValue);
}
- aValue = sqrt(aValue);
- aMin = min(aMin,aValue);
- aMax = max(aMax,aValue);
}
}
+#ifndef _DEXCEPT_
+ }catch(std::exception& exc){
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ }catch(...){
+ MSG(MYDEBUG,"Unknown exception !!!");
}
+#endif
}
for(TInt iComp = 0; iComp <= aNbComp; iComp++){
VISU::TMinMax aMinMax = aField->GetMinMax(iComp);
"- aEGeom = "<<aEGeom<<
"; aName = '"<<aName<<"'"<<
"; aStatus = "<<aGaussSubMesh->myStatus<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
"; aNbCells = "<<aNbCells<<
endl);
}
TInt aNbElem = aSubProfile->myNbCells;
theField->myDataSize += aNbElem*aNbComp;
- TInt aNbGauss = theValForTime->GetNbGauss(aEGeom);
-
if(aSubProfile->myStatus != eRemoveAll){
+ TInt aNbGauss = theValForTime->GetNbGauss(aEGeom);
+
INITMSG(MYDEBUG,
"- aEGeom = "<<aEGeom<<
"; aNbElem = "<<aNbElem<<