#ifdef _DEBUG_
static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
+static int MYMEMORYDEBUG = 1;
static int MYTHREADDEBUG = 0;
static int MY_FAMILY_DEBUG = 0;
static int MY_GROUP_DEBUG = 0;
#else
static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
+static int MYMEMORYDEBUG = 0;
static int MYTHREADDEBUG = 0;
static int MY_FAMILY_DEBUG = 0;
static int MY_GROUP_DEBUG = 0;
//---------------------------------------------------------------
struct TFieldMinMax
{
- PMEDField myField;
+ VISU::PMEDField myField;
MED::PFieldInfo myFieldInfo;
TInt myNbTimeStamps;
MED::EEntiteMaillage myMEntity;
MED::TMKey2Profile myMKey2Profile;
MED::TKey2Gauss myKey2Gauss;
MED::PWrapper myMEDWrapper;
- VISU_MedConvertor::TMutex& myMutex;
- TFieldMinMax(const PMEDField& theField,
+ TFieldMinMax(const VISU::PMEDField& theField,
const MED::PFieldInfo& theFieldInfo,
TInt theNbTimeStamps,
MED::EEntiteMaillage theMEntity,
const MED::TGeom2Size& theGeom2Size,
const MED::TMKey2Profile& theMKey2Profile,
const MED::TKey2Gauss& theKey2Gauss,
- const MED::PWrapper& theMEDWrapper,
- VISU_MedConvertor::TMutex& theMutex):
+ const MED::PWrapper& theMEDWrapper):
myField(theField),
myFieldInfo(theFieldInfo),
myNbTimeStamps(theNbTimeStamps),
myGeom2Size(theGeom2Size),
myMKey2Profile(theMKey2Profile),
myKey2Gauss(theKey2Gauss),
- myMEDWrapper(theMEDWrapper),
- myMutex(theMutex)
+ myMEDWrapper(theMEDWrapper)
{
- INITMSG(MYTHREADDEBUG,"TFieldMinMax() - "<<this<<endl);
+ INITMSG(MYMEMORYDEBUG,"TFieldMinMax() - "<<this<<endl);
}
~TFieldMinMax()
{
- INITMSG(MYTHREADDEBUG,"~TFieldMinMax() - "<<this<<endl);
+ INITMSG(MYMEMORYDEBUG,"~TFieldMinMax() - "<<this<<endl);
}
void
Calculate()
{
- //boost::mutex::scoped_lock aLock(myMutex);
INITMSG(MYTHREADDEBUG,"TFieldMinMax::Calculate() - "<<this<<
"; aFieldName = '"<<myField->myName<<"'"<<
"; myNbTimeStamps = "<<myNbTimeStamps<<
//---------------------------------------------------------------
- void
- MinMaxCalculation(PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::TMKey2Profile& theMKey2Profile,
- const MED::TKey2Gauss& theKey2Gauss,
- const MED::PWrapper& theMEDWrapper,
- VISU_MedConvertor::TMutex& theMutex)
+ struct TCalculateMinMax
{
- TInt aNbFields = theMEDWrapper->GetNbFields();
- MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
- const std::string& aMeshName = theMesh->myName;
- INITMSG(MYDEBUG,"MinMaxCalculation: aNbFields = "<<aNbFields<<"\n");
- for(TInt iField = 1; iField <= aNbFields; iField++){
- MED::PFieldInfo aFieldInfo = theMEDWrapper->GetPFieldInfo(aMeshInfo,iField);
- TInt aNbComp = aFieldInfo->GetNbComp();
- std::string aFieldName = aFieldInfo->GetName();
-
- MED::TGeom2Size aGeom2Size;
- MED::EEntiteMaillage aMEntity;
- TInt aNbTimeStamps = theMEDWrapper->GetNbTimeStamps(aFieldInfo,
- theEntityInfo,
- aMEntity,
- aGeom2Size);
- if(aNbTimeStamps < 1)
- continue;
-
- TEntity aVEntity = MEDEntityToVTK(aMEntity);
- PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
- TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- PMEDField aField = aFieldMap[aFieldName];
-
- PFieldMinMax aFieldMinMax(new TFieldMinMax(aField,
- aFieldInfo,
- aNbTimeStamps,
- aMEntity,
- aGeom2Size,
- theMKey2Profile,
- theKey2Gauss,
- theMEDWrapper,
- theMutex));
-
- boost::thread aThread(boost::bind(&GetFieldMinMax,aFieldMinMax));
+ VISU::PMEDMesh myMesh;
+ MED::TEntityInfo myEntityInfo;
+ MED::TMKey2Profile myMKey2Profile;
+ MED::TKey2Gauss myKey2Gauss;
+ MED::PWrapper myMEDWrapper;
+
+ TCalculateMinMax(const VISU::PMEDMesh& theMesh,
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::TMKey2Profile& theMKey2Profile,
+ const MED::TKey2Gauss& theKey2Gauss,
+ const MED::PWrapper& theMEDWrapper):
+ myMesh(theMesh),
+ myEntityInfo(theEntityInfo),
+ myMKey2Profile(theMKey2Profile),
+ myKey2Gauss(theKey2Gauss),
+ myMEDWrapper(theMEDWrapper)
+ {
+ INITMSG(MYMEMORYDEBUG,"TCalculateMinMax() - "<<this<<endl);
+ }
+
+ ~TCalculateMinMax()
+ {
+ INITMSG(MYMEMORYDEBUG,"~TCalculateMinMax() - "<<this<<endl);
+ }
+
+ void
+ Calculate()
+ {
+ TInt aNbFields = myMEDWrapper->GetNbFields();
+ MED::PMeshInfo aMeshInfo = myMesh->myMeshInfo;
+ const std::string& aMeshName = myMesh->myName;
+ INITMSG(MYDEBUG,"MinMaxCalculation: aNbFields = "<<aNbFields<<"\n");
+ for(TInt iField = 1; iField <= aNbFields; iField++){
+ MED::PFieldInfo aFieldInfo = myMEDWrapper->GetPFieldInfo(aMeshInfo,iField);
+ TInt aNbComp = aFieldInfo->GetNbComp();
+ std::string aFieldName = aFieldInfo->GetName();
+
+ MED::TGeom2Size aGeom2Size;
+ MED::EEntiteMaillage aMEntity;
+ TInt aNbTimeStamps = myMEDWrapper->GetNbTimeStamps(aFieldInfo,
+ myEntityInfo,
+ aMEntity,
+ aGeom2Size);
+ if(aNbTimeStamps < 1)
+ continue;
+
+ TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ PMEDMeshOnEntity aMeshOnEntity = myMesh->myMeshOnEntityMap[aVEntity];
+ TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ PMEDField aField = aFieldMap[aFieldName];
+
+ PFieldMinMax aFieldMinMax(new TFieldMinMax(aField,
+ aFieldInfo,
+ aNbTimeStamps,
+ aMEntity,
+ aGeom2Size,
+ myMKey2Profile,
+ myKey2Gauss,
+ myMEDWrapper));
+
+ boost::thread aThread(boost::bind(&GetFieldMinMax,aFieldMinMax));
+ }
}
+ };
+ typedef SharedPtr<TCalculateMinMax> PCalculateMinMax;
+
+
+ //---------------------------------------------------------------
+ void
+ CalculateMinMax(PCalculateMinMax theCalculateMinMax)
+ {
+ theCalculateMinMax->Calculate();
}
aFamilyInfoSet);
#endif
- MinMaxCalculation(aMesh,
- aEntityInfo,
- aMKey2Profile,
- aKey2Gauss,
- aMed,
- myMutex);
+ PCalculateMinMax aCalculateMinMax(new TCalculateMinMax(aMesh,
+ aEntityInfo,
+ aMKey2Profile,
+ aKey2Gauss,
+ aMed));
+
+ boost::thread aThread(boost::bind(&CalculateMinMax,aCalculateMinMax));
#ifndef _DEXCEPT_
}catch(std::exception& exc){